jupyter-on-openshift / jupyterhub-quickstart

OpenShift compatible version of the JupyterHub application.
Apache License 2.0
101 stars 107 forks source link

Sign in issue #32

Closed jaypal17 closed 4 years ago

jaypal17 commented 4 years ago

Hi Graham,

I was wondering if you could help me out with an issue. I am trying to setup Jupyterhub Workspace for a demo on Friday. I followed your documentation and after deployment I open the URL and I get a prompt to sign in with Openshift but then receive this msg: {"error":"unauthorized_client","error_description":"The client is not authorized to request a token using this method.","state":"eyJzdGF0ZV9pZCI6ICJmZjk4ZjUzYmVlNjQ0ZWU2Yjc4YmE2YTg4OWYxZDdiZSIsICJuZXh0X3VybCI6ICIifQ=="} I have a feeling it has something to do with oauthclient but when I run the cmd to get the oauthclient for my app, I get a msg that no resource is found. I am running Openshift 4.2.8 with crc version: 1.2.0+c2e3c0f.

jaypal17 commented 4 years ago

Update I am now receiving this msg: {"error":"invalid_request","error_description":"The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.","state":"eyJzdGF0ZV9pZCI6ICI0YzA5MGVhMjVlOTI0NWY0YmIxMjU5Yjc3NTNmYTBhOSIsICJuZXh0X3VybCI6ICIifQ=="}

Still using the same version of Openshift and CRC. I am able to confirm that I have oauthclient now.

GrahamDumpleton commented 4 years ago

Can you be more exact about which instructions you are following and the specific steps you are doing?

jaypal17 commented 4 years ago

I am following the "Multi User Developer Workspace" under README.md.

What I have done:

  1. Singed in as Kubeadmin through Openshift web console and cmd line.
  2. Created a new project
  3. Applied the s2i-minimal-notebook.json and jupyterhub.json imagestream into my project.
  4. Loaded all the JupyterHub templates
  5. Ran oc new-app --template jupyterhub-workspace --param CLUSTER_SUBDOMAIN=A.B.C.D.nip.io --param SPAWNER_NAMESPACE= "myproject" --param VOLUME_SIZE=1Gi --param IDLE_TIMEOUT=3600
  6. Once the pods snip up, I go to the Jupyterhub workspace app and access the route.
  7. A new tab opens and it says "Sign in with OpenShift". I click that button and I receive this error: {"error":"invalid_request","error_description":"The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.","state":"eyJzdGF0ZV9pZCI6ICI0YzA5MGVhMjVlOTI0NWY0YmIxMjU5Yjc3NTNmYTBhOSIsICJuZXh0X3VybCI6ICIifQ=="}
GrahamDumpleton commented 4 years ago

And the A.B.C.D in A.B.C.D.nip.io was replaced with the actual IP address of the OpenShift cluster, and that was not 127.0.0.1?

jaypal17 commented 4 years ago

I am able to sign in using openshift. I used api.crc.testing for the CLUSTER_SUBDOAMIN. But now when I click start server I get this msg: Spawn failed: pod/jupyterhub-nb-kube-3aadmin did not start in 120 seconds! Below is the error log from the pod running my jupyterhub project. jupyterhub_pod_log_JP.txt

GrahamDumpleton commented 4 years ago

You need the events/logs from the pod for the notebook as it is starting to work out reason. Usually this occurs because the image for the notebook took too long to pull down from remote image registry the first time. Keep trying and once has been pulled down, should start fine.

jaypal17 commented 4 years ago

Here is the log for the notebook pod. jupyterhub-nb-kube-3aadmin-notebook.log

Also here is the event log from the jupyterhub page as it tries to launch the server. Server requested 2020-01-30 19:50:18+00:00 [Normal] Successfully assigned myproject/jupyterhub-nb-kube-3aadmin to crc-2n9vw-master-0 2020-01-30 19:50:26+00:00 [Normal] Container image "quay.io/jupyteronopenshift/s2i-minimal-notebook-py36@sha256:b50095586f983221db236f61cd88cf695d51a27109cc6c6626175eb2a5604fa2" already present on machine 2020-01-30 19:50:27+00:00 [Normal] Created container setup-volume 2020-01-30 19:50:27+00:00 [Normal] Started container setup-volume 2020-01-30 19:50:27+00:00 [Normal] Container image "quay.io/jupyteronopenshift/s2i-minimal-notebook-py36@sha256:b50095586f983221db236f61cd88cf695d51a27109cc6c6626175eb2a5604fa2" already present on machine 2020-01-30 19:50:27+00:00 [Normal] Created container notebook 2020-01-30 19:50:27+00:00 [Normal] Started container notebook 2020-01-30 19:50:31+00:00 [Warning] Back-off restarting failed container

I have re-tried launching the server about 4 times now and it still fails to pull down the image. Is there a work around for this?

GrahamDumpleton commented 4 years ago

You can't use the kube:admin account. Use a different user account. One which doesn't have : in the user name.

jaypal17 commented 4 years ago

That fixed it! Thanks so much. What I was doing was launching JupyterHub within openshift and I would click sign in using openshift as I was still logged in as kubeadmin still. Instead of clicking the sign in with openshift button I signed out of the kubeadmin account, then logged in as developer and then clicked the button to sign in with openshift.

GrahamDumpleton commented 4 years ago

Technically I could probably fix the issue with kube:admin not working, but logging in as a user which is cluster admin isn't a good idea anyway, so have left it as is to discourage it. Good to see is working.