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.

Hostname should be a per request thing

See original GitHub issue

Your Environment

  • verdaccio version: 5.7.0
  • node version [12.x.x, 14.x.x]: 14.18.2
  • package manager: [npm@7, pnpm@6, yarn@2] docker
  • os: [mac, windows@10, linux] docker
  • platform: [npm, docker, helm, other] docker

Describe the bug

Currently, verdaccio hostname is not a per request thing. Seems the hostname from first req is persist forever.

To Reproduce

$ docker-compose down
$ docker-compose up -d
$ curl http://aaa:4873/foobar | grep tarball
"tarball": "http://aaa:4873/xxx.tgz"
$ curl http://bbb:4873/foobar | grep tarball
"tarball": "http://aaa:4873/xxx.tgz"

$ docker-compose down
$ docker-compose up -d
$ curl http://bbb:4873/foobar | grep tarball
"tarball": "http://bbb:4873/xxx.tgz"
$ curl http://aaa:4873/foobar | grep tarball
"tarball": "http://bbb:4873/xxx.tgz"

Expected behavior

$ docker-compose down
$ docker-compose up -d
$ curl http://aaa:4873/foobar | grep tarball
"tarball": "http://aaa:4873/xxx.tgz"
$ curl http://bbb:4873/foobar | grep tarball
"tarball": "http://bbb:4873/xxx.tgz"

$ docker-compose down
$ docker-compose up -d
$ curl http://bbb:4873/foobar | grep tarball
"tarball": "http://bbb:4873/xxx.tgz"
$ curl http://aaa:4873/foobar | grep tarball
"tarball": "http://aaa:4873/xxx.tgz"

Screenshots, server logs, package manager log

Configuration File (cat ~/.config/verdaccio/config.yaml)

Environment information

Debugging output

  • $ NODE_DEBUG=request verdaccio display request calls (verdaccio <–> uplinks)
  • $ DEBUG=verdaccio* verdaccio enable extreme verdaccio debug mode (verdaccio api)
  • $ npm -ddd prints:
  • $ npm config get registry prints:

Contribute to Verdaccio

  • I’m willing to fix this bug 🥇

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
loynoircommented, Mar 13, 2022

Seems 5.X has this bug, v6.0.0-6-next.30 fixed it.

0reactions
loynoircommented, Mar 13, 2022

First request using 127.0.0.1

Without docker, v6.0.0-6-next.30, second req: ok

$ curl x.x.x.x:14873/foobar |grep tarball
"tarball": "http://x.x.x.x:14873/foobar.tgz"

With docker, 5.7.0, second req: fail

$ curl x.x.x.x:24873/foobar |grep tarball
"tarball": "http://127.0.0.1:24873/foobar.tgz"

Without docker, 5.7.0, second req: fail

$ curl x.x.x.x:24873/foobar |grep tarball
"tarball": "http://127.0.0.1:24873/foobar.tgz"
Read more comments on GitHub >

github_iconTop Results From Across the Web

Hostname - Wikipedia
Hostnames may be simple names consisting of a single word or phrase, or they may be structured. Each hostname usually has at least...
Read more >
What is a hostname? - Opensource.com
A hostname should be between 1 and 63 ASCII characters in length; A FQDN has a maximum length of 253 ASCII characters; Case-insensitive;...
Read more >
Amazon EC2 instance hostname types - AWS Documentation
This section describes the Amazon EC2 instance guest OS hostname types available when you launch instances into your VPC subnets. The hostname distinguishes ......
Read more >
Need to modify Host header and Hostname, but not to same ...
request always matches the updated hostname. This is not what I want, and I'll explain why. matches the hostname under which the config...
Read more >
Hostnames for Local Application Servers - Commotion Wireless
Each node has a file called “hosts”, that lists hostnames and the corresponding IP addresses. When a user connected to a node tries...
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