Problems logging in after server running for a while
See original GitHub issueDescribe the bug After our Verdaccio server has been running for a while (around about a day but not clear) we start to have problems logging into it. This affects both npm cli and the web interface. We use the LDAP plugin to manage accounts. After several minutes we get 502 bad gateway responses. Restarting the service always fixes it and logins work immediately.
To Reproduce We’re looking at our server logs now to see if there is any time pattern or cause for these 502s, but it seems to just happen after the server has been running for a while.
Expected behavior We should be able to login…
Docker || Kubernetes (please complete the following information):
- We use verdaccio/puppet-verdaccio and are currently installing
v4.3.4
of Verdaccio.
Configuration File (cat ~/.config/verdaccio/config.yaml)
Environment information
verdaccio --info
Environment Info:
System:
OS: XXXX
CPU: XXXX
Binaries:
Node: 10.17.0 - /usr/bin/node
npm: 6.11.3 - /usr/bin/npm
storage: /srv/verdaccio
auth:
ldap:
type: ldap
client_options:
url: "ldaps://ldap.XXXX.com"
searchBase: "ou=XXXX,dc=XXXX,dc=com"
searchFilter: "(uid={{username}})"
groupDnProperty: 'cn'
groupSearchBase: 'ou=groups,dc=XXXX,dc=com'
groupSearchFilter: '(memberUid={{dn}})'
cache: false
listen: 127.0.0.1:4873
logs:
- {type: stdout, format: pretty, level: http}
max_body_size: 200mb
uplinks:
npmjs:
url: https://registry.npmjs.org/
maxage: 86400
packages:
'**':
access: $all
publish: XXXXXXXXXX howard XXXXXXXXXX
proxy: npmjs
'*':
access: $all
publish: XXXXXXXXXX howard XXXXXXXXXX
proxy: npmjs
middlewares:
audit:
enabled: true
Additional context
Log from trying to log in with npm
npm login --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node', '/usr/bin/npm', 'login', '--verbose' ]
npm info using npm@6.12.0
npm info using node@v12.13.0
npm verb npm-session 2e0528b3eecb9052
npm verb web login before first POST
npm http fetch POST 404 https://npm.XXXX.com/-/v1/login 104ms
npm verb web login not supported, trying couch
Username: howard
Password:
Email: (this IS public) XXXX@XXXX.com
npm verb login before first PUT {
npm verb login _id: 'org.couchdb.user:howard',
npm verb login name: 'howard',
npm verb login password: 'XXXXX',
npm verb login type: 'user',
npm verb login roles: [],
npm verb login date: '2019-11-06T11:27:36.618Z'
npm verb login }
npm http fetch PUT 409 https://npm.XXXX.com/-/user/org.couchdb.user:howard 19ms
npm http fetch GET 200 https://npm.XXXX.com/-/user/org.couchdb.user:howard?write=true 42ms
npm http fetch PUT 502 https://npm.XXXX.com/-/user/org.couchdb.user:howard/-rev/undefined 430405ms attempt #3
npm verb adduser before first PUT {
npm verb adduser _id: 'org.couchdb.user:howard',
npm verb adduser name: 'howard',
npm verb adduser password: 'XXXXX',
npm verb adduser email: 'XXXX@XXXX.com',
npm verb adduser type: 'user',
npm verb adduser roles: [],
npm verb adduser date: '2019-11-06T11:34:47.096Z'
npm verb adduser }
npm http fetch PUT 409 https://npm.XXXX.com/-/user/org.couchdb.user:howard 31ms
npm verb stack Error: 409 Conflict - PUT https://npm.XXXX.com/-/user/org.couchdb.user:howard - bad username/password, access denied
npm verb stack at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:104:15
npm verb stack at processTicksAndRejections (internal/process/task_queues.js:93:5)
npm verb stack From previous event:
npm verb stack at regFetch (/usr/lib/node_modules/npm/node_modules/npm-registry-fetch/index.js:76:37)
npm verb stack at Function.fetchJSON [as json] (/usr/lib/node_modules/npm/node_modules/npm-registry-fetch/index.js:110:10)
npm verb stack at Object.adduserCouch (/usr/lib/node_modules/npm/node_modules/npm-profile/index.js:149:16)
npm verb stack at /usr/lib/node_modules/npm/lib/auth/legacy.js:50:22
npm verb stack at processImmediate (internal/timers.js:439:21)
npm verb stack From previous event:
npm verb stack at login (/usr/lib/node_modules/npm/lib/auth/legacy.js:44:11)
npm verb stack at Object.module.exports.login (/usr/lib/node_modules/npm/lib/auth/legacy.js:39:3)
npm verb stack at EventEmitter.adduser (/usr/lib/node_modules/npm/lib/adduser.js:42:8)
npm verb stack at Object.commandCache.<computed> (/usr/lib/node_modules/npm/lib/npm.js:156:13)
npm verb stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/bin/npm-cli.js:131:30)
npm verb stack at processTicksAndRejections (internal/process/task_queues.js:75:11)
npm verb statusCode 409
npm verb cwd XXXXXXXXXXXX
npm verb Linux 4.9.0
npm verb argv "/usr/bin/node" "/usr/bin/npm" "login" "--verbose"
npm verb node v12.13.0
npm verb npm v6.12.0
npm ERR! code E409
npm ERR! 409 Conflict - PUT https://npm.XXXX.com/-/user/org.couchdb.user:howard - bad username/password, access denied
npm verb exit [ 1, true ]
npm timing npm Completed in 441072ms
HTTP response from browser login attempts:
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
Thanks @juanpicado, we’ve updated our version of the plugin to 4.0 and it seems more stable. Sorry I hadn’t realised that the core Verdaccio team don’t maintain these plugins. This issue can probably be closed now.
🤖This thread has been automatically locked 🔒 since there has not been any recent activity after it was closed. We lock tickets after 90 days with the idea to encourage you to open a ticket with new fresh data and to provide you better feedback 🤝and better visibility 👀. If you consider, you can attach this ticket 📨 to the new one as a reference for better context. Thanks for being a part of the Verdaccio community! 💘