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

Bug in Double application of Google Creds utility #685

Closed
ydamit opened this issue May 11, 2022 · 3 comments
Closed

Bug in Double application of Google Creds utility #685

ydamit opened this issue May 11, 2022 · 3 comments
Assignees
Labels
bug Impact - something is currently broken in Parsons and needs to be fixed connector update Work type - additions or changes to the functions of an existing Parsons connector good first issue These issues are great ones to start working on for Parsons newcomers! medium priority Priority - this doesn't need to be addressed immediately, but will broadly impact Parsons users

Comments

@ydamit
Copy link
Contributor

ydamit commented May 11, 2022

The setup_google_application_credentials() utility is applied twice in any use of the GoogleBigQuery connector that uses copy() or any other method that also instantiates the GoogleCloudStorage class.

Both of these classes make use of the setup_google_application_credentials() utility, which works fine the first time it's applied. The result under most conditions is that the GOOGLE_APPLICATION_CREDENTIALS env var is populated with the path to the temporary .json file holding the credentials.

The problem is that the second time this is applied, a temporary file is created whose contents are merely the path to the first temporary file, and the various clients involved don't know what to do with that. They try to parse that nested file path as a JSON string, and of course it throws an error.

I believe this might be most easily fixed by adding another condition to the if block to handle this edge case:

elif credentials.endswith('.json'):
    return True
@ydamit ydamit added the bug Impact - something is currently broken in Parsons and needs to be fixed label May 11, 2022
@ydamit
Copy link
Contributor Author

ydamit commented May 11, 2022

CC: @elyse-weiss and @zerlinac

@SorenSpicknall SorenSpicknall added good first issue These issues are great ones to start working on for Parsons newcomers! medium priority Priority - this doesn't need to be addressed immediately, but will broadly impact Parsons users connector update Work type - additions or changes to the functions of an existing Parsons connector labels May 13, 2022
@alxmrs
Copy link
Contributor

alxmrs commented Sep 16, 2022

I'm happy to take a look at this.

alxmrs added a commit to alxmrs/parsons that referenced this issue Sep 17, 2022
I wrote unit tests to try to programmatically reproduce the issue described in move-coop#685. However, I was unable to identify the issue.
SorenSpicknall pushed a commit that referenced this issue Nov 22, 2022
I wrote unit tests to try to programmatically reproduce the issue described in #685. However, I was unable to identify the issue.
@SorenSpicknall
Copy link
Collaborator

Appears to be superseded by updated approach to passing auth information to BQ operations, but feel free to reopen if needed.

@SorenSpicknall SorenSpicknall closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Impact - something is currently broken in Parsons and needs to be fixed connector update Work type - additions or changes to the functions of an existing Parsons connector good first issue These issues are great ones to start working on for Parsons newcomers! medium priority Priority - this doesn't need to be addressed immediately, but will broadly impact Parsons users
Projects
None yet
Development

No branches or pull requests

4 participants