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.

500 Internal Server Error - unknown error on only some packages

See original GitHub issue

Describe the bug I get the 500 Internal Server Error - GET http://<my_registry>:4873/husky - unknown error on multiple packages like husky or jest. Other packages just work fine …

When i open the URL, verdaccio shows:

{
  "error": "unknown error"
}

When i run npm-check-updates (on the client) the following error is shown:

{
  headers: [Object: null prototype] {
    'x-powered-by': [ 'verdaccio/4.6.2' ],
    'access-control-allow-origin': [ '*' ],
    'content-type': [ 'application/json; charset=utf-8' ],
    'content-length': [ '31' ],
    vary: [ 'Accept-Encoding' ],
    date: [ 'Mon, 18 May 2020 10:33:41 GMT' ],
    connection: [ 'keep-alive' ],
    'x-fetch-attempts': [ '1' ]
  },
  statusCode: 500,
  code: 'E500',
  method: 'GET',
  uri: 'http://<my_registry>:4873/husky',
  body: { error: 'unknown error' },
  pkgid: 'husky@latest',
  message: '500 Internal Server Error - GET http://<my_registry>:4873/husky - unknown error'
}

To Reproduce I don’t really know - i have a pretty default Verdaccio installation and the error hasn’t occured when i installed it. I occurs when i try to update e.g. husky or jest some other packages seem to work just fine.

Expected behavior Don’t show the unknown error and just get the current data from the npm registry.

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

Pretty standard / default:

# path to a directory with all packages
storage: /<my_nas>/srv/npm
# path to a directory with plugins to include
plugins: ./plugins

web:
  enable: true
  title: Verdaccio
  # comment out to disable gravatar support
  # gravatar: false
  # by default packages are ordercer ascendant (asc|desc)
  # sort_packages: asc

auth:
  htpasswd:
    file: ./htpasswd
    # Maximum amount of users allowed to register, defaults to "+inf".
    # You can set this to -1 to disable registration.
    # max_users: 1000

security:
  api:
    jwt:
      sign:
        expiresIn: 60d
        notBefore: 1
  web:
    sign:
      expiresIn: 7d
      notBefore: 1

# a list of other known repositories we can talk to
uplinks:
  npmjs:
    url: https://registry.npmjs.org/

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

  '**':
    # allow all users (including non-authenticated users) to read and
    # publish all packages
    #
    # you can specify usernames/groupnames (depending on your auth plugin)
    # and three keywords: "$all", "$anonymous", "$authenticated"
    access: $all

    # allow all known users to publish/publish packages
    # (anyone can register by default, remember?)
    publish: $authenticated
    unpublish: $authenticated

    # if package is not available locally, proxy requests to 'npmjs' registry
    proxy: npmjs

# You can specify HTTP/1.1 server keep alive timeout in seconds for incomming connections.
# A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout.
# WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enought.
server:
  keepAliveTimeout: 60

middlewares:
  audit:
    enabled: true

# log settings
logs:
  - { type: stdout, format: pretty, level: http }
  #- {type: file, path: verdaccio.log, level: info}

listen: 0.0.0.0:4873

Environment information

System: OS: Linux 3.4 Debian GNU/Linux 10 (buster) 10 (buster) CPU: (4) arm ARMv7 Processor rev 5 (v7l) Binaries: Node: 13.14.0 - /usr/bin/node npm: 6.14.5 - /usr/bin/npm npmGlobalPackages: verdaccio: 4.6.2

Debugging output

  • $ NODE_DEBUG=request verdaccio prints:
 error-=- error reading  package.json: Unexpected token : in JSON at position 216935
 http <-- 500, user: cmiksche(<my_client>), req: 'GET /husky', error: unknown error
 http <-- 500, user: cmiksche(<my_client>), req: 'GET /husky', error: unknown error
 error-=- error reading  package.json: Unexpected token          in JSON at position 57852
 http <-- 500, user: cmiksche(<my_client>), req: 'GET /jest', error: unknown error
 http <-- 500, user: cmiksche(<my_client>), req: 'GET /jest', error: unknown error

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
yanzhangshuaicommented, Dec 20, 2021

Sorry the bot 🤖 got crazy this morning.

I have a similar error. Please help me

image

I use nginx as a proxy image

Installing using docker

image

config.yaml as follows image

The problem was solved, It’s a linux authorization problem

2reactions
juanpicadocommented, May 18, 2020

Seems your cache is corrupted, i would remove the packages are throwing error and try again

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix a 500 Internal Server Error on Your WordPress Site
The 500 Internal Server Error status code occurs when the server encounters an error that prevents it from fulfilling the request.
Read more >
What is a 500 Internal Server Error? - Allconnect.com
The 500 Internal Server Error is simply a general indication that something's wrong on the server side. Several things could cause this, but ......
Read more >
What Is a 500 Internal Server Error, and How Do I Fix It?
A 500 Internal Server error means that the website you were trying to connect to has experienced a problem and can't provide a...
Read more >
HTTP: 500 Internal Server Error Unknown error. - SugarClub
Your best bet here is to check what are the errors logged into your apache error log when these errors occur, and then...
Read more >
What Is a "500 Internal Server Error" and How Do I Fix It?
The first thing you need to know about an "Internal Server Error" is that the error can only be resolved by fixes to...
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