Skip to content

Conversation

@cloverhearts
Copy link
Member

@cloverhearts cloverhearts commented Jun 8, 2016

What is this PR

zeppelin server does not restart when incorrect credentials data.

reproduce.

  1. Click to zeppelin home for web ui.
  2. Click to zeppelin Credentials.
  3. 'Entity' information without writing, username and password only written to storage.
  4. Click to zeppelin home for web ui.
  5. Click to zeppelin Credentials.
    and zeppelin restart.
but, Zeppelin does not work.

It creates the wrong json file. 'conf / credentials.json' according to the null.

What type of PR is it?

Hot Fix

What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-976

How should this be tested?

  1. Click to zeppelin home for web ui.
  2. Click to zeppelin Credentials.
  3. 'Entity' information without writing, username and password only written to storage.
  4. Click to zeppelin home for web ui.
  5. Click to zeppelin Credentials.
    and zeppelin restart.

zeppelin does work!

Reproduced Screenshots

zeppelin-server-error2

Questions:

  • Does the licenses files need update? no
  • Is there breaking changes for older versions? no
  • Does this needs documentation? no

@cloverhearts
Copy link
Member Author

retry ci

@cloverhearts cloverhearts reopened this Jun 8, 2016
String password = messageMap.get("password");

if (entity == null || username == null || password == null) {
return new JsonResponse(Status.INTERNAL_SERVER_ERROR, "", "").build();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Status.BAD_REQUEST would be more adequate here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@echarles
Thank you for your feedback.
You're right. i've changed.

@cloverhearts cloverhearts changed the title ZEPPLIN-976 ] HotFix - Incorrect "Credentials" server does not restart. ZEPPLIN-976 ] HotFix - zeppelin server does not restart when incorrect credentials data. Jun 9, 2016
String username = messageMap.get("username");
String password = messageMap.get("password");

if (entity == null || username == null || password == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And they could not be "", or is that case is ok?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty string does not have a problem in Zeppelin server.
I only solve a serious trouble in this pr.

@bzz
Copy link
Member

bzz commented Jun 9, 2016

@cloverhearts thank you for hotfixing!

How do you think, is there a chance we could have a test that reproduces this issue under this PR or do you think it would be to hard add?

@cloverhearts
Copy link
Member Author

@bzz
I think this is a very serious problem.
In my personal opinion, first merge this PR, and improve Credentials feature in future ( new pr ).

Problem situation, please refer to the screenshot.

Reproduce the problem, please note the following:

  1. Click to zeppelin home for web ui.
  2. Click to zeppelin Credentials.
  3. 'Entity' information without writing, username and password only written to storage.
  4. Click to zeppelin home for web ui.
  5. Click to zeppelin Credentials.
    and zeppelin restart.

@Leemoonsoo
Copy link
Member

The fix looks good to me. But like @bzz mentioned, it will be even better if there're unittest for this problem.

@cloverhearts
Copy link
Member Author

@bzz @Leemoonsoo
I am sorry.
do you mean the test code for this feature?

@bzz
Copy link
Member

bzz commented Jun 13, 2016

@cloverhearts yes, if that is not very hard to do

@cloverhearts
Copy link
Member Author

@bzz Okay, i would be make it.
Thank you so much.

@cloverhearts
Copy link
Member Author

add test code about invalid request for credentials api

@cloverhearts
Copy link
Member Author

retry ci

@minahlee
Copy link
Member

@cloverhearts Seems like integration test fails, can you fix it please?

Tests run: 8, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 120.219 sec <<< FAILURE! - in org.apache.zeppelin.integration.ParagraphActionsIT
testTitleButton(org.apache.zeppelin.integration.ParagraphActionsIT)  Time elapsed: 16.504 sec  <<< FAILURE!
java.lang.AssertionError: After Hide Title : The title field contains
Expected: ""
     but: was "Untitled"
    at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
    at org.junit.Assert.assertThat(Assert.java:865)
    at org.junit.rules.ErrorCollector$1.call(ErrorCollector.java:65)
    at org.junit.rules.ErrorCollector.checkSucceeds(ErrorCollector.java:78)
    at org.junit.rules.ErrorCollector.checkThat(ErrorCollector.java:63)
    at org.apache.zeppelin.integration.ParagraphActionsIT.testTitleButton(ParagraphActionsIT.java:355)

@cloverhearts
Copy link
Member Author

@minahlee it's not my issue.
I think the problem seems to arise from a sudden UI test master branch.
Let's solve the problem from a different PR.
One will stop working on this feature.

@astroshim
Copy link
Contributor

LGTM.
@minahlee The selenium test of travis has a problem so @corneadoug is fixing now.

@cloverhearts
Copy link
Member Author

ci pass.
please, check to this pr.

@bzz
Copy link
Member

bzz commented Jun 15, 2016

@cloverhearts thank you for adding tests!
Looks great to me, merging if there is no more discussion

@asfgit asfgit closed this in 1bc3e9c Jun 15, 2016
asfgit pushed a commit that referenced this pull request Jun 15, 2016
…t credentials data.

### What is this PR
zeppelin server does not restart when incorrect credentials data.

reproduce.
1. Click to zeppelin home for web ui.
2. Click to zeppelin Credentials.
3. 'Entity' information without writing, username and password only written to storage.
4. Click to zeppelin home for web ui.
5. Click to zeppelin Credentials.
and zeppelin restart.
##### but, Zeppelin does not work.

It creates the wrong json file. 'conf / credentials.json' according to the null.

### What type of PR is it?
Hot Fix

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-976

### How should this be tested?

1. Click to zeppelin home for web ui.
2. Click to zeppelin Credentials.
3. 'Entity' information without writing, username and password only written to storage.
4. Click to zeppelin home for web ui.
5. Click to zeppelin Credentials.
and zeppelin restart.

zeppelin does work!

### Reproduced Screenshots
![zeppelin-server-error2](https://cloud.githubusercontent.com/assets/10525473/15889828/b92590d8-2da7-11e6-9b51-0a82c3bb9f1f.gif)

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: CloverHearts <cloverheartsdev@gmail.com>

Closes #976 from cloverhearts/hotfix/CredentialsJsonBug and squashes the following commits:

293ab08 [CloverHearts] Merge branch 'master' into hotfix/CredentialsJsonBug
ef256c2 [CloverHearts] Merge branch 'master' into hotfix/CredentialsJsonBug
5079495 [CloverHearts] add test code for credentials backends about invalid request.
e9a1e93 [CloverHearts] Merge branch 'master' into hotfix/CredentialsJsonBug
4b9aba3 [CloverHearts] changed status code for CredentialsRestapi
1e5cd72 [CloverHearts] Credentials Json serialize backend bug.
AhyoungRyu pushed a commit to AhyoungRyu/zeppelin that referenced this pull request Jun 15, 2016
…t credentials data.

### What is this PR
zeppelin server does not restart when incorrect credentials data.

reproduce.
1. Click to zeppelin home for web ui.
2. Click to zeppelin Credentials.
3. 'Entity' information without writing, username and password only written to storage.
4. Click to zeppelin home for web ui.
5. Click to zeppelin Credentials.
and zeppelin restart.
##### but, Zeppelin does not work.

It creates the wrong json file. 'conf / credentials.json' according to the null.

### What type of PR is it?
Hot Fix

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-976

### How should this be tested?

1. Click to zeppelin home for web ui.
2. Click to zeppelin Credentials.
3. 'Entity' information without writing, username and password only written to storage.
4. Click to zeppelin home for web ui.
5. Click to zeppelin Credentials.
and zeppelin restart.

zeppelin does work!

### Reproduced Screenshots
![zeppelin-server-error2](https://cloud.githubusercontent.com/assets/10525473/15889828/b92590d8-2da7-11e6-9b51-0a82c3bb9f1f.gif)

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: CloverHearts <cloverheartsdev@gmail.com>

Closes apache#976 from cloverhearts/hotfix/CredentialsJsonBug and squashes the following commits:

293ab08 [CloverHearts] Merge branch 'master' into hotfix/CredentialsJsonBug
ef256c2 [CloverHearts] Merge branch 'master' into hotfix/CredentialsJsonBug
5079495 [CloverHearts] add test code for credentials backends about invalid request.
e9a1e93 [CloverHearts] Merge branch 'master' into hotfix/CredentialsJsonBug
4b9aba3 [CloverHearts] changed status code for CredentialsRestapi
1e5cd72 [CloverHearts] Credentials Json serialize backend bug.
@cloverhearts cloverhearts deleted the hotfix/CredentialsJsonBug branch June 16, 2016 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants