GitHub user rhymoid opened a pull request:
https://github.com/apache/zeppelin/pull/1705
[ZEPPELIN-1729] With CRLF line endings, Livy gets HTTP 500 errors
### What is this PR for?
When you paste text on Windows, you may inadvertedly add some Carriage
Return control characters along with it. When this happens in a Livy paragraph
in Zeppelin 0.6.0, execution of that paragraph will fail with a "500 Internal
Server Error" message. This is because `LivyHelper` does not properly sanitise
its input when generating a JSON payload for the Livy server. This PR takes the
subset for the resolution of
[ZEPPELIN-1430](https://issues.apache.org/jira/browse/ZEPPELIN-1430/) that
should resolve this issue.
### What type of PR is it?
Bug Fix
### What is the Jira issue?
<https://issues.apache.org/jira/browse/ZEPPELIN-1729/>
### How should this be tested?
Paste the following code in a new paragraph, ensuring that lines are ended
by CRLF rather than LF:
%livy.pyspark
import datetime
import json
This can be easily realised on Windows, by copy-pasting this code from
Notepad. Then, try to execute the paragraph. Without the fix, a "500 Internal
Server Error" message should appear. With the fix, the paragraph will
successfully execute (and do nothing interesting).
### Questions:
* Does the licenses files need update? No.
* Is there breaking changes for older versions? No.
* Does this needs documentation? No.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rhymoid/zeppelin ZEPPELIN-1729
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zeppelin/pull/1705.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1705
----
commit b702cc87917c7ff855e7a57eefdd6295bf09215e
Author: Stijn van Drongelen <[email protected]>
Date: 2016-11-29T23:21:50Z
[ZEPPELIN-1729] With CRLF line endings, Livy gets HTTP 500 errors
### What is this PR for?
When you paste text on Windows, you may inadvertedly add some Carriage
Return
control characters along with it. When this happens in a Livy paragraph
in Zeppelin 0.6.0, execution of that paragraph will fail with a "500
Internal
Server Error" message. This is because `LivyHelper` does not properly
sanitise
its input when generating a JSON payload for the Livy server. This PR takes
the subset for the resolution of
[ZEPPELIN-1430](https://issues.apache.org/jira/browse/ZEPPELIN-1430/)
that should resolve this issue.
### What type of PR is it?
Bug Fix
### What is the Jira issue?
<https://issues.apache.org/jira/browse/ZEPPELIN-1729/>
### How should this be tested?
Paste the following code in a new paragraph, ensuring that lines are ended
by
CRLF rather than LF:
%livy.pyspark
import datetime
import json
This can be easily realised on Windows, by copy-pasting this code from
Notepad.
Then, try to execute the paragraph. Without the fix, a "500 Internal Server
Error"
message should appear. With the fix, the paragraph will successfully execute
(and do nothing interesting).
### Questions:
* Does the licenses files need update? No.
* Is there breaking changes for older versions? No.
* Does this needs documentation? No.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---