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

Sinopia should allow existing users to be added even if maximum amount of users reached #184

Closed
dun3 opened this issue Jan 2, 2015 · 2 comments

Comments

@dun3
Copy link

dun3 commented Jan 2, 2015

Description:

Sinopia does not behave like I expect, when the maximum amount of users is reached, and I want to execute npm adduser on a new machine with an existing user.

Steps to reproduce:

Start sinopia with default config
On client add a user "test" using: npm adduser --registry http://localhost:4873/ --always-auth
Stop sinopia
Edit config, set max_users: -1
Start sinopia
On client add a user "test" using: npm adduser --registry http://localhost:4873/ --always-auth

Expected:

Client: npm finishes without error
Server:
http <-- 409, user: undefined, req: 'PUT /-/user/org.couchdb.user:test', error: bad username/password, access denied
http <-- 200, user: undefined, req: 'GET /-/user/org.couchdb.user:test?write=true', bytes: 0/53
http <-- 201, user: test2, req: 'PUT /-/user/org.couchdb.user:test/-rev/undefined', bytes: 208/86

Actual:

Client:
npm WARN adduser Incorrect username or password
npm WARN adduser You can reset your account by visiting:
npm WARN adduser
npm WARN adduser https://npmjs.org/forgot
npm WARN adduser
npm ERR! Error: maximum amount of users reached : -/user/org.couchdb.user:tobiash
npm ERR! at RegClient. (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:308:14)
npm ERR! at Request._callback (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:246:65)
npm ERR! at Request.self.callback (/usr/lib/node_modules/npm/node_modules/request/request.js:236:22)
npm ERR! at Request.emit (events.js:98:17)
npm ERR! at Request. (/usr/lib/node_modules/npm/node_modules/request/request.js:1142:14)
npm ERR! at Request.emit (events.js:117:20)
npm ERR! at IncomingMessage. (/usr/lib/node_modules/npm/node_modules/request/request.js:1096:12)
npm ERR! at IncomingMessage.emit (events.js:117:20)
npm ERR! at _stream_readable.js:944:16
npm ERR! at process._tickCallback (node.js:442:13)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 3.2.41-042stab094.8
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "adduser" "--registry" "http://localhost:4873/" "--always-auth"
npm ERR! cwd /tmp/npmtest
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/npmtest/npm-debug.log
npm ERR! not ok code 0

Server:
http <-- 403, user: undefined, req: 'PUT /-/user/org.couchdb.user:test', error: maximum amount of users reached

@rondonjon
Copy link

Same problem here ... unable to log in after installing sinopia from scratch, setting max_users to -1, adding a new user to htaccess on the server, and restarting the server.

After reading the documentation I thought that setting max_users to -1 was to prevent people from creating new accounts. Apparently it prevents logins too. Is this really how it's meant to work?

rlidwka added a commit that referenced this issue Feb 12, 2015
Because npm does only accept 409, see #184.
@rlidwka
Copy link
Owner

rlidwka commented Feb 12, 2015

Sorry for the delay. The issue is fixed in 79e2ff2, I'll publish an update to npm in a few hours.

@rlidwka rlidwka closed this as completed Feb 12, 2015
rmg pushed a commit to strongloop-forks/sinopia that referenced this issue Jun 1, 2017
Add additional requirement to output message
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