Skip to content

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

Closed

Description

@pcostell

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.

Activity

  1. added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Mar 18, 2016
  2. dhermes commented on Mar 18, 2016

    @dhermes
    Contributor

    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.

  3. dhermes commented on Mar 18, 2016

    @dhermes
    Contributor

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

  4. dhermes commented on Mar 18, 2016

    @dhermes
    Contributor

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

  5. pcostell commented on Mar 18, 2016

    @pcostell
    ContributorAuthor

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

  6. dhermes commented on Mar 18, 2016

    @dhermes
    Contributor

    DERP. Sorry I didn't even notice that

  7. flunderpero commented on Mar 18, 2016

    @flunderpero

    I'm using gcloud 0.11.0 installed from PyPi.

  8. dhermes commented on Mar 18, 2016

    @dhermes
    Contributor

    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!

  9. added a commit that references this issue on Mar 18, 2016
    090ef1b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: coretype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions