jupyterlab / jupyterlab-google-drive

Cloud storage for JupyterLab using Google Drive
BSD 3-Clause "New" or "Revised" License
400 stars 76 forks source link

Can't run in jupyterhub #37

Closed barche closed 7 years ago

barche commented 7 years ago

Hi,

Trying this on our local JupyterHub server (using DockerSpawner) doesn't seem to work, it just shows the GoogleDrive logo without any "sign in" button. The container logs show no errors:

[I 2017-07-19 10:57:06.622 xxxxxxxxx extension:38] JupyterLab alpha preview extension loaded from /opt/conda/lib/python3.6/site-packages/jupyterlab
JupyterLab v0.25.2
Known labextensions:
   app dir: /opt/conda/share/jupyter/lab
        @jupyterlab/google-drive  enabled  OK

I also updated the API key according to https://github.com/jupyterlab/jupyterlab-google-drive/issues/7#issuecomment-306992372.

Is there a way to get more info to debug this?

ian-r-rose commented 7 years ago

Hi @barche, I am adding a better error message for this case in the next release (I agree that the lack of proper error messages here is a problem!), though that does not help your case right now. A couple of things to note:

  1. This error is indeed due to a mismatch of your origin (URL) and your CLIENT ID. If you are substituting your API key, I don't think that will work.
  2. Have you setup your own project in the Google Developer Console, as described in advanced.md?
  3. If you have set up your own Client ID, can you try adding it in the in-app Settings Editor, rather than patching it in via sed? That trick is a temporary workaround for a server-side setting of the ID, which is no longer necessary in master, and will be in the next release.
barche commented 7 years ago

Thanks, I realised in the mean time that the script URL was not set properly in the Google Dev Console, after that I got further, but clicking "Sign In" resulted in an invalid scope error, probably because all of the Drive permissions are needed for now. I don't know how to use the settings editor actually, I can't seem to save the file somehow, but the sed trick seems to work for now.

ian-r-rose commented 7 years ago

Glad to hear it.

The settings editor is a bit tricky, basically you need to enter valid JSON, then a checkmark will appear which allows you to save changes. So it would look something like this:

{
  "clientId": "yourClientIdHere"
}

When you click sign-in there should be a popup box from Google asking for permissions. If there was not, perhaps a popup blocker was preventing it?

barche commented 7 years ago

Aha, thanks for the tip regarding the settings editor, it does indeed work. With the popup, I get a warning that the app hasn't been reviewed by Google, presumably because complete drive access is requested, but that's already covered in issue #8. I also tried with older credentials for the same site (JuliaBox install instead of JupyterHub) and there the warning doesn't appear, so this requirement for manual review seems a recent thing.

ian-r-rose commented 7 years ago

I am not sure that I have seen that specific popup. Does the app work after the warning?

barche commented 7 years ago

Yes, after overriding the warning. I think this only appears if the application registered in the development console is new enough. And reverting to drive.file permission also prevents it.

ian-r-rose commented 7 years ago

Interesting, thanks for the info. Is this issue solved, then?

barche commented 7 years ago

Yes it is!

ian-r-rose commented 7 years ago

JupyterLab v0.26 has landed, with the ability to have server-side settings, so the sed trick should be less necessary.