-
-
Notifications
You must be signed in to change notification settings - Fork 293
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
unauthorized error when mongodb has auth #174
Comments
Looking at the error message, it seems like the credentials are not sufficient for index creation. Please try connecting to mongo using the same credentials and create an index. db.collection.ensureIndex({ text: 'text' }) https://docs.mongodb.com/manual/reference/method/db.collection.ensureIndex/ Please let me know what are you getting. |
thank you for your reply.
thank you |
Well, the example I provided was a generic example. You need to make sure
You can infer all the details from the error message |
Hi Andrew, I am still not able to get it working.
mongo_1 | 2020-10-14T20:11:44.585+0000 I NETWORK [listener] connection accepted from ip:52422 #2 (2 connections now open) when I tried to use account to ensureIndex this time I got this error: Thank you |
@zx86496790 Looking at the error It's kind of out of scope for the project - there're plenty resource available for troubleshooting mongo auth problems. Sorry I know that it doesn't really help. I'll leave this issue open for a week-two may be some one will be able to help you |
Hey zx86496790, IIf you are using the services:
mongo:
image: mongo:4.0
director:
image: agoldis/sorry-cypress-director:latest
# ... rest of the file |
Hi @agoldis @dlavrenuek thank you for your reply. after I updated to the latest version of sorry-cypress, I kept getting failed to fetch error on dashboard. can you please let me know where to find the error log? thank you |
@zx86496790 For the dashboard - it just runs in your browser, open the dev panel and you'll see error details. For the api service - it depends on what environment is running the service |
Hi Andrew, thank you for your reply. I got this error on localhost:4000 Failed to load resource: net::ERR_CONNECTION_REFUSED thank you |
Summary
since the default sorry-cypress mongodb does not have username and password, it has been hacked twice within 2 weeks.
so I setup another server
but I got following errors:
`mongo_1 | 2020-10-14T04:48:33.229+0000 I NETWORK [conn1] received client metadata from conn1: { driver: { name: "nodejs", version: "3.6.2" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "5.4.0-42-generic" }, platform: "'Node.js v12.19.0, LE (legacy)" }
mongo_1 | 2020-10-14T04:48:33.296+0000 I ACCESS [conn1] Successfully authenticated as principal xxx on admin from client
mongo_1 | 2020-10-14T04:48:34.223+0000 I ACCESS [conn1] Unauthorized: not authorized on sorry-cypress to execute command { createIndexes: "runs", indexes: [ { name: "runId_1", key: { runId: 1 }, unique: true } ], lsid: { id: UUID("e48fef7d-929e-4805-aad9-9462b62f9a53") }, $db: "sorry-cypress" }
mongo_1 | 2020-10-14T04:48:34.240+0000 I NETWORK [listener] connection accepted from #2 (2 connections now open)
mongo_1 | 2020-10-14T04:48:34.315+0000 I NETWORK [conn2] received client metadata from conn2: { driver: { name: "nodejs", version: "3.6.2" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "5.4.0-42-generic" }, platform: "'Node.js v12.19.0, LE (legacy)" }
mongo_1 | 2020-10-14T04:48:34.363+0000 I ACCESS [conn2] Successfully authenticated as principal xxx on admin from client
mongo_1 | 2020-10-14T04:48:34.365+0000 I ACCESS [conn1] Unauthorized: not authorized on sorry-cypress to execute command { createIndexes: "instances", indexes: [ { name: "instanceId_1", key: { instanceId: 1 }, unique: true } ], lsid: { id: UUID("616afe95-d4e7-4cdb-b6aa-e52e31560f88") }, $db: "sorry-cypress" }
mongo_1 | 2020-10-14T04:48:34.368+0000 I ACCESS [conn2] Unauthorized: not authorized on sorry-cypress to execute command { createIndexes: "projects", indexes: [ { name: "projectId_1", key: { projectId: 1 }, unique: true } ], lsid: { id: UUID("fdd8631d-e4f2-4e70-ba2e-00a4c45e503a") }, $db: "sorry-cypress" }
mongo_1 | 2020-10-14T04:49:28.329+0000 I NETWORK [conn2] end connection (1 connection now open)
mongo_1 | 2020-10-14T04:49:28.330+0000 I NETWORK [conn1] end connection (0 connections now open)`
How to reproduce
change docker-compose.full.yml file under services mongo command to mongod --auth
change mongodb_uri under director and api to URI with username and password.
add user to both admin and sorry-cypress tables with dbOwner role. the user added to both tables have exactly same username and password
Environment
Ubuntu and docker container with sorry-cypress
please help
The text was updated successfully, but these errors were encountered: