GitHub user Tagar opened a pull request: https://github.com/apache/zeppelin/pull/1921
[ZEPPELIN-1984] Zeppelin Server doesn't catch all exceptions when launching interpreter.sh https://issues.apache.org/jira/browse/ZEPPELIN-1984 > DEBUG [2017-01-20 13:56:37,688] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:189) - /opt/zeppelin/zeppelin-active/bin/interpreter.sh: line 207: return: can only `return' from a function or sourced script > INFO [2017-01-20 13:56:37,690] ({Exec Default Executor} RemoteInterpreterManagedProcess.java[onProcessComplete]:164) - Interpreter process exited 0 So `return 1` outside of function is not correct and gets ignored by shell interpreters, also it causes Zeppelin to not catch situations when interpreter hasn't started, as shown in ZEPPELIN-1984. As you can see Zeppelin got exit status of interpreter.sh as 0 when it had to be 1 (error). Zeppelin then starts a loop to try to connect interpreter process, and fails half a minute later with `connection refused` ### What is this PR for? Fix for https://issues.apache.org/jira/browse/ZEPPELIN-1984 ### What type of PR is it? Bug Fix ### Todos * [ ] - Task ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-1984 ### How should this be tested? On example of Spark interpreter, remove keytab file and keep --keytab reference to it in SPARK_SUBMIT_OPTIONS. Try to use Spark interpreter. spark-submit will fail with `Exception in thread "main" org.apache.spark.SparkException: Keytab file: /home/someuser/.kt does not exist` but Zeppelin (around [RemoteInterpreterManagedProcess.java](https://github.com/apache/zeppelin/blob/master/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterManagedProcess.java#L121) ) wouldn't capture this problem (or many other problems starting interpreter process [as indicated here](https://issues.apache.org/jira/browse/ZEPPELIN-1984?focusedCommentId=15831000&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15831000) ) This fix for ZEPPELIN-1984 would allow for error to be captured by RemoteInterpreterManagedProcess.java. A future improvement could be made, to carry forward exception from interpreter to RemoteInterpreterManagedProcess.java so end user could clearly see what's the problem, not just that the interpreter could not be started. ### 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/Tagar/zeppelin patch-1 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/zeppelin/pull/1921.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 #1921 ---- commit 42b02bddc261db5f4884f9db1ff0c62a9c6d447f Author: Ruslan Dautkhanov <ta...@users.noreply.github.com> Date: 2017-01-20T21:16:58Z fix for ZEPPELIN-1984 https://issues.apache.org/jira/browse/ZEPPELIN-1984 {quote} DEBUG [2017-01-20 13:56:37,688] ({Exec Stream Pumper} RemoteInterpreterManagedProcess.java[processLine]:189) - /opt/zeppelin/zeppelin-active/bin/interpreter.sh: line 207: return: can only `return' from a function or sourced script INFO [2017-01-20 13:56:37,690] ({Exec Default Executor} RemoteInterpreterManagedProcess.java[onProcessComplete]:164) - Interpreter process exited 0 {quote} So `return 0` outside of function is not correct and gets ignored by shell interpreters, also it causes Zeppelin to not catch situations when interpreter hasn't started, as shown in ZEPPELIN-1984. ---- --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---