Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

After login, nothing happens #478

Closed
gr2m opened this issue May 23, 2016 · 15 comments
Closed

After login, nothing happens #478

gr2m opened this issue May 23, 2016 · 15 comments

Comments

@gr2m
Copy link

gr2m commented May 23, 2016

follow up for #475. I updated to latest master and updated all dependencies. The server does not crash anymore, but now nothing happens after signing in

hospitalrun-nothing-after-login

@pgte
Copy link

pgte commented May 24, 2016

I also have this issue. By digging into devtools, I could see that the chkuser response is:

{"error":true,"errorResult":{"message":"Name or password is incorrect.","stack":"Error: Name or password is incorrect.\n    at Request._callback (/Users/pedroteixeira/projects/hospitalrun/hospitalrun-frontend/node_modules/nano/lib/nano.js:248:15)\n    at Request.self.callback (/Users/pedroteixeira/projects/hospitalrun/hospitalrun-frontend/node_modules/request/request.js:200:22)\n    at emitTwo (events.js:106:13)\n    at Request.emit (events.js:191:7)\n    at Request.<anonymous> (/Users/pedroteixeira/projects/hospitalrun/hospitalrun-frontend/node_modules/request/request.js:1067:10)\n    at emitOne (events.js:101:20)\n    at Request.emit (events.js:188:7)\n    at IncomingMessage.<anonymous> (/Users/pedroteixeira/projects/hospitalrun/hospitalrun-frontend/node_modules/request/request.js:988:12)\n    at emitNone (events.js:91:20)","name":"Error","error":"unauthorized","reason":"Name or password is incorrect.","scope":"couch","statusCode":401,"request":{"method":"GET","headers":{"content-type":"application/json","accept":"application/json"},"uri":"http://XXXXXX:XXXXXX@localhost:5984/_users/org.couchdb.user%3Aadmin"},"headers":{"date":"Tue, 24 May 2016 15:22:36 GMT","content-type":"application/json","cache-control":"must-revalidate","statusCode":401,"uri":"http://XXXXXX:XXXXXX@localhost:5984/_users/org.couchdb.user%3Aadmin"},"errid":"non_200","description":"couch returned 401"}}

Before the chkuser request, the POST /_session request succeeded (CouchDB replied with {ok: true, ...}...

BTW, I'm trying this with Node 4 and 6.

@jkleinsc
Copy link
Member

@gr2m @pgte I cannot duplicate this. What version of couch are you using?
One thing to check is the server/config.js file to verify that the
couchAdminUser and couchAdminPassword are correct for your couch install.
By default these values are couchAdmin/test, but if you already had couch running/setup with an admin party, the initcouch.sh script will not create this user. In that case, you can use hradmin/test or any other admin user that has been created.

@pgte
Copy link

pgte commented May 24, 2016

@jkleinsc yup, that was it, solved for me.
Sorry about this.

@gr2m
Copy link
Author

gr2m commented May 25, 2016

yup, same here. At what point does couchAdminUser and couchAdminPassword get set? I’ve run ./script/initcouch.sh USER PASS with USER and PASS of an existing admin account in my local CouchDB – maybe that was the problem?

@jkleinsc
Copy link
Member

@gr2m couchAdminUser and couchAdminPassword do not get set by the script. They are just set to default username/pw that the script creates. The README needs to be updated to reflect this.

@chobberoni
Copy link

@jkleinsc any reason as to why i'd be getting this error?

image

In, the couchdb local tool, it shows that couchadmin and test are valid, but the app doesn't recognize them for some odd reason.

@jkleinsc
Copy link
Member

@chobberoni can you click on the headers tab and see what url it is trying to go to?

@chobberoni
Copy link

@jkleinsc

this is what I get back in the Headers tab (for _session response):
image

and for (chkuser response):
image

and on the Fauxton page for couchdb it shows that I can verify things from the DBs end:
image

@jkleinsc
Copy link
Member

@chobberoni In fauxton can you verify that there is a database called main and another one called config? Also, in the _users db there should be a user with the id org.couchdb.user:hradmin
If any of these are missing, you will need to run script/initcouch.sh: https://github.com/HospitalRun/hospitalrun-frontend/blob/master/script/initcouch.sh

@chobberoni
Copy link

@jkleinsc I got it to work by manually creating the _users db in fauxton.
The main and config dbs were already in there.

However, the initcouch.sh script is still not running properly (oh well for now) -- here's the output for now:
image

thanks!!! <3

@JoseCage
Copy link

JoseCage commented Apr 3, 2018

@chobberoni you fixed your problem? I'm getting the same error here using "hradmin" "test".

image

@vpeg49
Copy link

vpeg49 commented Jan 15, 2019

@chobberoni you fixed your problem? I'm getting the same error here using "hradmin" "test".

image

@JoseCage i'm getting this same error, do yoy fixed it?

@JoseCage
Copy link

@JoseCage I'm getting this same error, do yoy fixed it?

Not. I didn't find a solution.

@vpeg49
Copy link

vpeg49 commented Jan 15, 2019

@JoseCage I'm getting this same error, do yoy fixed it?

Not. I didn't find a solution.

i added admin and hradmin as admin users on fauxton's main db permissions, and it's working now

http://127.0.0.1:5984/_utils/#/database/main/permissions

@JoseCage
Copy link

i added admin and hradmin as admin users on fauxton's main db permissions, and it's working now

Great. I'm not using anymore. But i'll remember if i need again. Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants