Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Invalid parameter: redirect_uri" on new setup #219

Closed
AlexanderGetka-cbica opened this issue Feb 18, 2021 · 23 comments
Closed

"Invalid parameter: redirect_uri" on new setup #219

AlexanderGetka-cbica opened this issue Feb 18, 2021 · 23 comments

Comments

@AlexanderGetka-cbica
Copy link

AlexanderGetka-cbica commented Feb 18, 2021

I've recently installed ePADlite from the instructions/download available at https://epad.stanford.edu/epad-agreement.

Setup through docker-compose works for me. However, when I connect (via localhost or my hostname in the browser), I briefly see the ePAD UI before being redirected to a page with only the following contents:

ePad We are sorry... Invalid parameter: redirect_uri

I believe this error originates from Keycloak. Some brief searching yielded this page which suggests that this is some sort of Keycloak redirect setting that should be editable from the admin console.
However, going to the keycloak admin console (via http://getka-pc/keycloak/ in my case) fails and yields a page that says "Loading..." but never actually loads. According to answers here this has something to do with settings in Keycloak's standalone.xml causing some URLs to not be prepended with "/auth/". I looked at the Dockerfile under the Keycloak subdirectory of my "epad_lite_dist" folder and noticed that it seems to be directly manipulating the same fields in standalone.xml as mentioned in the above SO page.

I would like to try out ePADlite but I really have no idea what to do from here. Are there any tweaks I can make from the user-side to try and fix this?

Thank you!

@acavit
Copy link
Contributor

acavit commented Feb 18, 2021 via email

@AlexanderGetka-cbica
Copy link
Author

Hi @acavit, thank you for the quick response!

In my epad configuration file I set the hostname to be "Getka-PC". Is it possible that it's case-sensitive somehow? If so, I can try to re-configure and try again.

Also, when I use the link you provided and select the Administration console, I get auto-redirected to the page http://getka-pc/keycloak/auth/admin/master/console/ , which displays the following:
image
This page never actually loads.
Looking at the dev tools on Firefox/Chrome reveals that the page tries to load several scripts, and they fail with code 500 (log is attached).
epadHTTPlogs.txt

Please let me know if there are any additional diagnostic steps I can take.

@acavit
Copy link
Contributor

acavit commented Feb 18, 2021 via email

@AlexanderGetka-cbica
Copy link
Author

OK, this fixed the issue with ePAD redirecting me, I can now access the application at a basic level. Thanks!

However, I suspect a few things are still wrong -- please let me know if I should open another issue for this.

First, the keycloak admin console is still inaccessible, same page/error.

Second, the UI appears to be missing some components, and uploading DICOMs via the upload dialog doesn't seem to cause any change. The page looks like the following screenshot, and nothing I do seems to add information. (I only included the top, the rest of the view is just gray.)
image
Clicking Display doesn't make any change and using the upload button succeeds/throws no error, but nothing appears afterwards in any menu I can find... am I missing something?

Let's coordinate for a call whenever you have time in the next few days.

@acavit
Copy link
Contributor

acavit commented Feb 18, 2021 via email

@AlexanderGetka-cbica
Copy link
Author

OK, setting the mode to thick made some further progress.

Now I see more of the UI (with Reports, Flex and Projects), but now it wants me to create a project before I can upload anything. Based on the documentation, this makes sense. But when I try to create a project (or add a user, or anything...) I get the following text:
image
"Verifying token and getting userinfo: getaddrinfo ENOTFOUND getka-pc".

@acavit
Copy link
Contributor

acavit commented Feb 18, 2021 via email

@AlexanderGetka-cbica
Copy link
Author

Oddly, when I redirect this to my log file I get the following:

You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
TypeError: Cannot read property 'define' of undefined
at module.exports (/home/node/app/models/annotations.js:4:20)
at Object.initOntologyModels (/home/node/app/plugins/Ontology.js:20:9)
at /home/node/app/plugins/Ontology.js:476:15
at manageErr (/home/node/app/node_modules/fastify/fastify.js:436:11)
at exit (/home/node/app/node_modules/fastify/lib/hooks.js:90:5)
at manageTimeout (/home/node/app/node_modules/fastify/lib/hooks.js:107:11)
at _encapsulateThreeParam (/home/node/app/node_modules/avvio/boot.js:545:7)
at Boot.timeoutCall (/home/node/app/node_modules/avvio/boot.js:447:5)
at Boot.callWithCbOrNextTick (/home/node/app/node_modules/avvio/boot.js:428:19)
at Task.release (/home/node/app/node_modules/fastq/queue.js:143:16)

But anyway the log is attached.
epad_lite.log

@acavit
Copy link
Contributor

acavit commented Feb 18, 2021 via email

@AlexanderGetka-cbica
Copy link
Author

I didn't change anything from between these installations. The first time before I ran the installation I changed everything in epad.yml to have admin/admin as the credentials for everything I could (keycloak, couchdb, and mariadb) as mentioned in the installation guide. Is that what you're talking about? Is there a specific location to control the mysql user/password?

@acavit
Copy link
Contributor

acavit commented Feb 18, 2021 via email

@AlexanderGetka-cbica
Copy link
Author

docker exec -it epad_mariadb sh
#mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Hmm, seems like it's not allowing this. I do have the password and root password set to the same in this instance if that matters.

@acavit
Copy link
Contributor

acavit commented Feb 18, 2021 via email

@AlexanderGetka-cbica
Copy link
Author

All containers were/are healthy both before and after a restart.
I see: epad_mariadb, epad_couchdb, epad_keycloak, epad_dicomweb, epad_lite, epad_js all running.

I'm on Windows using MobaXTerm for the Linux utilities. Every script so far has run without any sort of error message. I'm also going to try on an Ubuntu 18.04 workstation later tonight, I'll let you know how that goes.

@acavit
Copy link
Contributor

acavit commented Feb 19, 2021 via email

@acavit
Copy link
Contributor

acavit commented Feb 19, 2021 via email

@acavit
Copy link
Contributor

acavit commented Feb 19, 2021 via email

@AlexanderGetka-cbica
Copy link
Author

Thanks so much again for the detailed support. I'll give this a try!

@yonefx
Copy link

yonefx commented Feb 21, 2021

Hi Alexander,

I've encountered the same issues as you on keycloak. I switched back to keycloak 11.0.0 and it seems to solve the problem.
I've also encountered another issue related to missing the _users database in CouchDB. I've created one and the problem disappeared.

Now it couldn't start the ReactJS's epadlite server. I've encountered the following

{"level":40,"time":1613730165830,"pid":17,"hostname":"fc996b546722","msg":"Migrated worklist_user"}
{"level":40,"time":1613730165831,"pid":17,"hostname":"fc996b546722","msg":"Migrated worklist"}
{"level":40,"time":1613730165876,"pid":17,"hostname":"fc996b546722","msg":"Migrated worklist_study"}
{"level":40,"time":1613730165983,"pid":17,"hostname":"fc996b546722","msg":"worklist_id column is added to project_subject_study_series_user_status"}
{"level":40,"time":1613730165990,"pid":17,"hostname":"fc996b546722","msg":"We need to migrate the db for lite project"}
{"level":40,"time":1613730166012,"pid":17,"hostname":"fc996b546722","msg":"Lite project is created"}
{"level":50,"time":1613730166021,"pid":17,"hostname":"fc996b546722","msg":"Cannot connect to mariadb (err:afterDBReady. Error: Lite2thick data migration. Error: Cannot read property 'filter' of undefined), shutting down the server"}
{"level":30,"time":1613730166393,"pid":17,"hostname":"fc996b546722","msg":"Server listening at http://0.0.0.0:8080"}

Any advice on this would be appreciated.

@acavit
Copy link
Contributor

acavit commented Feb 21, 2021 via email

@yonefx
Copy link

yonefx commented Feb 22, 2021

Hi Are you using sudo during the installation process? Did you make your couchdb data folder public (777) ? What is your operating system? Wkuld you try mode:thick instead of mode: lite Thanks Cavit

On Sun, Feb 21, 2021, 5:18 AM yonefx @.***> wrote: Hi Alexander, I've encountered the same issues as you on keycloak. I switched back to keycloak 11.0.0 and it seems to solve the problem. I've also encountered another issue related to missing the _users database in CouchDB. I've created one and the problem disappeared. Now it couldn't start the ReactJS's epadlite server. I've encountered the following {"level":40,"time":1613730165830,"pid":17,"hostname":"fc996b546722","msg":"Migrated worklist_user"} {"level":40,"time":1613730165831,"pid":17,"hostname":"fc996b546722","msg":"Migrated worklist"} {"level":40,"time":1613730165876,"pid":17,"hostname":"fc996b546722","msg":"Migrated worklist_study"} {"level":40,"time":1613730165983,"pid":17,"hostname":"fc996b546722","msg":"worklist_id column is added to project_subject_study_series_user_status"} {"level":40,"time":1613730165990,"pid":17,"hostname":"fc996b546722","msg":"We need to migrate the db for lite project"} {"level":40,"time":1613730166012,"pid":17,"hostname":"fc996b546722","msg":"Lite project is created"} {"level":50,"time":1613730166021,"pid":17,"hostname":"fc996b546722","msg":"Cannot connect to mariadb (err:afterDBReady. Error: Lite2thick data migration. Error: Cannot read property 'filter' of undefined), shutting down the server"} {"level":30,"time":1613730166393,"pid":17,"hostname":"fc996b546722","msg":"Server listening at http://0.0.0.0:8080"} Any advice on this would be appreciated. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#219 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFUAUTBUSCL637PJVDQLRLTAEB4DANCNFSM4X25HSAA .

Solved by using v0.5 for both epadlite and epadjs and changed to the think mode
Works like a charm.

@acavit
Copy link
Contributor

acavit commented Feb 23, 2021 via email

@acavit
Copy link
Contributor

acavit commented Feb 25, 2021

Great to hear that it solved the issue. Thanks for your feedback during the installation process.

@acavit acavit closed this as completed Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants