You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by co...@apache.org on 2016/09/28 01:33:28 UTC

zeppelin git commit: [ZEPPELIN-808] Changed Permissions on Notebooks do not provide helpful error to user

Repository: zeppelin
Updated Branches:
  refs/heads/master dcc1655e3 -> 74ef094f6


[ZEPPELIN-808] Changed Permissions on Notebooks do not provide helpful error to user

### What is this PR for?
This is about showing information to the user when there are errors on running paragraphs eg. there could be permission related issue with notebook.

### What type of PR is it?
Improvement

### Todos
NA

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

### How should this be tested?
* Create a notebook and change the file system permission for the notebook folder to have system level write permission to a different user.For eg. if you are running your local zeppelin server with id [USERNAME], then change the file system permission for one of your notebooks created with the former username to different one eg. ROOT user who will only have the write permission
* Try to run all the paragraphs or any individual paragraph for the notebook
* The information as shown in the screenshot should be displayed and the dialog could be closed by the 'Close' button.

### Screenshots (if appropriate)
![erroraboutrunningparagraph-2](https://cloud.githubusercontent.com/assets/20789766/18507272/4cdffe08-7a8d-11e6-8ec7-c712d28cd155.png)

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

Author: Kavin <ka...@imaginea.com>

Closes #1408 from kavinkumarks/zeppelin-808-handle-notebook-permission-error and squashes the following commits:

21fd49a [Kavin] Exit the run paragraph execution when there are errors with the notebook file system.
950ebda [Kavin] Handle FileSystemException on running paragraph and show the relevant error message to the user.
9f7cf67 [Kavin] Show information to the user when there are errors with related to permission on running paragraphs.


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/74ef094f
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/74ef094f
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/74ef094f

Branch: refs/heads/master
Commit: 74ef094f6bb9cdf50afff91422dd4bad178a762d
Parents: dcc1655
Author: Kavin <ka...@imaginea.com>
Authored: Thu Sep 22 18:19:32 2016 +0530
Committer: Damien CORNEAU <co...@gmail.com>
Committed: Wed Sep 28 10:33:21 2016 +0900

----------------------------------------------------------------------
 .../org/apache/zeppelin/socket/NotebookServer.java   | 14 +++++++++++++-
 .../websocketEvents/websocketEvents.factory.js       | 15 +++++++++++++++
 .../org/apache/zeppelin/notebook/socket/Message.java |  3 ++-
 3 files changed, 30 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/74ef094f/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
index 3e54e05..10c9410 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
@@ -22,6 +22,7 @@ import com.google.gson.GsonBuilder;
 import com.google.gson.reflect.TypeToken;
 
 import org.apache.commons.lang.StringUtils;
+import org.apache.commons.vfs2.FileSystemException;
 import org.apache.zeppelin.conf.ZeppelinConfiguration;
 import org.apache.zeppelin.conf.ZeppelinConfiguration.ConfVars;
 import org.apache.zeppelin.display.AngularObject;
@@ -1147,7 +1148,18 @@ public class NotebookServer extends WebSocketServlet implements
     }
 
     AuthenticationInfo subject = new AuthenticationInfo(fromMessage.principal);
-    note.persist(subject);
+
+    try {
+      note.persist(subject);
+    } catch (FileSystemException ex) {
+      LOG.error("Exception from run", ex);
+      conn.send(serializeMessage(new Message(OP.ERROR_INFO).put("info",
+                "Oops! There is something wrong with the notebook file system. "
+                + "Please check the logs for more details.")));
+      // don't run the paragraph when there is error on persisting the note information
+      return;
+    }
+
     try {
       note.run(paragraphId);
     } catch (Exception ex) {

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/74ef094f/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js b/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
index 36e90b4..6e0bbba 100644
--- a/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
+++ b/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
@@ -117,6 +117,21 @@ angular.module('zeppelinWebApp').factory('websocketEvents',
       $rootScope.$broadcast('noteRevision', data);
     } else if (op === 'INTERPRETER_BINDINGS') {
       $rootScope.$broadcast('interpreterBindings', data);
+    } else if (op === 'ERROR_INFO') {
+      BootstrapDialog.show({
+        closable: false,
+        closeByBackdrop: false,
+        closeByKeyboard: false,
+        title: 'Details',
+        message: data.info.toString(),
+        buttons: [{
+            // close all the dialogs when there are error on running all paragraphs
+            label: 'Close',
+            action: function() {
+              BootstrapDialog.closeAll();
+            }
+          }]
+      });
     }
   });
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/74ef094f/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/socket/Message.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/socket/Message.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/socket/Message.java
index b314e62..2aded60 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/socket/Message.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/socket/Message.java
@@ -139,7 +139,8 @@ public class Message {
     SAVE_INTERPRETER_BINDINGS,    // [c-s] save interpreter bindings
                                   // @param noteID
                                   // @param selectedSettingIds
-    INTERPRETER_BINDINGS          // [s-c] interpreter bindings
+    INTERPRETER_BINDINGS,         // [s-c] interpreter bindings
+    ERROR_INFO                    // [s-c] error information to be sent
   }
 
   public OP op;