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

fix(cli-repl): throw error when changing telemetry setting while forceDisableTelemetry: true MONGOSH-1762 #1955

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

addaleax
Copy link
Contributor

No description provided.

@addaleax addaleax merged commit 2306b9c into main Apr 22, 2024
55 of 59 checks passed
@addaleax addaleax deleted the 1762-dev branch April 22, 2024 10:03
@Ghostbird
Copy link

Ghostbird commented Apr 29, 2024

Ah, so this is why our docker containers were failing. This was the startup command of our docker container.

bash -mc "mongod --replSet rs0 & sleep 3; mongosh --eval 'disableTelemetry(); rs.initiate()'; fg

This used to work fine, but now crashed, and the replica set was never initialised. The weird thing is that apparently forceDisableTelemetry is set to true, but I have no clue why it's set to true.

It doesn't seem to be done by the docker image, nor by this repo.

I think this should have only thrown when trying to change the telemetry setting. It shouldn't throw when disabling it.

UPDATE:

Found it! It's getter logic that forces telemetry to be disabled for containerised non-interactive usage specifically.

(this.isContainerizedEnvironment && !this.mongoshRepl.isInteractive)

Would be nice if this were documented. There it says that telemetry is automatically enabled. Apparently that's not always true.

Also it would be nice that this new feature is documented there. Currently there's no mention that enableTelemetry() and disableTelemetry() may throw.

@addaleax
Copy link
Contributor Author

@Ghostbird You are completely right – thanks for bringing this up! #1966

@addaleax
Copy link
Contributor Author

@Ghostbird And sorry for the delay, but just to present you with an update, we just released mongosh 2.2.6 with the fix – thanks again for bringing this up!

@Ghostbird
Copy link

Thanks for the fix!

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

Successfully merging this pull request may close these issues.

3 participants