Modifying the MONGO_CONNECTION_URI
to an invalid connection URI, restarts the connector container but doesn't use the new value #10368
Open
Description
Component
What is the current behaviour?
I have a mongo connector with the following configuration:
OTEL_SERVICE_NAME=my_subgraph_my_mongo
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://local.hasura.dev:4317
MONGODB_DATABASE_URI=mongodb://local.hasura.dev:27017/bug_bounty
Everything works fine with the above config, but when I change MONGODB_DATABASE_URI
to something obviously wrong like
mongodb11://local.hasura.dev:27017/bug_bounty
and save the file.
I see the following logs in the docker compose watch
logs
⦿ Syncing "my_subgraph_my_mongo" after changes were detected
[+] Restarting 1/1
✔ Container bug-bounty-my_subgraph_my_mongo-1 Started 0.4s
my_subgraph_my_mongo-1 exited with code 0
my_subgraph_my_mongo-1 | Starting server on 0.0.0.0:808
Which is expected.
But, I am still able to run queries on the database and I am able to get results from the DB. My guess is that the connector is still using the previous connection string (the valid and correct one) and it doesn't reflect the current state of the env vars.
But interestingly, if I do
docker compose up my_subgraph_my_mongo -d
Then things work correctly, as expected.
What is the expected behaviour?
An error should be thrown saying that the connection URI is invalid.
How to reproduce the issue?
- Provide a valid
MONGODB_CONNECTION_URI
- Run some queries and check if you are getting data from it.
- Mess up the value of the
MONGODB_CONNECTION_URI
- You will still see that you can still get data from the queries you ran in step 2.