I am getting 500 error when I am trying to give access permission of any file. I don't want to send e-mail when the file is shared with someone. I want to stop the notification emails.
Insert insert = service.permissions().insert(fileId, newPerm);
insert.setSendNotificationEmails(false);
newPerm = insert.execute();
500 OK
{
"code" : 500,
"errors" : [ {
"domain" : "global",
"message" : "Internal Error. User message: \"An internal error has occurred which prevented the sharing of these item(s): fileame\"",
"reason" : "internalError"
} ],
"message" : "Internal Error. User message: \"An internal error has occurred which prevented the sharing of these item(s): filename\""
}
Appreciate any suggestion.
Resolve a 403 error: Project rate limit exceededRaise the per-user quota in the Google Cloud project. For more information, request a quota increase. Batch requests to make fewer API calls. Use exponential backoff to retry the request.
Browser troubleshooting step: - Clear the browser cache. - Try accessing the 'Class Drive' folder in Incognito/Private mode. - Try using a different browser.
I started getting this problem but managed to workaround it by introducing a pause between file push and permission insert.
my 'workflow' (using http posts rather than rest client):
I was always getting the 500 'Internal error' at Step 3; the file was always being pushed successfully.
On my initial debugging, when stepping through, I'd try and push the same file to Google again, and it'd return the same fileId as on previous attempts with the same file (so Google Drive API must recongise the file is the same).
But when I attempted subsequent permission inserts (still debugging) with the same fileId, it was ALWAYS successful.
So I just introduced a 20s pause between file push and permission insert, which has done the trick (as time isn't critical in my application).
There must be some kind of replication delay (or 'time_til_permissions_can_be_inserted') in Google Drive. Hard to believe, seeing as it's Google, but hey.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With