harababurel/gcsf

BadRequest on Google Doc files

Deadolus opened this issue · 2 comments

I get following error once my (bigger than 100GB) drive is mounted.
From the error message I gather that gcsf is trying to download a Google Docs file,
which seems to be not supported by the Google Drive API (?).

ERROR gcsf::gcsf::drive_facade > Got error: ErrorMessage { msg: "BadRequest(\n    ErrorResponse {\n        error: ServerError {\n            errors: [\n                ServerMessage {\n                    domain: \"global\",\n                    reason: \"fileNotDownloadable\",\n                    message: \"Only files with binary content can be downloaded. Use Export with Google Docs files.\",\n                    location_type: Some(\n                        \"parameter\"\n                    ),\n                    location: Some(\n                        \"alt\"\n                    )\n                }\n            ],\n            code: 403,\n            message: \"Only files with binary content can be downloaded. Use Export with Google Docs files.\"\n        }\n    }\n)" }

As the error message does not mention which file it can not download I am unsure what it tried to get from the server.
it might be some saved google Maps, which google-drive-ocamlfuse seems to create a .desktop file form (on Ubuntu).
E.g. following file was created for me from some saved routes on my google drive:

Travel.desktop

[Desktop Entry]
Type=Link
Name=Route to XXX
URL=https://www.google.com/maps/d/drive?state=%7B%22ids%22:%5B%221lmT28FWMBaCOobleYNrbGMYtTZ0%22%5D,%22action%22:%22open%22,%22userId%22:someNumbersWhichMightBeMyUserId%22%7D

Thank you for your work.

Started getting this recently as well. Any clues yet?

Is this the same as #34 also?

Since 88ee06b (included in 0.1.24), special Drive files which cannot be exported are represented as dummy text files containing a message similar to:

UNEXPORTABLE_FILE: The MIME type of this file is "application/vnd.google-apps.map", which can not be exported from Drive. Web content link provided by Drive: None

which should get rid of the BadRequest errors. I have so far only found Maps and Forms to fit in this category, but will add others if anyone reports them. Other special files (Sites and Drawings) can be exported and are now supported by GCSF.

#34 is a different issue altogether, caused by a mix of:

  • having >100 GB of data on Drive; note that only the file count influences the mount time, not the file size
  • the design decision to make GCSF fetch everything at mount time instead of being lazy and fetching as needed
  • Drive API allowing callers to request between 100 and 1000 files per page (see the pageSize parameter) but providing no guarantee on how many files it will actually return (only 460/page in this case).
  • the likelihood of a user having a significant number of files shared with them, which can't be easily excluded from the API response (see Google Drive API files setq sharedWithMe=false causes “500 Internal Server Error” on stack overflow). The workaround described in the comments is not a viable option -- for instance I am the owner of some files within a large shared directory owned by someone else. These files match 'me' in owners but they do not belong to my drive, which means that using this workaround by itself makes a bunch of unrelated files suddenly lose their hierarchical order and appear flattened in the mount directory.

Solving #34 requires a bit more work and possibly a redesign of the file system.