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

[BUG] CosmoDB authentication failed despite connection string being correct #558

Open
mmaeffert opened this issue Dec 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mmaeffert
Copy link

Describe the bug
I am trying to connect the submodel repository to an external Cosmos Mongo DB in azure. Although the connection is successfull, it is throwing an authentication error:

com.mongodb.MongoCommandException: Command failed with error 18 (AuthenticationFailed): 'Invalid key' on server xx.global.mongocluster.cosmos.azure.com:10260. The full response is {"ok": 0.0, "errmsg": "Invalid key", "code": 18, "codeName": "AuthenticationFailed"}

To Reproduce
I try at least two configurations in application.properties:

basyx.backend = MongoDB
spring.data.mongodb.host=xy.global.mongocluster.cosmos.azure.com
spring.data.mongodb.port=10260
spring.data.mongodb.database=aas
spring.data.mongodb.authentication-database=admin
spring.data.mongodb.username=xy
spring.data.mongodb.password=xy

and

basyx.backend = MongoDB
sping.data.mongodb.uri = mongodb+srv://xx:[email protected]/?tls=true&authMechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000
spring.data.mongodb.database=aas
spring.data.mongodb.authentication-database=admin

Both produce the exact same error.

BaSyx (please complete the following information):

  • BaSyx submodel repository 2.0.0-SNAPSHOT
  • BaSyx SDK Java

Additional context
I tried the connection string with other tools and it worked every single time, affirming that the credentials used are actually correct.

@mmaeffert mmaeffert added the bug Something isn't working label Dec 5, 2024
@github-project-automation github-project-automation bot moved this to To triage in Support Requests Dec 5, 2024
@aaronzi
Copy link
Member

aaronzi commented Dec 11, 2024

Hello @mmaeffert,

we will investigate what the cause of this could be.

It would be greatly appreciated if you could help us reproduce this. If possible, could you provide a docker-compose setup that you can share as a zip with us were we can directly see this issue happening? Testing against an external Azure is not an option for us.

@aaronzi aaronzi moved this from To triage to Backlog in Support Requests Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants