superlogin-demo icon indicating copy to clipboard operation
superlogin-demo copied to clipboard

userDB not seeded

Open AidanNichol opened this issue 9 years ago • 6 comments

I've been trying to run this demo locally.

Install went fine except that the readme said to run bower install which failed but on investigation it would appear that this had already been run as part of npm install via the postinstall script.

Accessing the app takes me to the login screen as expected. I tried a signup and the server gave a stream of errors, e.g.

[Error: {"status":404,"name":"not_found","message":"missing"}]
Error: {"status":404,"name":"not_found","message":"missing"}
    at /www/sites/superlogin-demo/node_modules/superlogin/lib/user.js:75:15
    at runMicrotasksCallback (node.js:337:7)
    at process._tickCallback (node.js:355:11)
GET /auth/validate-email/joe2%40nicholware.co.uk 500 43.748 ms - 2

It would appear that my userDB doesn't have an auth design document. Doesn't pouchdb-seed-design need to be somehow run once to set it up.

AidanNichol avatar Dec 22 '15 08:12 AidanNichol

SuperLogin automatically ensures the design doc is seeded every time the server is started. The demo is working successfully on my localhost and also on Heroku. This issue is likely from your configuration of CouchDB. You need to ensure that SuperLogin has access to write design docs.

If you can find a definite bug in the SuperLogin code, I would be more than happy to patch it.

colinskow avatar Dec 23 '15 20:12 colinskow

@colinskow I hit the same issue using the steps out of the README. No design docs are installed for me either. I've verified my env.sh CouchDB settings--only trying local user creation (no remote authentication provider yet)--and I've made a sldemo-users database (which wasn't made during the setup process either...though maybe it should've been too?).

Here's what the console says about it:

GET /login 304 10.228 ms - -
[Error: Error: write EPROTO]
Error: Error: write EPROTO
    at c:\Users\Benjamin\Documents\GitHub\superlogin-demo\node_modules\superlogin\lib\user.js:50:15
GET /auth/validate-username/bigbluehat 500 24.360 ms - 2

I'm excited by this project, and would love to see superlogin take off. Let me know what I can try to help narrow down the issue!

Thanks, Colin! :tophat:

BigBlueHat avatar Jan 12 '16 15:01 BigBlueHat

I eventually realised where I was going wrong. Despite reading and understanding the instructions I somehow started thinking of env.sh as a sort of config file - but it isn't. It's a shell script and needs to be run manually . env.sh before you run npm start - at least that was my error.

AidanNichol avatar Jan 12 '16 15:01 AidanNichol

@AidanNichol yeah. Good to know, but sadly, that's not my error. :frowning:

Here's the steps I've taken:

  1. npm install
  2. bower install
  3. customize env.sh -- only set the CouchDB bits...saving the others for later :wink:
  4. . env.sh
  5. npm start
  6. http://localhost:3000
  7. Click "Sign-Up"
  8. Put in a user name; get the "already taken" error
  9. Check the console--which output the above error
  10. ...dig around a bit; find out that sldemo-users wasn't created; created it; restarted the server; reran bower install; tried a bunch of other stuff; same situation...

BigBlueHat avatar Jan 12 '16 15:01 BigBlueHat

The net result of not running . env.sh was that my credentials weren't set correctly and so the design document couldn't be create but there was no obvious warning that that had happened. I would think that any error in setting up the name and password could have the same effect!!

AidanNichol avatar Jan 12 '16 15:01 AidanNichol

Sorry for not responding for a while, I've been distracted by other projects.

@AidanNichol it seems that SuperLogin doesn't have permission to write to your CouchDB server. Test it manually via CURL with the same configured user and ensure you can create a DB and seed a design doc.

Within the next couple weeks I am going to update all the deps and re-test everything. Meanwhile, let me know if you can narrow down what is happening.

colinskow avatar Feb 07 '16 02:02 colinskow