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

Comment out import of Vitess to fix error logging #1339

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

avelanarius
Copy link
Member

@avelanarius avelanarius commented Mar 3, 2025

It turns out that JUST IMPORTING Vitess messes up logging in the entire application.

Vitess code in its init() function (called before our main) redirects stderr logging into its own logging implementation (which doesn't print anything for us): https://github.com/vitessio/vitess/blob/41a8d1dd323fb56e9dce88b29c64f9dc87b5a0fe/go/vt/logutil/logutil.go#L17-L18

For now, I just commented out the code that imported (and used) Vitess.

Before the fix, if the config validation failed, it wouldn't print the cause of the failure. After this fix, the cause is now properly printed out:

               ________
               \_____  \  __ __   ____   ______ _____ _____
                /  / \  \|  |  \_/ __ \ /  ___//     \\__  \
               /   \_/.  \  |  /\  ___/ \___ \|  Y Y  \/ __ \_
               \_____\ \_/____/  \___  >____  >__|_|  (____  /
                      \__>           \/     \/      \/     \/

2025/03/03 19:18:14 Config validation failed: 2 errors occurred:
	* no frontend connectors defined
	* no pipelines defined, must define at least one

It turns out that JUST IMPORTING Vitess messes up logging in the entire
application.

Vitess code in its `init()` function (called before our `main`) redirects
stderr logging into its own logging implementation (which doesn't print
anything for us).

For now, I just commented out the code that imported (and used) Vitess.

Before the fix if the config validation failed, it wouldn't print
the cause of the failure. After this fix, the cause is now properly
printed out:

               ________
               \_____  \  __ __   ____   ______ _____ _____
                /  / \  \|  |  \_/ __ \ /  ___//     \\__  \
               /   \_/.  \  |  /\  ___/ \___ \|  Y Y  \/ __ \_
               \_____\ \_/____/  \___  >____  >__|_|  (____  /
                      \__>           \/     \/      \/     \/

2025/03/03 19:18:14 Config validation failed: 2 errors occurred:
	* no frontend connectors defined
	* no pipelines defined, must define at least one
@avelanarius avelanarius requested a review from a team as a code owner March 3, 2025 18:21
@trzysiek trzysiek enabled auto-merge March 3, 2025 18:23
@trzysiek trzysiek added this pull request to the merge queue Mar 3, 2025
Merged via the queue into QuesmaOrg:main with commit 8a32ac5 Mar 3, 2025
5 checks passed
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