From the Google Picker, after selecting the file, I receive a "file not found" error in the backend integration

26 Views Asked by At

Our application encounters an error from Google Drive when attempting to download a selected file from the Google Picker.

We have two applications, one for the production environment and one for the development environment, which is in test mode (unverified) on Google Developer Console.

Both applications have the same scopes:

.../auth/userinfo.email
.../auth/userinfo.profile
.../auth/drive.file app
.../auth/drive.install

and the same configurations, albeit on different servers (or at least we believe so).

In the test environment, everything works correctly, while in the production environment, the error occurs.

We tested locally (on a development machine) using both the production app credentials and the test credentials and were able to replicate the error, tracing it back to the call to Drive.

Locally, with test credentials, we get this result:

curl -H "[AUTH_TOKEN]" https://www.googleapis.com/drive/v3/files/19MO3I3AWVmgj75DHzhm-O-j12dS8lZC_xxxxxxxxxxx

RESPONSE:

{
    "kind": "drive#file",
    "id": "19MO3I3AWVmgj75DHzhm-O-j12dS8lZC_xxxxxxxxxxx",
    "name": "recount jobs -",
    "mimeType": "application/vnd.google-apps.document"
}

Still locally, but with production credentials, we get this result:

curl -H "[AUTH_TOKEN]" https://www.googleapis.com/drive/v3/files/19MO3I3AWVmgj75DHzhm-O-j12dS8lZC_xxxxxxxxxxx

{
  "error": {
    "code": 404,
    "message": "File not found: 19MO3I3AWVmgj75DHzhm-O-j12dS8lZC_xxxxxxxxxxx.",
    "errors": [
      {
        "message": "File not found: 19MO3I3AWVmgj75DHzhm-O-j12dS8lZC_xxxxxxxxxxx.",
        "domain": "global",
        "reason": "notFound",
        "location": "fileId",
        "locationType": "parameter"
      }
    ]
  }
}

Note: Not all files have this problem. Additionally, if a malfunctioning file is opened via "Open with" from Google Drive, everything works correctly.

Is there perhaps some configuration issue that we're overlooking?

0

There are 0 best solutions below