File API Driver Patch Method Failed with "Precondition Failure" "conditionNotMet"

It seems that over night the Google Drive API methods (). patch (,). execute () stopped working and threw an exception. This issue is also seen on the Google help page https://developers.google.com/drive/v2/reference/files/patch if you "try."

Response to exception:

500 Internal Server Error cache-control: private, max-age=0 content-encoding: gzip content-length: 162 content-type: application/json; charset=UTF-8 date: Thu, 22 Aug 2013 12:32:06 GMT expires: Thu, 22 Aug 2013 12:32:06 GMT server: GSE { "error": { "errors": [ { "domain": "global", "reason": "conditionNotMet", "message": "Precondition Failed", "locationType": "header", "location": "If-Match" } ], "code": 500, "message": "Precondition Failed" } } 

It really affects our application.

+4
source share
3 answers

duplicated here Getting 500: Prerequisite Failure while patching a folder. Why?

I recall a comment from one of the dev videos that says, "Use" Update instead of fixing, "because it has one server poll inside the server." I assumed that Patch checks etags, but Update does not. I changed my code to use Update instead of Patch, and the problem has not occurred since.

It is necessary to develop love against a moving target, -)

+1
source

We are also experiencing this. A quick fix is ​​to add this header: If-Match: * (ideally you should use the etag of the object, but you may not have the conflict resolution logic right now).

Google developers, please let us know if you plan to unblock changes.

+2
source

It seems that over the past 24 hours, the Files.Patch problem has returned to how it worked on August 22. We also encountered this problem when we tried to install the LastModified Timestamp file - see Extracting the log file below:

 20130826 13:30:45 - GoogleApiRequestException: retry number 0 for file patch of File/Folder Id 0B9NKEGPbg7KfdXc1cVRBaUxqaVk 20130826 13:31:05 - ***** GoogleApiRequestException: Inner exception: 'System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at Google.Apis.Requests.Request.InternalEndExecuteRequest(IAsyncResult asyncResult) in c:\code.google.com\google-api-dotnet-client\default_release\Tools\BuildRelease\bin\Debug\output\default\Src\GoogleApis\Apis\Requests\Request.cs:line 311', Exception: 'Google.Apis.Requests.RequestError Precondition Failed [500] Errors [ Message[Precondition Failed] Location[If-Match - header] Reason[conditionNotMet] Domain[global] ] ' 20130826 13:31:07 - ***** Patch file request failed after 0 tries for File/Folder 0B9NKEGPbg7KfdXc1cVRBaUxqaVk 

Today, the execution of the same process is performed every time it corrects the timestamp of files, as before August 22.

As a result of this 4/5 day crash, we now have hundreds (possibly thousands) of files with incorrect timestamps.

I know that the API is a beta version, but please, please Google Developers “inform us in advance about any“ trial fixes ”and at least post on this forum to confirm the problem, to save time trying find an error in our custom programs.

+2
source

Source: https://habr.com/ru/post/1498378/


All Articles