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

UnhandledPromiseRejectionWarning: MongoError: w has to be a non-negative number and not greater than 50 #120

Closed
danieldid opened this issue Feb 9, 2021 · 2 comments

Comments

@danieldid
Copy link

After git cloning / npm i / mongodb installation under Ubuntu 18.04 LTS and changing the webservice -> port in config.js to anything else than 3000, e. g. 5001 leads to following error:

root@didd-dev:/var/www/http/pa11y-dashboard# node index.js 

Pa11y Dashboard started
mode: undefined
uri:  http://:::5000
Server running at: http://0.0.0.0:5001

Pa11y Webservice started
mode:     undefined
uri:      http://0.0.0.0:5001
database: mongodb://localhost/pa11y-webservice
cron:     0 30 0 * * *
(node:23502) UnhandledPromiseRejectionWarning: MongoError: w has to be a non-negative number and not greater than 50
    at Function.MongoError.create (/var/www/http/pa11y-dashboard/node_modules/mongodb-core/lib/error.js:31:11)
    at /var/www/http/pa11y-dashboard/node_modules/mongodb-core/lib/connection/pool.js:497:72
    at authenticateStragglers (/var/www/http/pa11y-dashboard/node_modules/mongodb-core/lib/connection/pool.js:443:16)
    at Connection.messageHandler (/var/www/http/pa11y-dashboard/node_modules/mongodb-core/lib/connection/pool.js:477:5)
    at Socket.<anonymous> (/var/www/http/pa11y-dashboard/node_modules/mongodb-core/lib/connection/connection.js:333:22)
    at Socket.emit (events.js:314:20)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:272:9)
    at Socket.Readable.push (_stream_readable.js:213:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
(node:23502) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:23502) [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:23502) UnhandledPromiseRejectionWarning: MongoError: w has to be a non-negative number and not greater than 50
    at Function.MongoError.create (/var/www/http/pa11y-dashboard/node_modules/mongodb-core/lib/error.js:31:11)
    at /var/www/http/pa11y-dashboard/node_modules/mongodb-core/lib/connection/pool.js:497:72
    at authenticateStragglers (/var/www/http/pa11y-dashboard/node_modules/mongodb-core/lib/connection/pool.js:443:16)
    at Connection.messageHandler (/var/www/http/pa11y-dashboard/node_modules/mongodb-core/lib/connection/pool.js:477:5)
    at Socket.<anonymous> (/var/www/http/pa11y-dashboard/node_modules/mongodb-core/lib/connection/connection.js:333:22)
    at Socket.emit (events.js:314:20)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:272:9)
    at Socket.Readable.push (_stream_readable.js:213:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
(node:23502) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

When leaving it at 3000 I get the following error:

root@didd-dev:/var/www/http/pa11y-dashboard# node index.js 

Pa11y Dashboard started
mode: undefined
uri:  http://:::5000
Server running at: http://0.0.0.0:3000
Error: listen EADDRINUSE: address already in use 0.0.0.0:3000
    at Server.setupListenHandle [as _listen2] (net.js:1316:16)
    at listenInCluster (net.js:1364:12)
    at doListen (net.js:1501:7)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)

When checking for other applications running on port 3000 I get nothing in return:

root@didd-dev:/var/www/http/pa11y-dashboard# ps aux | grep 3000
root     23619  0.0  0.0  13136  1028 pts/0    S+   09:19   0:00 grep --color=auto 3000
@josebolos
Copy link
Member

Hi @danieldid,

Thanks for creating this issue. Would you be able to share the exact config file that you used?

@danieldid
Copy link
Author

Hi @josebolos,

excuse me for any inconvenience, I missed the right tab in the browser!
I'm facing the same problems as here pa11y/pa11y-dashboard#271

So I shall close this issue as it's related to pa11y-dashboard not pa11y-webservice

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

No branches or pull requests

2 participants