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

Total timeout of API google.datastore.v1.Datastore exceeded 60000 milliseconds #1176

Open
jrabelo-colmeia opened this issue Oct 18, 2023 · 17 comments
Assignees
Labels
api: datastore Issues related to the googleapis/nodejs-datastore API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@jrabelo-colmeia
Copy link

Hello, we are getting this error from nodejs-datastore-sdk in our clusters in production from time to time:

Error: Total timeout of API google.datastore.v1.Datastore exceeded 60000 milliseconds before any response was received.

We are having this error for more than one year and no one seems to know what's going on, can you guys at least enlighten us on what could be possibly happening???

  1. Is this a client library issue or a product issue?
    Yes, it looks like a bug into nodejs-datastore-sdk

  2. Did someone already solve this?

  • Search the issues already opened: not-found
  • Search the issues on our "catch-all" repository: not-found
  • Search or ask on StackOverflow (engineers monitor these tags): not-found

Environment details

  • OS: debian10
  • Node.js version: 14.21.1
  • npm version: 9.5.0
  • @google-cloud/datastore version: 7.0.0

Steps to reproduce

  1. Unfortunately not reproduceable, it happens completely random times in our VM instances at google-cloud-platform
@jrabelo-colmeia jrabelo-colmeia added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Oct 18, 2023
@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/nodejs-datastore API. label Oct 18, 2023
@sofisl
Copy link
Contributor

sofisl commented Oct 19, 2023

@danieljbruce, not sure if this is related to b/303109029 and b/303728081

@jrabelo-colmeia
Copy link
Author

hello guys, here is a callstack that can help you guys to troubleshoot the problem:
image

@nlbi21
Copy link

nlbi21 commented Nov 7, 2023

Hi guys, the same thing is happening to me, it's very random. It started happening today and we haven't made any changes.

  Error: Total timeout of API google.datastore.v1.Datastore exceeded 60000 milliseconds before any response was received.
  
  at .repeat ( /node_modules/google-gax/build/src/normalCalls/retries.js:66 )
  at .Timeout._onTimeout ( /node_modules/google-gax/build/src/normalCalls/retries.js:101 )
  at .listOnTimeout ( node:internal/timers:569 )
  at process.processTimers ( node:internal/timers:512 )

I have updated my version to see if it solved the problem but it keeps happening.

@google-cloud/datastore 8.2.1 to 8.2.2

Node version: v18.17.0
npm version: 9.6.7

@jrabelo-colmeia
Copy link
Author

Hello, any news on any updates in this issue?

Our production servers are simply losing datastore connection and EVERYTHING goes down for a couple of minutes, this is a HUGE problem, if anyone has any idea how to solve this issue we would thanks a lot

@rossjs
Copy link

rossjs commented Dec 19, 2023

I opened a support ticket and was told that, while the issue isn't resolved, there is a workaround. It was confirmed to be an issue with the Datastore backend and not an issue with this library, but it looks like you can now add a fallback to the options object when creating a new Datastore instance.

const ds = = new Datastore({
  fallback: 'rest',
});

Reference PR

Unfortunately, I also need to use the @google-cloud/connect-datastore library and that is currently locked to @google-cloud/datastore v7 so I'm unable to upgrade at this time. I'm currently using our Cloud SQL database as a fallback workaround.

@looker-colmeia
Copy link

looker-colmeia commented Dec 19, 2023

thanks for your help @rossjs we are gonna try this fallback parameter

@patriciatrauman
Copy link

Hi,

I've tried to add fallback: 'rest' to my Datastore object instanciation and got this error

FetchError: Invalid response body while trying to fetch https://datastore.googleapis.com/v1/projects/[...PROJECT ID...]:lookup?$alt=json%3Benum-encoding=int: read ECONNRESET at Gunzip.<anonymous> ([...PROJECT LOCATION...]/node_modules/google-gax/node_modules/node-fetch/lib/index.js:400:12) at Gunzip.emit (node:events:525:35) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { type: 'system', errno: 'ECONNRESET', code: 'ECONNRESET', note: 'Exception occurred in retry method that was not classified as transient' }

@looker-colmeia
Copy link

@patriciatrauman are you using datastore 8.3.0 version of library?
@danieljbruce is this PR https://github.com/googleapis/nodejs-datastore/pull/1203/files suposed to solve this issue?

@patriciatrauman
Copy link

@looker-colmeia , here are what the package I use
Screenshot 2023-12-20 at 15 34 54
And I tried to implement like this
Screenshot 2023-12-20 at 15 36 38
I also tried with value true, false or proto and I did not find any good way :(

@danieljbruce
Copy link
Contributor

@looker-colmeia The PR you mentioned is the workaround as @rossjs mentioned.

@patriciatrauman The code snippet below using 'rest' works just fine for me. Could you provide us with a reproducible code example?

const {Datastore} = require('@google-cloud/datastore');

async function printResults() {
  const datastore = new Datastore({
    fallback: 'rest'
  });
  const kind = "key";
  const taskKey = datastore.key([kind, 1]);
  const newTask = {
    key: taskKey,
    data: {
      value: 999,
    },
  };
  await datastore.save(newTask, {});
  const [entity] = await datastore.get(taskKey);
  const returnedKey = entity[Datastore.KEY];
  console.log(returnedKey);
}

printResults();

@danieljbruce
Copy link
Contributor

Closing this issue since I have not heard back, but feel free to open this issue again if it persists.

@looker-colmeia
Copy link

hello, any news on this issue??? rest fallback is very slow

@danieljbruce danieljbruce reopened this Jul 17, 2024
@danieljbruce danieljbruce added priority: p3 Desirable enhancement or fix. May not be included in next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jul 17, 2024
@danieljbruce
Copy link
Contributor

Lowering priority to P3 since the issue is now just limited to REST fallback.

@looker-colmeia
Copy link

Lowering priority to P3 since the issue is now just limited to REST fallback.

I'd like to remind senior-developers of this lib and also program-managers that THIS IS NOT A P3 PROBLEM

REST fallback is SLOW and we are moving away from Datastore and going to ScyllaDB because of timeout/reset problems

We are also thinking about leaving the entire google-cloud-platform, so I hope you guys realize how bad this problem is for your customers

@klaa97
Copy link

klaa97 commented Aug 7, 2024

Lowering priority to P3 since the issue is now just limited to REST fallback.

Could you expand on this message? We are seeing this in production, in two completely different environments.

REST fallback is just not an option for high-load production environments, it's extremely slow - so the issue is not "limited" to REST fallback - I think it should not even be relevant in this discussion to talk about REST fallback 🤔 .

The issue is clearly in the Datastore client - (I am already in contact with GCP support for this and hopefully our requests will reach library team). If you want to reproduce it, I am positive about the fact that it would be enough to:

  • Spawn a GKE cluster with a pod doing read/writes to datastore
  • Spam it for a few days with a moderate amount of requests (~50 req/s)
  • You will eventually see this error

@looker-colmeia
Copy link

we are also using google-cloud/spanner and google-cloud/big-table and we have no RST problems at all, maybe reading both spanner and big-table codebases would be helpful to solve this problem

@alinalexandru
Copy link

Have the same issue using version 9.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/nodejs-datastore API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

9 participants