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

Version 5.22.0 fails to start with enabled experiments #3666

Closed
1 task
justusbunsi opened this issue Mar 7, 2023 · 5 comments · Fixed by #3668
Closed
1 task

Version 5.22.0 fails to start with enabled experiments #3666

justusbunsi opened this issue Mar 7, 2023 · 5 comments · Fixed by #3668
Assignees
Milestone

Comments

@justusbunsi
Copy link

Your Environment

  • verdaccio version: 5.22.0
  • node version [12.x.x, 14.x.x]: v18.14.0
  • package manager: npm@9.3.1
  • os: linux
  • platform: docker

Describe the bug

Verdaccio 5.22.0 is not able to start when passing a configuration with following changes according to the default configuration:

- #experiments:
+ experiments:
+   token: true

The only change according to the release notes is #3658.

To Reproduce

  • Adjust the default configuration of the repository (./conf/default.yaml) according to the diff shown above
  • Run docker run --rm -it -p "4873:4873" -e "DEBUG=verdaccio*" -v "./conf/default.yaml:/verdaccio/conf/config.yaml" verdaccio/verdaccio:5.22.0@sha256:dc43f691adf8629fd66d8fdf0d874d37fdeb772d612b7624d343dd544f1daeed

Expected behavior

Verdaccio starts properly without errors.

Screenshots, server logs, package manager log

See debug output below.

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

Adjusted default configuration

Comments have been removed for better readability.

storage: ./storage
plugins: ./plugins

web:
  title: Verdaccio

auth:
  htpasswd:
    file: ./htpasswd

uplinks:
  npmjs:
    url: https://registry.npmjs.org/

packages:
  '@*/*':
    access: $all
    publish: $authenticated
    unpublish: $authenticated
    proxy: npmjs

  '**':
    access: $all

    publish: $authenticated
    unpublish: $authenticated

    proxy: npmjs

server:
  keepAliveTimeout: 60

middlewares:
  audit:
    enabled: true

logs: { type: stdout, format: pretty, level: http }

experiments:
  token: true

Environment information

Environment Info:
  System:
    OS: Linux 5.10 Alpine Linux
    CPU: (10) x64 Common KVM processor
  Binaries:
    npm: 9.3.1 - /usr/local/bin/npm
  npmGlobalPackages:
    verdaccio: 5.22.0

Debugging output

  verdaccio:config:parse parse config file /verdaccio/conf/config.yaml +0ms
  verdaccio:config:parse parsing config file: '/verdaccio/conf/config.yaml' +3ms
cannot open config file /verdaccio/conf/config.yaml: false

Contribute to Verdaccio

  • I'm willing to fix this bug 🥇
@juanpicado
Copy link
Member

I was on it yesterday, thanks 🙏 for confirm it. I am working on this the next days.

@juanpicado juanpicado self-assigned this Mar 7, 2023
@juanpicado juanpicado linked a pull request Mar 7, 2023 that will close this issue
juanpicado added a commit that referenced this issue Mar 7, 2023
* fix: #3666 experiments config fail on startup

* Update experiments.yaml

* Update init.ts

* add tests

* Update bootstrap.ts

* update deps

* update deps
@juanpicado
Copy link
Member

fixed v5.22.1

@justusbunsi
Copy link
Author

Wow. That was fast. Thank you 🙏.

I looked at the changes and stumbled across the change logs -> log. Isn't this something to be mentioned the release notes and in docs (https://verdaccio.org/docs/logger/)? Or will logs still work?

@juanpicado
Copy link
Member

juanpicado commented Mar 8, 2023

Yes fair enough, it will work let me add that, you will have a fancy warning but all works backwards compatible.

The mistake I did is because I am slowly migrating to v6 (without you realize 😉) internals and the version tha broke uses the new configuration parser which in v6 is log instead logs (this had to happen on 5.21.0) but I didn't realise, but I added by default log for the new installations and the old ones will see a warning ⚠️ but still works anyway, thus they start migrating smoothly before even the release, so v6 will have very small breaking changes. That's my strategy.

@verdacciobot verdacciobot added this to the 5.x milestone Mar 8, 2023
@justusbunsi
Copy link
Author

Yes fair enough, it will work let me add that, you will have a fancy warning but all works backwards compatible.

I see. Thanks for the explanation. Can confirm it's backwards compatible. Tested it right now. 👍

The mistake I did is because I am slowly migrating to v6 (without you realize 😉) internals and the version tha broke uses the new configuration parser which in v6 is log instead logs (this had to happen on 5.21.0) but I didn't realise, but I added by default log for the new installations and the old ones will see a warning ⚠️ but still works anyway, thus they start migrating smoothly before even the release, so v6 will have very small breaking changes. That's my strategy.

That's a neat strategy to keep the breakings as minimal as possible.

Thanks again for the very fast fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants