-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
FirestoreOptions not loading projectid from credentials correctly #3535
Comments
This should have been solved by #3472 and should have been included in 0.56.0. Can you double check the version you are using? |
I can confirm this, and that #3458 still is a problem. I'm using 0.56.0-beta. For context:
In other words, it's looking in the wrong place.
Which, I'm guessing, is it trying to use the default credentials on the test project's Firestore, which of course won't work. In other words, #3458. (Have I mentioned how much I dislike the concept of silent default credentials?) For comparison, with 0.51.0-beta, |
Thanks for confirming. +1 for (evil) default silent credentials |
I started looking into this, but I am not able to reproduce this exact behavior. In my tests:
Note the issue in |
I just replicated my results again to be sure. You can try it yourself: https://bitbucket.org/marshallpierce/ktor-session-gcp-firestore/src. Fiddle with the Here's the dependency graph for the google bits:
|
@marshallpierce We have released the PR that should address this issue yesterday as part of 0.57.0. Do you mind upgrading and reporting back? |
With 0.57.0-beta:
Edit: in my first |
@daltonj Does your credential file has {"type": "service_account", |
If I read this issue correctly, this seems like "working as intended". The user / service account used by the application needs to have access to the project resources being accessed. In this case, it sounds like the permissions of the user being used didn't align properly with the code. There is an effort to move away from the implicit permissions, but that's going to take some time. I don't see anything actionable on this issue, at this point, so I'm closing it. Please feel free to open a different issue to address documentation related issues around credentials. |
I recently migrated from an older version (0.45) where I configured firestore using the FirebaseOptions, e.g.
This works. I migrated to the new way of doing things with FirestoreOptions (0.56.0). I got warnings to change the configuration. So the resulting code is now:
However, this code fails. It requires that the projectId field be set using .setProjectId("..."). In my case it defaulted to another project in cloud that did not have firestore enabled. Perhaps the default project in cloud? It's unclear. This seems like a bug. The project id is not available from the credentials API, even though it is there. Why is the projectid being ignored / not set from credentials correctly?
The text was updated successfully, but these errors were encountered: