got 500 error using alt=media while success using 'downloadUrl' field in file resource - download

Recently, one of our client reports that he cannot backup files in his Team Drive using our app. We will be thankful if someone can help us figure out why.
We use alt=media method to download file. That is, https://www.googleapis.com/drive/v3/files/[FILE_ID]?alt=media. Reference link here. It works perfectly for most of the files on client side.
However, if we download some of files using this method, we got the following response from Google:
{
"error": {
"code": 500,
"message": null
}
}
These files are in Team Drive and with various extensions (not online doc). For example, .xlsx, .pdf, .jpg, etc. We re-tried few days and ALWAYS got this response message (500 with null message). We cannot get this working even if we append &supportsTeamDrives=true at the end of the URL.
By checking with GET file API, this file DOES exist on Google Drive. Even more surprisingly, we CAN DOWNLOAD this file using the URL provided in downloadUrl field from file resource! How could this happen?
We cannot find more information from Google's API document about this phenomenon. Please help us if someone knows why.
Thank you!
UPDATED:
We got the latest information from our client. It seems that these files are under some folders which are migrated from My Drive to Team Drive. Also, the creation time of these folders are ranging from 2014 to 2016, which are before the official Team Drive early adoption program.
We don't know if these facts are related to the download problem or not, since not all files under these folders are problematic. Only some of these files cannot download through alt=media method.

Related

google drive api returns 403 forbidden when downloading file content

I am trying to download content of a previous revision of a file using the google drive api for Ruby Google::Apis::DriveV3::DriveService#get_revision:
Tempfile.create('file_revision-', encoding: 'ASCII-8BIT') do |temp_file|
drive_api_service.get_revision(file_id, revision_id, download_dest: temp_file)
# work with the content
end
I keep getting Google::Apis::ClientError with status code 403, reason phrase "Forbidden". The scope https://www.googleapis.com/auth/drive is enabled and the error occurs only when I am trying to download the content of the revision. If I run the code without the parameter download_dest, the request succeeds without any problems. I am also able to fetch any meta data or revision, export files, upload files etc., the problem only occurs when I try to fetch the content, either by get_file or get_revision.
Has anyone encountered this issue?
Is there an additional permissions that specifically needs to be added to allow content downloading?
I have also looked at other questions on stack overflow and I have checked all possible configuration for google drive api I could find and everything seems to be enabled.
Right now, Google drive api does not support content downloading for native google drive files (google docs, sheets etc.), so you cant download content (current or of an old revision), you can only export it to a different mime type.

uploadState returns commitFileFailed

I'm trying to create an app in InTune using the Microsoft Graph REST API. I'm able to create the app, the contentversion, upload a file to Azure Storage, and call the commit action. After that, I'm waiting for uploadState 'commitFileSuccess', but it returns 'commitFileFailed'.
I saw a similar question, but that's assuming the file encryption is wrong:
commitFileFailed during mobileAppContentFile Commit
However, I have no clue where the error lies. Is there anybody with experience on this particular subject?
If you need more info, please let me know.
I found out what I was doing wrong. I used the PowerShell sample from Github as a base to write my own Ruby version, but I overlooked one thing.
https://github.com/microsoftgraph/powershell-intune-samples/tree/master/LOB_Application
I was uploading my apk file at once to the azureStorageUri, but I needed to upload it in chunks. After doing that the uploadState got updated to commitFileSuccess.
I will share my Ruby script once I've cleaned it up!

Firefox Extension : Unable to parse JSON data for extension storage

I have written a Firefox Extension using Web Extension APIs. It has passed the Preliminary review but the reviewer said that he cannot proceed with the full review cause when he installs it, he gets the following error -
"Unable to parse JSON data for extension storage"
Upon inspecting for quite sometime, I figured that Firefox creates a file called "storage.js" in the profile folder for each extension where it writes and reads from, all the local storage data for that particular extension. And if the extension tries to write to this file before this file is created, the error "Unable to write JSON data to extension storage" is thrown and if the extension code tries to read from this file before this file is created, the error "Unable to parse JSON data for extension storage" is thrown.
Now, my concern is how do I know for sure that the file has been created and that it can be written to or read from?
PS : This happens when the extension is just installed. For consequent sessions, this error wont come as that file is no longer missing.
This seems to be a bug in the current Firefox implementation, and your assessment is spot on:
The underlying ExtStorage module will always call read before get, set etc. even write and clear.
read will unconditionally try to access the underlying, extension specific storage file, that may not exist yet for freshly installed add-ons using the storage API for the first time.
This will therefore result in the logging of one such Unable to parse JSON data for extension storage message, no matter what you do with the storage API.
Therefore triggering the message cannot be avoided.
I suggest you do the following:
Contact the editors team, requesting they re-evaluate your add-on based on:
The message in question is really only a warning (when appearing after first access of the storage API by your addon).
Even when the message would be an actual error (the storage is corrupt), it would still not be your error, as the storage API implementation by mozilla needs to be more resilient then and there is nothing you can do anyway.
The message being issued on first regular use of the storage API, unrelated to what WebExtensions add-on uses that API and in what way, is a mozilla bug, and not something you caused or can fix yourself or at least work around.
Therefore denying a full review just because a mozilla bug erroneously logs a spurious message once without any other severe effects is... questionable.
File a bug about this so mozilla developers can address this issue. You'll wanna CC at least Bill McCloskey (:billm) since he wrote that code ;)

WP8.1 c# Onedrive SDK : download badrequest

I have a project which now doesn't work when I download binarie from onedrive like PNG. I got a bad request in query response. I take some backup and they have the same problem. This was working few days ago I have not modify anything. Is there a changne in the api ? I download xml with no problem whith same query.
I try to test apigee console and it seems to work. Anyone has same problem ? Got solution ?
THANKS a lot
I go this response from api :
StatusCode: 400, ReasonPhrase: 'Bad Request'
For those that find their way here, the problem in question is a result of some proxy servers rejecting the URLs when they contain single path segments with more than 260 characters. Unfortunately this is possible with the URLs that the OneDrive API generates, and so we're investigating changes to resolve this kind of problem.
The issue can be tracked at https://github.com/OneDrive/onedrive-api-docs/issues/143

Google Drive API 500 null errors when copying

I'm getting this error message (100% of the time) when copying a shared file, using the latest version of php library. And I'm getting the same response via the API explorer: developers.google.com/drive/v2/reference/files/copy
Google_Exception: Error calling POST
https://www.googleapis.com/drive/v2/files/#fileid#/copy: (500) {
"error": { "code": 500, "message": null } }
This issue seem to just appear since 3am, 4th Jun 2015 (from Google dev console) and only happening to large files (~1GB). Those files are now showing "Google Drive can't scan this file for viruses." when trying to download it. Google decreased maximum size that it can scan? Is theres any flags like "acknowledgeAbuse" for copy method?
Screenshot API Console:
Possible duplicate but unfortunately not answered (as of now): Google Drive SDK 500 errors on copy
This error was due to a bug in the Drive API. Here's the canonical issue report:
https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3862
In the future please file issues there instead of posting on Stack Overflow.
The bug should now be fixed.

Resources