att / rcloud

Collaborative data analysis and visualization
http://rcloud.social
MIT License
430 stars 142 forks source link

forking foreign notebook fails #2679

Closed gordonwoodhull closed 4 years ago

gordonwoodhull commented 4 years ago

Something must have gotten broken way back with rcloud-gist-services, because it's not possible to fork a notebook which has a different source ('context' in rcloud.support).

It's failing in here:

https://github.com/att/rcloud/blob/7d369e9da9e7803459dc5384462cebab18092b9d/rcloud.support/R/rcloud.support.R#L399-L424

Error: fork_notebook: Error in fun(...) : failed to create new notebook
R trace:
stop("failed to create new notebook")
fun(...)
   at success (https://rcloud-server/js/rcloud_bundle.js:32:23)
From previous event:
   at Object.fork_notebookAsync (https://rcloud-server/js/rcloud_bundle.js:38:54)
   at Object.rcloud.fork_notebook (https://rcloud-server/js/rcloud_bundle.js:488:30)
   at Object.fork_notebook (https://rcloud-server/js/rcloud_bundle.js:4758:27)
   at https://rcloud-server/shell_tab.js:202:22
From previous event:
   at Object.fork_and_name_notebook (https://rcloud-server/shell_tab.js:198:42)
   at create_fork (https://rcloud-server/shell_tab.js:220:27)
   at load (https://rcloud-server/shell_tab.js:229:28)
From previous event:
   at https://rcloud-server/shell_tab.js:54:18
From previous event:
   at Object.RCloud.UI.with_progress (https://rcloud-server/js/rcloud_bundle.js:11513:10)
   at do_load (https://rcloud-server/shell_tab.js:52:26)
   at https://rcloud-server/shell_tab.js:228:26
From previous event:
   at Object.fork_notebook (https://rcloud-server/shell_tab.js:226:42)
   at Object.fork_notebook (https://rcloud-server/editor_tab.js:361:26)
   at HTMLButtonElement.<anonymous> (https://rcloud-server/js/rcloud_bundle.js:10490:38)
   at HTMLButtonElement.dispatch (https://rcloud-server/lib/js/jquery-2.1.1.js:4409:9)
   at HTMLButtonElement.elemData.handle (https://rcloud-server/lib/js/jquery-2.1.1.js:4095:28)
gordonwoodhull commented 4 years ago

Forking does work in many cases; the error is specific to forking a notebook from our core lake to research lake. The other direction works and gist-services to/from github also works.

gordonwoodhull commented 4 years ago

We are taking the whole notebook, including metadata, and passing it to rcloud.create.notebook

And the gist service is returning the error

Could not read document: Can not deserialize instance of java.lang.String out of START_OBJECT token
 at [Source: java.io.PushbackInputStream@6d1b2d70; line: 1, column: 394] (through reference chain: com.mangosolutions.rcloud.rawgist.model.GistRequest["owner"]);
nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token
 at [Source: java.io.PushbackInputStream@6d1b2d70; line: 1, column: 394] (through reference chain: com.mangosolutions.rcloud.rawgist.model.GistRequest["owner"])

Indeed our specialized gist format has an extra field owner, which should be be a string, not an object. The gist content has

  "owner": {
    "login": "gw923c"
  },

and this appears to be the cause of barf.

I think this also indicates that the core lake instance is on an earlier version of gist-services without the shared ownership feature.