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

verdaccio-memory: TypeError: path must be a string or Buffer #3644

Open
fiesh opened this issue Feb 21, 2023 · 9 comments
Open

verdaccio-memory: TypeError: path must be a string or Buffer #3644

fiesh opened this issue Feb 21, 2023 · 9 comments

Comments

@fiesh
Copy link

fiesh commented Feb 21, 2023

Environment

  • verdaccio version: 6.0.0-6-next.61
  • node version: 18.14.1
  • package manager: npm@9.5.0
  • os: Ubuntu 22.04
  • platform: ?

Describe the bug

Using verdaccio-memory@11.0.0-6-next.28 and the following config:

plugins: /usr/lib/node_modules

uplinks:
  npmjs:
    url: https://registry.npmjs.org/
    maxage: 24h

auth:
  htpasswd:
    file: ./htpasswd

web:
  title: Verdaccio

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

  '**':
    access: $all
    publish: $authenticated
    unpublish: $authenticated
    proxy: npmjs

log:
  - { type: stdout, format: pretty, level: http }

store:
  memory:
    limit: 4096

listen:
  - "[::]:8080"

behind a reverse proxy Apache instance on another server that handles https. Most requests work fine, but for example getting https://verdaccio.domain.tld/yocto-queue/-/yocto-queue-0.1.0.tgz results in

Feb 21 14:48:31 verdacci-new verdaccio[223]: TypeError: path must be a string or Buffer
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at pathToFilename (/usr/lib/node_modules/verdaccio-memory/node_modules/memfs/lib/volume.js:295:19)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at class_1.FsReadStream (/usr/lib/node_modules/verdaccio-memory/node_modules/memfs/lib/volume.js:1939:17)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at new class_1 (/usr/lib/node_modules/verdaccio-memory/node_modules/memfs/lib/volume.js:477:31)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at Volume.createReadStream (/usr/lib/node_modules/verdaccio-memory/node_modules/memfs/lib/volume.js:1834:16)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at MemoryHandler.readTarball (/usr/lib/node_modules/verdaccio-memory/build/memory-handler.js:93:70)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at Storage.getLocalTarball (/usr/lib/node_modules/verdaccio/node_modules/@verdaccio/store/build/storage.js:624:26)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at Storage.getTarballNext (/usr/lib/node_modules/verdaccio/node_modules/@verdaccio/store/build/storage.js:369:36)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at /usr/lib/node_modules/verdaccio/node_modules/@verdaccio/api/build/package.js:58:36
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at Layer.handle [as handle_request] (/usr/lib/node_modules/verdaccio/node_modules/express/lib/router/layer.js:95:5)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at next (/usr/lib/node_modules/verdaccio/node_modules/express/lib/router/route.js:144:13)
Feb 21 14:48:31 verdacci-new verdaccio[223]: info <-- 2003:AAA requested 'GET /yocto-queue/-/yocto-queue-0.1.0.tgz'
Feb 21 14:48:31 verdacci-new verdaccio[223]: error--- unexpected error: path must be a string or Buffer
Feb 21 14:48:31 verdacci-new verdaccio[223]: TypeError: path must be a string or Buffer
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at pathToFilename (/usr/lib/node_modules/verdaccio-memory/node_modules/memfs/lib/volume.js:295:19)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at class_1.FsReadStream (/usr/lib/node_modules/verdaccio-memory/node_modules/memfs/lib/volume.js:1939:17)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at new class_1 (/usr/lib/node_modules/verdaccio-memory/node_modules/memfs/lib/volume.js:477:31)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at Volume.createReadStream (/usr/lib/node_modules/verdaccio-memory/node_modules/memfs/lib/volume.js:1834:16)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at MemoryHandler.readTarball (/usr/lib/node_modules/verdaccio-memory/build/memory-handler.js:93:70)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at Storage.getLocalTarball (/usr/lib/node_modules/verdaccio/node_modules/@verdaccio/store/build/storage.js:624:26)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at Storage.getTarballNext (/usr/lib/node_modules/verdaccio/node_modules/@verdaccio/store/build/storage.js:369:36)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at /usr/lib/node_modules/verdaccio/node_modules/@verdaccio/api/build/package.js:58:36
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at Layer.handle [as handle_request] (/usr/lib/node_modules/verdaccio/node_modules/express/lib/router/layer.js:95:5)
Feb 21 14:48:31 verdacci-new verdaccio[223]:     at next (/usr/lib/node_modules/verdaccio/node_modules/express/lib/router/route.js:144:13)
Feb 21 14:48:31 verdacci-new verdaccio[223]: http <-- 500, user: null(2003:BBB via 2003:AAA), req: 'GET /yocto-queue/-/yocto-queue-0.1.0.tgz', error: internal server error
Feb 21 14:48:31 verdacci-new verdaccio[223]: http <-- 500, user: null(2003:BBB via 2003:AAA), req: 'GET /yocto-queue/-/yocto-queue-0.1.0.tgz', error: internal server error

verdaccio --info output:

  System:
    OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
    CPU: (80) x64 Intel(R) Xeon(R) CPU E7- 4870  @ 2.40GHz
  Binaries:
    npm: 9.5.0 - /usr/bin/npm
  npmGlobalPackages:
    verdaccio: 6.0.0-6-next.61
@juanpicado
Copy link
Member

juanpicado commented Feb 21, 2023

Thanks, I already noticed yesterday 30a967a on this new E2E test. Are you testing the plugin?

@fiesh
Copy link
Author

fiesh commented Feb 22, 2023

Thanks, I already noticed yesterday 30a967a on this new E2E test. Are you testing the plugin?

I was hoping to give it a test as our CI pipeline's cache, but it seems I'll have to stick with verdaccio 5.

@juanpicado
Copy link
Member

Thanks, I already noticed yesterday 30a967a on this new E2E test. Are you testing the plugin?

I was hoping to give it a test as our CI pipeline's cache, but it seems I'll have to stick with verdaccio 5.

For now is recommended stay with v5, once I'm 100% sure nothing will get broken with v6 I'll promote it to latest, but still not there as you have noticed :) but thanks for giving a try helps with the polish

@juanpicado
Copy link
Member

juanpicado commented Feb 22, 2023

Just one more thing, V5 is getting a lot of updates even :) using https://github.com/verdaccio/verdaccio/blob/5.x/package.json#L22 plenty of v6 modules, even plugins (verdaccio-audit) so probably you will end up using v6 without realizing it 💯along the year.

@fiesh
Copy link
Author

fiesh commented Feb 23, 2023

Just one more thing, V5 is getting a lot of updates even :) using https://github.com/verdaccio/verdaccio/blob/5.x/package.json#L22 plenty of v6 modules, even plugins (verdaccio-audit) so probably you will end up using v6 without realizing it 100along the year.

I thought the memory based storage was a feature that didn't exist in v5, and that was something that really appealed to me since our instance is a pure cache. Will it also become possible with v5?

@juanpicado
Copy link
Member

Yes, indeed is possible https://github.com/verdaccio/monorepo/tree/9.x/plugins/memory

The version 10.x is for v5

npm install -g verdaccio-memory@10.3.0

@fiesh
Copy link
Author

fiesh commented Feb 23, 2023

Yes, indeed is possible https://github.com/verdaccio/monorepo/tree/9.x/plugins/memory

The version 10.x is for v5

npm install -g verdaccio-memory@10.3.0

Oh awesome, thank you!

@fiesh
Copy link
Author

fiesh commented Feb 23, 2023

Hmm I gave it a shot, but it leads to plenty of checksum errors -- resetting it to file system based storage resolved the issue. So I guess something's wonky with verdaccio-memory.

@juanpicado juanpicado modified the milestones: v6 release, Next major Aug 20, 2023
@sammcj
Copy link

sammcj commented Aug 24, 2023

FYI still occurring on 7.0.0-next.1

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

No branches or pull requests

3 participants