Skip to content

UncaughtPromiseRejectionWarning: Error: token (private-token) or oauth_token is mandatory on startup #89

@jojoxd

Description

@jojoxd

Hi, when starting the service, I get the following error;

Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: warn --- config file  - /opt/npm-repo/config.yaml
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: (node:14116) UnhandledPromiseRejectionWarning: Error: `token` (private-token) or `oauth_token` is mandatory
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at new BaseModel (/opt/verdaccio/node_modules/gitlab/dist/latest/infrastructure/BaseService.js:33:13)
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at new Groups (/opt/verdaccio/node_modules/gitlab/dist/latest/services/Groups.js:10:1)
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at /opt/verdaccio/node_modules/gitlab/dist/latest/infrastructure/Bundler.js:13:22
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at Array.forEach (<anonymous>)
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at new Bundle (/opt/verdaccio/node_modules/gitlab/dist/latest/infrastructure/Bundler.js:12:32)
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at /opt/verdaccio/node_modules/verdaccio/build/lib/plugin-loader.js:114:30
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at Array.map (<anonymous>)
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at loadPlugin (/opt/verdaccio/node_modules/verdaccio/build/lib/plugin-loader.js:65:37)
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at Auth._loadPlugin (/opt/verdaccio/node_modules/verdaccio/build/lib/auth.js:45:39)
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at new Auth (/opt/verdaccio/node_modules/verdaccio/build/lib/auth.js:35:25)
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at defineAPI (/opt/verdaccio/node_modules/verdaccio/build/api/index.js:60:16)
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at /opt/verdaccio/node_modules/verdaccio/build/api/index.js:146:12
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at Generator.next (<anonymous>)
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at step (/opt/verdaccio/node_modules/verdaccio/build/api/index.js:53:191)
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at /opt/verdaccio/node_modules/verdaccio/build/api/index.js:53:361
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: at processTicksAndRejections (internal/process/task_queues.js:85:5)
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: (node:14116) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
Aug 13 01:18:27 web.jojoxd.nl verdaccio[14116]: (node:14116) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Node Version: v12.8.0
Yarn Version: 1.17.3
OS: CentOS 7

I am trying to run the service as a systemd service, and have tried running it as the user itself.

these are my configurations:

storage: /opt/npm-repo/storage

listen:
  - /run/verdaccio/verdaccio.sock

auth:
  gitlab:
    url: https://gitlab.jojoxd.nl
    authCache:
      enabled: true
      ttl: 300
    publish: $maintainer

packages:
  '@jojoxd/*':
    access: $all
    publish: $authenticated
    gitlab: true

logs:
  - {type: stdout, format: pretty, level: debug}
[Unit]
Description=Verdaccio Service (Private NPM Registry)

Wants=network-online.target
After=network-online.target
After=nginx.service

[Service]
Type=simple
User=www-data
Group=www-data
WorkingDirectory=/opt/verdaccio
RuntimeDirectory=verdaccio

PermissionsStartOnly=true

ExecStart=/opt/verdaccio/bin/verdaccio -c /opt/npm-repo/config.yaml

[Install]
WantedBy=multi-user.target

I have run the yarn install job manually, and am running on the v2.2.0 tag. (master does the same).

The /run/verdaccio/verdaccio.sock is an upstream for nginx, which I have been using successfully with normal verdaccio for a long time.

Am I forgetting a configuration option or is this an actual bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions