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

gcloud._helpers._compute_engine_id should return a str (Python 3) #1625

Closed
pcostell opened this issue Mar 17, 2016 · 7 comments · Fixed by #1638
Closed

gcloud._helpers._compute_engine_id should return a str (Python 3) #1625

pcostell opened this issue Mar 17, 2016 · 7 comments · Fixed by #1638
Assignees
Labels
api: core type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@pcostell
Copy link
Contributor

From googleapis/google-cloud-datastore#92:

I stumbled upon this while deploying my app for the first time on GKE/GCE.

I had to explicitly specify project when creating a client: gcloud.datastore.Client(project="my-project"), otherwise I just got an gcloud.exceptions.ServiceUnavailable: 503 Backend Error.

First I thought the problem would be that autodetecting the project-id didn't work, but gcloud.datastore.Client(credentials=credentials, project=project) returns my project-id, be it as bytes instead of str.

I quickly verified that using bytes as a project-id does not work, i.e. gcloud.datastore.Client(project=b"my-project") resulted in that neat 503 Backend Error.

@dhermes dhermes added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. api: core labels Mar 18, 2016
@dhermes
Copy link
Contributor

dhermes commented Mar 18, 2016

Thanks. This has come up before (I'll try to track down where). I wish there was an easy way to run system tests on GCE and GAE.

@dhermes
Copy link
Contributor

dhermes commented Mar 18, 2016

#1470 was when it came up. "Fixed" in #1505

@dhermes
Copy link
Contributor

dhermes commented Mar 18, 2016

@pcostell What version are you using? It seems like this should be all fixed in datastore-v1beta3 branch

@pcostell
Copy link
Contributor Author

sorry I copied this from the Datastore issue tracker. @flunderpero, can you share what gcloud version you are using?

@dhermes
Copy link
Contributor

dhermes commented Mar 18, 2016

DERP. Sorry I didn't even notice that

@flunderpero
Copy link

I'm using gcloud 0.11.0 installed from PyPi.

@dhermes
Copy link
Contributor

dhermes commented Mar 18, 2016

Thanks. Right now the datastore Client doesn't use the project mix-in. I "imagined" that the Client in the datastore-v1beta3 branch did "the right thing", but that hasn't been updated either.

Thanks for poking me into noticing this change was needed!

dhermes added a commit to dhermes/google-cloud-python that referenced this issue Mar 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: core type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants