question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problems logging in after server running for a while

See original GitHub issue

Describe 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):

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:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
howardcoxcommented, Nov 12, 2019

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.

0reactions
lock[bot]commented, Feb 10, 2020

🤖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! 💘

Read more comments on GitHub >

github_iconTop Results From Across the Web

Logging on a user account fails - Windows Server
This article solves an issue where logging on a user account that's a member of more than 1,010 groups fails. Applies to: Windows...
Read more >
How to Fix Windows 10 Login Problems [EXPERT GUIDE]
The first thing you should immediately try is restarting your computer. If you can get to the log in screen, click on the...
Read more >
How to Fix Problems During the Windows Login Process
First, enable the administrator account via the command prompt. Enter cmd in the Windows search box; under Command Prompt, select Run as ...
Read more >
I can't log in to a website - WhatIsMyBrowser.com
Having trouble logging into a website? There are lots of things that could be wrong. Here's a detailed guide to help you find...
Read more >
Black Screen Or Login Issues (Ubuntu) - System76 Support
The easiest way to confirm your username is by booting into recovery mode, entering a chroot, and running ls in the /home directory,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found