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.

Unable to load verdaccio-aws-s3-storage plugin on 6-next

See original GitHub issue

Your Environment

  • verdaccio version: 6.0.0-6-next.48 (docker:nightly-master)
  • node version [12.x.x, 14.x.x]: 16? (docker:nightly-master)
  • package manager: [npm@7, pnpm@6, yarn@2] (docker:nightly-master)
  • os: [mac, windows@10, linux] [mac, linux] (docker:nightly-master)
  • platform: [npm, docker, helm, other] docker

Describe the bug

Plugin fails to load using either 6-next of latest version of the plugin, using the example docker installation for plugin, works on 5 but is failing on nightly-master

To Reproduce

FROM node:lts-alpine as a builder

WORKDIR /verdaccio/plugins

RUN npm install --global-style --no-bin-links --omit=optional verdaccio-aws-s3-storage@6-next

# Have tried using latest ^ as well

# Final build image
FROM verdaccio/verdaccio:nightly-master

ADD config.yaml /verdaccio/conf/config.yaml

ADD htpasswd /verdaccio/htpasswd

COPY --chown=$VERDACCIO_USER_UID:root --from=builder \
  /verdaccio/plugins/node_modules/verdaccio-aws-s3-storage \
  /verdaccio/plugins/verdaccio-aws-s3-storage

Expected behavior

plugin loading as expected

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

storage: /verdaccio/storage/data

plugins: /verdaccio/plugins

web:
  enable: true
  title: Verdaccio
  darkMode: true

auth:
  htpasswd:
    file: /verdaccio/htpasswd
    algorithm: bcrypt

store:
  aws-s3-storage:
    bucket: S3_BUCKET

uplinks:
  npmjs:
    url: https://registry.npmjs.org/
    cache: true
    maxage: 30m
  nexus:
    url: REDACTED
    cache: true
    maxage: 30m

packages:
  '@*/*':
    access: $all
    proxy: nexus npmjs
  '**':
    access: $all
    proxy: nexus npmjs

server:
  keepAliveTimeout: 60

middlewares:
  audit:
    enabled: true

log: { type: stdout, format: pretty, level: debug }


Environment information

Debugging output

➜  verdaccio-docker git:(try-6) ✗ pnpm build

> @cvent/verdaccio-docker@0.1.8 build /Users/nhay/code/verdaccio/packages/verdaccio-docker
> run-s build:*


> @cvent/verdaccio-docker@0.1.8 build:docker /Users/nhay/code/verdaccio/packages/verdaccio-docker
> docker-cvent build

[+] Building 5.6s (13/13) FINISHED
 => [internal] load build definition from Dockerfile                                                                                             0.0s
 => => transferring dockerfile: 502B                                                                                                             0.0s
 => [internal] load .dockerignore                                                                                                                0.0s
 => => transferring context: 2B                                                                                                                  0.0s
 => [internal] load metadata for docker.io/verdaccio/verdaccio:nightly-master                                                                    4.7s
 => [internal] load metadata for docker.io/library/node:lts-alpine                                                                               4.8s
 => [internal] load build context                                                                                                                0.0s
 => => transferring context: 5.32kB                                                                                                              0.0s
 => [builder 1/3] FROM docker.io/library/node:lts-alpine@sha256:88d9d8da697877a4a771a40e5cbc10a12c2ad959e82f3b0f36ef35635e17f693                 0.0s
 => CACHED [stage-1 1/4] FROM docker.io/verdaccio/verdaccio:nightly-master@sha256:8ea65206deb9b88c3c992b0e5b4486db7b3e3631c41512c65e78dc101fa56  0.0s
 => CACHED [builder 2/3] WORKDIR /verdaccio/plugins                                                                                              0.0s
 => CACHED [builder 3/3] RUN npm install --global-style --no-bin-links --omit=optional verdaccio-aws-s3-storage@6-next                           0.0s
 => [stage-1 2/4] ADD config.yaml /verdaccio/conf/config.yaml                                                                                    0.0s
 => [stage-1 3/4] ADD htpasswd /verdaccio/htpasswd                                                                                               0.0s
 => [stage-1 4/4] COPY --chown=10001:root --from=builder   /verdaccio/plugins/node_modules/verdaccio-aws-s3-storage   /verdaccio/plugins/verdac  0.3s
 => exporting to image                                                                                                                           0.4s
 => => exporting layers                                                                                                                          0.4s
 => => writing image sha256:8c024a23004dd18525b37606e42861cefb3189f1f702a4be570313b5ab7303ba                                                     0.0s
 => => naming to docker.io/library/verdaccio-docker                                                                                              0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
➜  verdaccio-docker git:(try-6) ✗ docker run -it verdaccio-docker
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
 debug--- plugins folder defined, loading plugins from /verdaccio/plugins
 warn --- Cannot read properties of undefined (reading 'aws-s3-storage') on loading plugins at /verdaccio/plugins for aws-s3-storage
 error--- package not found, try to install verdaccio-aws-s3-storage with a package manager
 info -=- local storage path /verdaccio/storage/data/.verdaccio-db.json
 warn -=- no private database found, recreating new one on /verdaccio/storage/data/.verdaccio-db.json
 debug--- plugins folder defined, loading plugins from /verdaccio/plugins
 info --- using htpasswd file: /verdaccio/conf/verdaccio/htpasswd
 debug--- plugins folder defined, loading plugins from /verdaccio/plugins
 info --- http address http://0.0.0.0:4873/
 info --- version: 6.0.0-6-next.48
 info --- server started
^C info --- received shutdown signal - closing server gracefully...
 info --- server closed.

Contribute to Verdaccio

  • I’m willing to fix this bug 🥇

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
noahjohnhaycommented, Oct 6, 2022

Thank you so much for the quick reply! I suspected that to be the case but wanted to share just in case and see if I may be able to help. I was just playing around with 6 as it has some great new features we’re looking for, but absolutely understand its actively being worked on and is volatile. Thank you again for all your hard work on this project!

0reactions
juanpicadocommented, Oct 10, 2022
verdaccio:plugin:loader:async plugin aws-s3-storage +0ms
verdaccio:plugin:loader:async plugin path /verdaccio/plugins +0ms
verdaccio:plugin:loader:utils loading plugin /verdaccio/plugins/verdaccio-aws-s3-storage +0ms
verdaccio:plugin:loader:async plugin is ES6 +1s
verdaccio:plugin:loader:async is scoped plugin false +5ms
verdaccio:plugin:loader:async plugin pkg name verdaccio-aws-s3-storage +1ms
verdaccio:plugin:loader:utils loading plugin verdaccio-aws-s3-storage +980ms
verdaccio:plugin:loader:utils plugin verdaccio-aws-s3-storage not found +2ms
verdaccio:plugin:loader:async plugin found 0 +3ms

this snippet looks to be https://github.com/verdaccio/verdaccio/pull/3370/files#diff-3163017865a47f9bfea6e6e6e4a6cbfbff4a9b0afea35c1365614bd48f7f168aR71-R120

where it’s trying to load the plugin twice, once by its full path and then again just by name?

I updated the Dockerfile to also copy it in the default node_modules directory

FROM node:lts-alpine as builder

WORKDIR /verdaccio/plugins

RUN npm install --global-style --no-bin-links --omit=optional verdaccio-aws-s3-storage@6-next

# Final build image
FROM verdaccio/verdaccio:nightly-master

ADD config.yaml /verdaccio/conf/config.yaml

ADD htpasswd /verdaccio/htpasswd

COPY --chown=$VERDACCIO_USER_UID:root --from=builder \
  /verdaccio/plugins/node_modules/verdaccio-aws-s3-storage \
  /verdaccio/plugins/verdaccio-aws-s3-storage

COPY --chown=$VERDACCIO_USER_UID:root --from=builder \
  /verdaccio/plugins/node_modules/verdaccio-aws-s3-storage \
  /opt/verdaccio/node_modules/verdaccio-aws-s3-storage

This seems to get past the second tryLoad call but now I’m hitting a new exception

➜  verdaccio-docker git:(try-6) ✗ docker run --env "DEBUG=verdaccio*" -it verdaccio-docker
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
  verdaccio:config:parse parse config file /verdaccio/conf/config.yaml +0ms
  verdaccio:config:parse parsing config file: '/verdaccio/conf/config.yaml' +7ms
  verdaccio:logger logging stdout enabled +0ms
  verdaccio:logger setup logger +4ms
  verdaccio:logger has prettifier? true +0ms
  verdaccio:server start server +0ms
  verdaccio:config config path: /verdaccio/conf/config.yaml +0ms
  verdaccio:server loaded filter plugin +14ms
  verdaccio:logger trace (10) was changed to trace (10) +49ms
  verdaccio:logger trace (10) was changed to trace (10) +8ms
  verdaccio:logger trace (10) was changed to trace (10) +6ms
  verdaccio:storage uplinks available [ 'npmjs', 'nexus' ] +0ms
  verdaccio:server storage init start +31ms
  verdaccio:storage:local local storage created +0ms
  verdaccio:logger trace (10) was changed to trace (10) +17ms
  verdaccio:plugin:loader:async plugin aws-s3-storage +0ms
  verdaccio:plugin:loader:async plugin path /verdaccio/plugins +1ms
  verdaccio:plugin:loader:utils loading plugin /verdaccio/plugins/verdaccio-aws-s3-storage +0ms
  verdaccio:plugin:loader:async plugin is ES6 +968ms
  verdaccio:plugin:loader:async is scoped plugin false +5ms
  verdaccio:plugin:loader:async plugin pkg name verdaccio-aws-s3-storage +0ms
  verdaccio:plugin:loader:utils loading plugin verdaccio-aws-s3-storage +944ms
  verdaccio:plugin:loader:async plugin is ES6 +995ms
uncaught exception, please report (https://github.com/verdaccio/verdaccio/issues) this:
Error: TypeError: Cannot read properties of undefined (reading 'aws-s3-storage')
    at startServer (/opt/verdaccio/packages/server/express/build/server.js:154:11)
    at async /opt/verdaccio/packages/node-api/build/server.js:155:13
 debug--- plugins folder defined, loading plugins from /verdaccio/plugins
 warn --- Cannot read properties of undefined (reading 'aws-s3-storage') on loading plugins at /verdaccio/plugins for aws-s3-storage
 error--- storage has failed: undefined

Here is an example of how the API would look like

https://verdaccio.org/docs/next/api/core/interfaces/pluginUtils.IPackageStorage#savepackage

Eventually, this would be linked to a guide to upgrading plugins, etc, just a small start to expose internals easily. Feedback is welcome.

Read more comments on GitHub >

github_iconTop Results From Across the Web

aws-s3-storage hangs verdaccio on load · Issue #1982 - GitHub
When aws-s3-storage is installed verdaccio doesn't load and it's stuck after Plugin successfully loaded: verdaccio-aws-s3-storage.
Read more >
verdaccio-aws-s3-storage - npm
AWS S3 storage implementation for Verdaccio. Latest version: 10.3.0, last published: 6 months ago. Start using verdaccio-aws-s3-storage in ...
Read more >
Amazon Web Services - Verdaccio
This document describes several approaches for deploying Verdaccio in the AWS cloud.
Read more >
Verdaccio-aws-s3-storage - npm.io
This plugin was forked based on verdaccio-s3-storage built in Typescript + other features added along the time. Both plugins might have vary in...
Read more >
verdaccio | Yarn - Package Manager
Fast, reliable, and secure dependency management.
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