openshift-homeroom / workshop-spawner

Multi user spawner for workshop terminals or dashboard.
Apache License 2.0
18 stars 20 forks source link

Workshop App fails to render page because of Auth settings #18

Closed utherp0 closed 5 years ago

utherp0 commented 5 years ago

When installing the app via the template on a hosted Openshift (via RHPDS) on AWS this error is returned constantly:

{"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":"eyJzdGF0ZV9pZCI6ICI0MzBhN2ExNzc5MDg0MjBhOThiYjAwN2Y1ZTUwNjkzZiIsICJuZXh0X3VybCI6IG51bGx9"}

App was created in the 'workspace' project (pre-created) using:

oc new-app https://raw.githubusercontent.com/openshift-labs/workshop-spawner/master/templates/terminal-server-production.json --param PROJECT_NAME=oc project --short --param CLUSTER_SUBDOMAIN=cmrcl-a05a.openshiftworkshop.com

Seems to be an Auth redirection issue but before the last commit this worked fine.

GrahamDumpleton commented 5 years ago

The CLUSTER_SUBDOMAIN would need to start with apps..

GrahamDumpleton commented 5 years ago

BTW, OCP 4 clusters in RHPDS should come with this pre-installed in the terminal project.

utherp0 commented 5 years ago

Still fails when I use the apps.(subdomain). Looks like an auth token passthrough issue.... This is on 3.11

GrahamDumpleton commented 5 years ago

I just tried it on a 3.11 RHPDS cluster, using:

oc new-app https://raw.githubusercontent.com/openshift-labs/workshop-spawner/master/templates/terminal-server-production.json --param PROJECT_NAME=`oc project --short` --param CLUSTER_SUBDOMAIN=apps.grumpy-xxxx.openshiftworkshop.com

and it worked with no issues.

Sometimes you can have strange issues if there are stale cookies. Suggest you find any cookies for the apps.grumpy-xxxx.openshiftworkshop.com domain in the browser and delete them. Also try a different browser. Which browser are you using?

Also, ensure that everything from old deployment is deleted:

oc delete all,serviceaccount,configmap,secret,persistentvolumeclaim,rolebinding,oauthclient -l app=terminal-`oc project --short`

If not all resources were cleaned up from a previous deployment and you tried to deploy from the template again, oc new-app will not replace existing resources of the same name. So if resources were left from prior version, chance the old resources are not quite set up the same. Best even to try it in a new project, or delete the project you are using and ensure starting over fresh.

utherp0 commented 5 years ago

Sorted, superb stuff - it was remnants of state from previous failed attempts, created a clean project and provided the correct params, worked.... 30 mins before the demo so a Godsend :-)