-
Notifications
You must be signed in to change notification settings - Fork 443
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
Alert user when keyfile does not include projectId #171
Comments
I'm looking into this now. |
@tmatsuo I'm having trouble duplicating this. php-tools is copying the base64-encoded keyfile data from travis' config into It seems that you're authenticating fine because you wouldn't get so far as a datastore not enabled error if it was a keyFile issue... What should the project ID be? The project ID that the test is using is When we guess about a project ID, the first thing we check is the keyFile, if it's provided. In this case I think it is, via the environment variable, so it should never reach the GCE project ID check. It's odd that you'd authenticate fine but then run into an incorrect project ID. |
I tried forking the php-docs-samples repo and running the datastore-veneer branch against travis. The tests are passing for me. I am using my normal Project ID that I use for everything, and I am seeing that it is using the correct Project ID. Is it possible that the keyFile in |
I had a chat on hangout with @dwsupplee and @jdpedrie and we figured out what is happening here. The current code for guessing projectId is here: It looks up the To unblock our test, we will re-generate the json key file, I'm pretty certain we'll be fine. It might be a good idea to give a warning when a user is using old format json key file, something like: "The credentials file you are using has an old format. We recommend that you re-generate the credentials file". |
JFYI, I confirmed that the tests pass with a new json key file just generated. |
I'll go ahead and close this out then. :) |
@jdpedrie Would you mind if we kept this open to track adding the warning for users? |
@dwsupplee what's the status of this one? Are we actively pursuing a solution or is it 'nice-to-have' for now? |
@danoscarmike, This is currently a nice to have. |
cc: @bshaffer
Basically I do like this:
with a hope that the client library correctly guesses the projectId from the credentials (the credentials are given via the GOOGLE_APPLICATION_CREDENTIALS envvar).
The test is failing with a wrong projectId guess:
https://travis-ci.org/GoogleCloudPlatform/php-docs-samples/jobs/163269293#L3696
I think the test is failing because this guess is based on the project where the GCE instance is running in (travis is running GCE).
Can this library make a right guess from the credentials file? The credentials file contains projectId in it, so it's technically possible.
The text was updated successfully, but these errors were encountered: