1
votes

I use the .NET Client Library to list all files and folders in different user drives (Files/list request).

The application uses Google Apps Domain-Wide Delegation of Authority and correctly instantiates a Drive service object.

Most of the time, everything works properly and the application is able to fetch the content in Google Drive. However, about one time per day, it randomly fails on an API call (Files/List) and the .NET Client Library throws a TokenRequestException.

Here different error messages that I received on a TokenRequestException:

  • Google.Apis.Auth.OAuth2.Responses.TokenResponseException: Error:"invalid_request", Description:"", Uri:""
  • Google.Apis.Auth.OAuth2.Responses.TokenResponseException: Error:"internal_failure", Description:"com.google.gaia.client.GaiaRemoteException: Unexpected return code: 13 (backend says: GSS mutation failed: Maximum number of CONDITION_FAILURE (5) is reached.)", Uri:""

I don't understand why the DriveService fails to make the request... it seems to be related to the token...

Does someone know the reason? Why the DriveService throws this type of exception if it's correctly authenticated?

1

1 Answers

1
votes

This error means that tokens are being added too quickly for a particular user. Check if your code falls into some crazy loops that request a billion tokens in parallel for the same user.

Feel free to attach some code.