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

Switching connections doesnt work due to AuthCache #209

Closed
matthewjumpsoffbuildings opened this issue May 19, 2024 · 2 comments · Fixed by #210
Closed

Switching connections doesnt work due to AuthCache #209

matthewjumpsoffbuildings opened this issue May 19, 2024 · 2 comments · Fixed by #210
Assignees
Labels
bug Something isn't working

Comments

@matthewjumpsoffbuildings
Copy link
Contributor

matthewjumpsoffbuildings commented May 19, 2024

If I have 2 different spanner connections setup in my config/databases.php, with different project IDs and key files, if I connect to one via DB::connection('spanner-one'), do some queries, then try and connect to the other with DB::connection('spanner-two'), it fails, with IAM permission denied errors.

It appears the auth from the first connection, which is now cached in storage/framework/spanner/_auth, is being loaded via the AuthCache into the second connection, and of course doesnt have the necessary permissions since the second connection should use an entirely different project/key file/auth

If however, I query the first connection, manually delete the storage/framework/spanner/ folder, then query the second one, it does work as expected.

I tried using spanner:cooldown on the first connection before attempting to use the second, but this didnt work, it doesnt appear to clear the storage/framework/spanner/_auth folder

@taka-oyama
Copy link
Collaborator

Hi, this will be fixed in the next patch release. Thanks.

@taka-oyama
Copy link
Collaborator

Fixed in v8.1.0 and v7.4.1.

@taka-oyama taka-oyama self-assigned this May 21, 2024
@taka-oyama taka-oyama added the bug Something isn't working label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants