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

Intermittent Exception / Precondition check failed #2558

Closed
billynoah opened this issue Feb 1, 2024 · 4 comments
Closed

Intermittent Exception / Precondition check failed #2558

billynoah opened this issue Feb 1, 2024 · 4 comments

Comments

@billynoah
Copy link

Environment details

  • OS: Ubuntu 22.04
  • PHP version: 7.4.3
  • Package name and version: Google_Service_Gmail

Steps to reproduce

We are experiencing intermittent issue where listing gmail messages returns a Google Service Exception:

PHP Fatal error:  Uncaught Google\Service\Exception: {
  "error": {
    "code": 400,
    "message": "Precondition check failed.",
    "errors": [
      {
        "message": "Precondition check failed.",
        "domain": "global",
        "reason": "failedPrecondition"
      }
    ],
    "status": "FAILED_PRECONDITION"
  }
}

Code example

$this->service->users_messages->listUsersMessages('me', $params);

This happens in a job that runs approx once every 60 seconds. Every time it runs the token is refreshed so presumably it is not an authentication issue. In the course of a day it might happen 1% - 2% of of the time out of 1000 times the job runs. So not very often, but often enough that it is cause for concern.

This has been going on for years. Is there anything we can do or is it simply a glitch in the API server where we should just wait and make the request later?

@VladislavOkishev
Copy link

I have the same problem(

@mrsateeshp
Copy link

we observe the same issue every day. same use case.

@lykalabrada
Copy link

lykalabrada commented Apr 15, 2024

We've just come across this same problem, we are using NodeJS and trying to send an email on behalf of a user. It is also intermittent. Looks like it's an issue on the googleapis core

[Update] in our case, this is only happening for specific users

@Hectorhammett
Copy link
Contributor

Hello!

Thanks so much for reaching out, this definitely seems an issue with the API more than the library.

Here is some information I found looking around related to the issue, I hope it helps!
https://stackoverflow.com/questions/77300161/getting-precondition-check-failed-when-using-gmail-api-with-a-service-account

Closing the issue as it is not related to the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants