GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Datastore: Intermittent Backend Errors since wednesday (22:00 GMT) us-central · Issue #969 · googleapis/google-cloud-java

Datastore: Intermittent Backend Errors since wednesday (22:00 GMT) us-central #969

New issue
Copy link
New issue
Copy link
Closed
Closed
Datastore: Intermittent Backend Errors since wednesday (22:00 GMT) us-central#969
Copy link
Assignees
simon-temple

Description

@simon-temple
simon-temple
opened on Apr 29, 2016
Issue body actions

We suddenly started receiving these errors in the us-central region:

Caused by: com.google.api.services.datastore.client.DatastoreException: Backend Error
at com.google.api.services.datastore.client.RemoteRpc.makeException(RemoteRpc.java:115)
at com.google.api.services.datastore.client.RemoteRpc.call(RemoteRpc.java:81)
at com.google.api.services.datastore.client.BaseDatastoreFactory$RemoteRpc.call(BaseDatastoreFactory.java:41)
at com.google.api.services.datastore.client.Datastore.runQuery(Datastore.java:109)
at com.google.gcloud.spi.DefaultDatastoreRpc.runQuery(DefaultDatastoreRpc.java:163)
... 58 more
Caused by: com.google.api.client.http.HttpResponseException: 503 Service Unavailable
Backend Error
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1061)
at com.google.api.services.datastore.client.RemoteRpc.call(RemoteRpc.java:78)
... 61 more"

Some calls succeed others fail. I can't see a gcloud API usage pattern that causes it... it just randomly happens!

I asked Google to check the logs and they stated the failures were due to the use of an invalid project-id.
For example our project id is "production-1103" and they claim to see in the logs "s~production-1103"

We're using gcloud-java 0.1.4 and don't experience these problems in the EU region. Could some external service change influence the project-id corruption? Has anyone else seen this sort of thing in the past?

Activity

Next
  1. mziccard commented on Apr 29, 2016

    @mziccard
    mziccard
    on Apr 29, 2016
    Contributor
    More actions

    This is a strange error indeed. How do you pass the project id to the datastore options? It might be worth trying to pass it using the projectId(...) setter to see if the errors occur again.
    I'll try to set up and run a test application to see if I manage to reproduce the issue.

    Not related to this issue but might be worth giving a try: starting with version 0.1.7 (release notes here) we use Cloud Datastore v1beta3.

  2. simon-temple commented on Apr 29, 2016

    @simon-temple
    simon-temple
    on Apr 29, 2016
    Author
    More actions

    Usually we don't pass the project id to the datastore options. It finds them using the metatdata request to http://metadata/computeMetadata/v1/project/project-id. I did try setting it using the GCLOUD_PROJECT environment value but this did not have any effect - the 503s continued.

    Like I said, it works without error maybe two in every ten calls so I believe the value is correct after initialisation. I don't think gcloud-java re-evaluates the project-id on each call so it has to be something deeper.

    I'm currently testing with version 0.2.0 and will deploy that shortly. Maybe the new API will avoid my current issue...

  3. mziccard commented on Apr 29, 2016

    @mziccard
    mziccard
    on Apr 29, 2016
    Contributor
    More actions

    I did try setting it using the GCLOUD_PROJECT environment value but this did not have any effect - the 503s continued.

    Nice that you tried this. I suspected an error in getting/parsing the instance metadata but we ruled that out.

    Like I said, it works without error maybe two in every ten calls so I believe the value is correct after initialization.

    You mean that 8 out of 10 requests fail with 503? This is huge...

    I don't think gcloud-java re-evaluates the project-id on each call so it has to be something deeper.

    Yes, once the project id is set we never change it.

    I'm currently testing with version 0.2.0 and will deploy that shortly. Maybe the new API will avoid my current issue...

    Please keep us posted. Also, have you experienced this issue in several zones all in the us-central region? Could you please tell me one zone where you certainly had this issue so that I have better chances of reproducing?

  4. simon-temple commented on Apr 29, 2016

    @simon-temple
    simon-temple
    on Apr 29, 2016
    Author
    More actions

    This is only happening in the us-central region

    I have now switched to using 0.2.0 and I no longer get 503's but I do get a number of these:

    exception_message: "The project properties does not exist."
    stacktrace:
    "com.google.cloud.datastore.DatastoreException: The project properties does not exist.
    at com.google.cloud.datastore.spi.DefaultDatastoreRpc.translate(DefaultDatastoreRpc.java:102)
    at com.google.cloud.datastore.spi.DefaultDatastoreRpc.commit(DefaultDatastoreRpc.java:130)
    at com.google.cloud.datastore.DatastoreImpl$4.call(DatastoreImpl.java:364)
    at com.google.cloud.datastore.DatastoreImpl$4.call(DatastoreImpl.java:361)
    at com.google.cloud.RetryHelper.doRetry(RetryHelper.java:181)
    at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:247)
    at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:237)
    at com.google.cloud.datastore.DatastoreImpl.commit(DatastoreImpl.java:360)
    at com.google.cloud.datastore.TransactionImpl.commit(TransactionImpl.java:99)
    at com.amalto.b2auth.core.persist.gce.entities.core.EntityMapper.save(EntityMapper.java:128)
    Caused by: com.google.datastore.v1beta3.client.DatastoreException: The project properties does not exist., code=INVALID_ARGUMENT
    at com.google.datastore.v1beta3.client.RemoteRpc.makeException(RemoteRpc.java:126)
    at com.google.datastore.v1beta3.client.RemoteRpc.makeException(RemoteRpc.java:169)
    at com.google.datastore.v1beta3.client.RemoteRpc.call(RemoteRpc.java:89)
    at com.google.datastore.v1beta3.client.Datastore.commit(Datastore.java:84)
    at com.google.cloud.datastore.spi.DefaultDatastoreRpc.commit(DefaultDatastoreRpc.java:128)
    ... 55 more"

    Any ideas?

  5. simon-temple commented on Apr 29, 2016

    @simon-temple
    simon-temple
    on Apr 29, 2016
    Author
    More actions

    The new 0.2.0 issue "The project properties does not exist." happens in US and EU regions...so it's not the same issue. This one is new!

    My save code looks like this:

        Entity e = eb.build();
        Transaction tx = datastore.newTransaction();
        try
        {
            tx.delete( k );
            tx.add( e );
            tx.commit();
        }
        finally
        {
            if ( tx.active() ) {
                tx.rollback();
            }
        }
    

    tx.commit() fails.

  6. mziccard commented on Apr 29, 2016

    @mziccard
    mziccard
    on Apr 29, 2016
    Contributor
    More actions

    Could you share the code that you are using to create entity and key? Or some toy code that produces the error?

    I tried to run a similar transaction in a GCE instance, zone us-central1-a, and it works just fine.

  7. simon-temple commented on Apr 29, 2016

    @simon-temple
    simon-temple
    on Apr 29, 2016
    Author
    More actions

    I'll work on some toy code now using the latest local datastore emulator. I suspect it may be something to do with an entity kind of User with an embedded entity kind of Properties.

  8. simon-temple commented on Apr 29, 2016

    @simon-temple
    simon-temple
    on Apr 29, 2016
    Author
    More actions

    Has IncompleteKey changed? I have been passing it the name of the entity attribute in User: "properties" and next the kind of "UserProperties"

    Now I see the first argument is called projectid?

                IncompleteKey propsKey = IncompleteKey.builder( key, ek.kind() ).build();
    
                FullEntity.Builder< IncompleteKey > b = FullEntity.builder( propsKey );
                for ( Map.Entry< Object, Object > ent : ( ( Properties ) o ).entrySet() ) {
                    b.set( ent.getKey().toString(), ent.getValue().toString() );
                }
    
                eb.set( key, b.build() );
    

    propsKey.toString() is:

    partition_id {
    project_id: "properties"
    }
    path {
    kind: "UserProperties"
    }

    This is the basis of the error message I receive.

  9. simon-temple commented on Apr 29, 2016

    @simon-temple
    simon-temple
    on Apr 29, 2016
    Author
    More actions

    This may be my solution, but why did it work in previous versions?

        IncompleteKey propsKey = IncompleteKey.builder( datastore.options().projectId(), ek.kind() ).build();
    
  10. mziccard commented on Apr 29, 2016

    @mziccard
    mziccard
    on Apr 29, 2016
    Contributor
    More actions

    I am confused. IncompleteKey.builder(String, String) did not change from version 0.14.0 (code here) and I believe the first argument is called projectId since version 0.9.0.

    Assuming that you mean key to be a the "properties" string, what you are attempting to do with:

    IncompleteKey propsKey = IncompleteKey.builder( key, ek.kind() ).build();

    is creating an entity with kind ek.kind() in the project properties, hence the complaint. In fact "properties" is the name you want to give the property of kind ek.kind() in what I assume being an entity of kind User, as you prove with the line:

    eb.set( key, b.build() );

    Your solution:

    IncompleteKey propsKey = IncompleteKey.builder( datastore.options().projectId(), ek.kind() ).build();

    is indeed correct. I doubt this code worked with previous versions of gcloud-java or datastore, unless the "Properties" entity was created in the properties dataset/project.

  11. simon-temple commented on Apr 29, 2016

    @simon-temple
    simon-temple
    on Apr 29, 2016
    Author
    More actions

    Sadly it did used to work! Or at least I was getting away with it...

    Here is a properties embedded attribute from our development-1104 datastore, as seen in the developer console:

    { "key": { "partitionId": { "projectId": "properties" }, "path": [ { "kind": "UserProperties" } ] }, "properties": { "webSite": { "stringValue": "www.amalto.com" }, "city": { "stringValue": "Houston" }, "title": { "stringValue": "Dev" }, "street": { "stringValue": "4545 Post Oak Place Dr. - suite 350" }, "salutation": { "stringValue": "mr" }, "state": { "stringValue": "TX" }, "phone": { "stringValue": "" }, "companyName": { "stringValue": "Amalto Technologies" }, "zip": { "stringValue": "77027" }, "country": { "stringValue": "United Kingdom" }, "mobile": { "stringValue": "123" } } }

    Note the projectId.

    Maybe this is now detected in V1beta3 and not in earlier versions... so not a gcloud-java issue?

  12. mziccard commented on Apr 29, 2016

    @mziccard
    mziccard
    on Apr 29, 2016
    Contributor
    More actions

    Oh yes this in fact falls in the case

    unless the "Properties" entity was created in the properties dataset/project.

    In v1beta2 entities where created inside datasets, now the notion of dataset has been replaced with the notion of project which has a wider scope and is subject to more constraints (you must own the project).
    I wouldn't be surprised if this was the cause of your recent Backend Error exceptions. BTW, do you still experience them with gcloud-java 0.2.0?

  13. simon-temple commented on Apr 29, 2016

    @simon-temple
    simon-temple
    on Apr 29, 2016
    Author
    More actions

    Okay, I think I understand my misuse of the API and how it worked in v1beta2
    This is a bug I uncovered moving to 0.2.0. Thanks for helping me identify this.

    I can confirm that using 0.2.0 in both EU and US regions no longer produces 503s

    The final thing I don't quite get is why using 0.1.4 in our production project (us-central) caused "Backend Errors" yet when in our development project (eu) it did not. And how a stable production system stopped working when we continued to use the v1beta2 API via 0.1.4

    This has highlighted the fact that Google Datastore API is still Beta and can not yet be relied upon for production environments.

  14. aozarov commented on Apr 29, 2016

    @aozarov
    aozarov
    on Apr 29, 2016
    Contributor
    More actions

    /cc @eddavisson

  15. eddavisson commented on Apr 29, 2016

    @eddavisson
    eddavisson
    on Apr 29, 2016
    More actions

    We believe we have identified the root cause of the intermittent errors you were seeing in the v1beta2 API and expect to have those resolved by later today.

    Reacted by Simon Temple
  16. 14 remaining items

  17. suztomo
    added 3 commits that reference this issue on Feb 1, 2023

    deps: update dependency com.google.api:gax-bom to v2.19.2 (#969)

    be19722

    chore(main): release 2.8.20 (#968)

    6df86e6

    deps: update google.core.version to v2.9.2 (#969)

    bbb96e7
  18. chingor13
    added a commit that references this issue on Jan 6, 2026

    chore: clean up final keyword and javaDoc typo (#969)

    0d8a666
  19. chingor13
    added a commit that references this issue on Jan 22, 2026

    chore(main): release 2.13.4-SNAPSHOT (#969)

    8bd2af7
  20. chingor13
    added a commit that references this issue on Feb 24, 2026

    refactor: Revert JUnit5 to JUnit4 (#969)

    53355a7
  21. chingor13
    added a commit that references this issue on Mar 12, 2026

    refactor: Revert JUnit5 to JUnit4 (#969)

    6279d6e
  22. suztomo
    added a commit that references this issue on Mar 23, 2026

    chore(main): release 2.7.8-SNAPSHOT (googleapis#969)

    9616565
  23. suztomo
    added 2 commits that reference this issue on Mar 30, 2026

    deps: update dependency com.google.cloud:google-cloud-storage to v2.1…

    4c68b3f

    chore(main): release 0.124.12 (#970)

    18e3b8a
  24. lqiu96
    added 2 commits that reference this issue on Apr 1, 2026

    deps: update dependency com.google.cloud:google-cloud-storage to v2.1…

    fc428c7

    chore(main): release 0.124.12 (#970)

    35cb9df
  25. meltsufin
    added 2 commits that reference this issue on Apr 29, 2026

    build(deps): update dependency com.google.cloud:google-cloud-shared-c…

    b4d5638

    build(deps): update dependency com.google.cloud:google-cloud-shared-c…

    4e52c33
  26. benjaminp
    added a commit that references this issue on Jul 13, 2026

    chore: regenerate README (googleapis#969)

    b44fd22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @simon-temple
    simon-temple

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.