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: (Unauthorized) not authorized on admin to execute command #21

Open
CeoFred opened this issue Aug 22, 2022 · 0 comments

Comments

@CeoFred
Copy link

CeoFred commented Aug 22, 2022

Describe the bug
The application throws a rejection which i believe has to do with the sessions package trying to make updates to mongodb on start. Full error log below


[WARN] UnhandledPromiseRejectionWarning: MongoError: (Unauthorized) not authorized on admin to execute command { insert: "system.indexes", documents: [[{ns admin.sessions} {key [{expires 1}]} {name expires_1} {expireAfterSeconds 0} {unique false}]], ordered: true }
    at Function.MongoError.create (/Users/user/Documents/projects/express-typescript/node_modules/mongodb-core/lib/error.js:31:11)
    at /Users/user/Documents/projects/express-typescript/node_modules/mongodb-core/lib/connection/pool.js:497:72
    at authenticateStragglers (/Users/user/Documents/projects/express-typescript/node_modules/mongodb-core/lib/connection/pool.js:443:16)
    at Connection.messageHandler (/Users/user/Documents/projects/express-typescript/node_modules/mongodb-core/lib/connection/pool.js:477:5)
    at TLSSocket.<anonymous> (/Users/user/Documents/projects/express-typescript/node_modules/mongodb-core/lib/connection/connection.js:333:22)
    at TLSSocket.emit (events.js:400:28)
    at addChunk (internal/streams/readable.js:293:12)
    at readableAddChunk (internal/streams/readable.js:267:9)
    at TLSSocket.Readable.push (internal/streams/readable.js:206:10)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)
    at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
    at processPromiseRejections (internal/process/promises.js:247:11)
    at processTicksAndRejections (internal/process/task_queues.js:96:32)

To Reproduce
Steps to reproduce the behavior:

  1. run yarn dev or npm run dev

Expected behavior
App Should start

Screenshots
N/A

Desktop (please complete the following information):

  • OS: iOS 12.5

Smartphone (please complete the following information):
N/A

Additional context
Cannot use this template with session

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

1 participant