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

Catalog discovery failing when using browser authentication #48

Open
dlouseiro opened this issue Oct 23, 2024 · 4 comments
Open

Catalog discovery failing when using browser authentication #48

dlouseiro opened this issue Oct 23, 2024 · 4 comments

Comments

@dlouseiro
Copy link
Contributor

While using the tap-snowflake with use_browser_authentication=True, my catalog discovery fails with Run invocation could not be completed as block failed: Cannot start plugin tap-snowflake: Catalog discovery failed: invalid catalog: Expecting value: line 1 column 1 (char 0). A bit of a cryptic error.

After investigating a bit further with meltano invoke tap-snowflake --discover > catalog.json, I noticed that the Snowflake connector sends the browser authentication logs to stdout, so the first line in my catalog is:

Initiating login request with your identity provider. A browser window should have opened for you to complete the login. If you can't see it, check existing browser windows, or your OS settings. Press CTRL+C to abort and try again...
Going to open: https://accounts.google.com/o/...to authenticate

After looking a bit deeper into the snowflake-connector-python, it seems that they use print() for this message here, which causes the issue.

@dlouseiro
Copy link
Contributor Author

It seems that the issue was already reported here.

@dlouseiro
Copy link
Contributor Author

Also cross-posted this issue here.

@dlouseiro
Copy link
Contributor Author

Hey @edgarrmondragon , I don't see much traction on the related issue on the Snowflake side as it seems they have their reasons to use a print instead of a logger in this case, polluting stdout.

Do you think we could implement some type of (maybe a bit dirty) workaround here in the tap-snowflake?

@edgarrmondragon
Copy link
Member

If we know the point at which the call chain starts on our end, we could try using contextlib.redirect_stdout(sys.stderr).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants