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

chore(data-service): disable utf8 validation when retrieving metadata compass needs in order to function COMPASS-8517 #6531

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Nov 26, 2024

See https://jira.mongodb.org/browse/SERVER-97683

This can make compass unusable because we use commands that will include the hostname. It is reasonably safe to just turn off utf8 validation in those cases. We still leave it on when reading/writing documents and therefore users aren't at risk of writing back broken data to their database.

},
])
],
{ enableUtf8Validation: false }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added this option which triggered the whole aggregation to be reformatted by prettier.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this one here because the user's error log file contained a lot of aggregate failed commands and we have a hunch it might be this one.

packages/data-service/src/run-command.ts Outdated Show resolved Hide resolved
packages/data-service/src/data-service.ts Outdated Show resolved Hide resolved
@lerouxb lerouxb marked this pull request as ready for review November 27, 2024 13:07
@lerouxb
Copy link
Contributor Author

lerouxb commented Nov 27, 2024

I'm reasonably sure that it is the hostname that can (under some edge cases) contain non-ascii characters that then gets passed through as part of the output of commands that include the hostname in the response and then the driver throws because the server's response fails utf8 validation.

Disabling utf8 validation for these commands should cover it as a workaround and it should be low-risk.

For a reproduction on linux, see https://jira.mongodb.org/browse/SERVER-97683

@lerouxb lerouxb merged commit 14d1aa3 into main Nov 27, 2024
31 checks passed
@lerouxb lerouxb deleted the enableUtf8Validation-false branch November 27, 2024 13:10
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.

2 participants