astrada / google-drive-ocamlfuse

FUSE filesystem over Google Drive
https://astrada.github.io/google-drive-ocamlfuse/
MIT License
5.57k stars 354 forks source link

"Failed to close" and "write error: Input/output" errors. #805

Open realdigger opened 1 year ago

realdigger commented 1 year ago

Hi From today (02 Mar 2023), when I try to copy files to Google Drive, I get this error anytime

cp test.php /mnt/gdrive/test
cp: failed to close '/mnt/backup/gdrive/test/test.php': Input/output error

This happens on all my hosts. I am using version 0.7.27 on Debian 10.

therealcodlord commented 1 year ago

I too noticed this problem yesterday (02 Mar 2023). I use an rsync script to sync my deja-dup backups to my google drive and now rsync gives the following errors:

rsync: [receiver] close failed on "/home/user/BACKUPS/.duplicity-full.20230302T135126Z.vol1.difftar.gpg.u3CrD1": Input/output error (5)
rsync error: error in file IO (code 11) at receiver.c(871) [receiver=3.2.3]
rsync: [sender] write error: Broken pipe (32)

When I try and manually copy the file in question I get the same error as @realdigger originally reported.

I am using google-drive-ocamlfuse, version 0.7.30 (the latest at this time I believe) on Ubuntu 22.04.2 LTS

Never had any rsync problems before so I suspect this is a change or an issue with Google Drive, not with google-drive-ocamlfuse?

I did try a delete of the target directory on Google Drive (& purge the Google Drive trash) and then re-create the directory, but it's still the same.

EDIT/UPDATE 1:

I did some more testing, I tried a different google drive account and got the same problem. And I did notice that when using cp the files do seem to be copied successfully to the google drive, it's just the error is given at the end of the copy. But using rsync even with the --ignore-errors flag still errors/ends processing and does not copy anything.

EDIT/UPDATE 2:

I found this post from 2016 which gave the same symptoms so I took the advice from there regarding running with -debug flag and looking in ~/.gdfuse for gdfuse.log and curl.log and the only sort of errors seemed to be as follows:

gdfuse.log excerpt:

[562.244986] TID=531: File not found: stat /.hidden
[562.439084] TID=528: Error during request: Error: <!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>The requested URL <code>/resumable/drive/v3/files/1VMzJ3q8viUbwJdrMUjkrFv_IKyBNrLOb?fields=appProperties,capabilities(canEdit),createdTime,explicitlyTrashed,fileExtension,fullFileExtension,id,md5Checksum,mimeType,modifiedTime,name,parents,size,trashed,version,viewedByMeTime,webViewLink,exportLinks,shortcutDetails(targetId,targetResourceKey),shared,resourceKey&amp;enforceSingleParent=true&amp;supportsAllDrives=true</code> was not found on this server.  <ins>That’s all we know.</ins>
 (HTTP response code: 404)
[562.439133] TID=528: Giving up
[562.439159] TID=528: Exception:Failure("Error: <!DOCTYPE html>\n<html lang=en>\n  <meta charset=utf-8>\n  <meta name=viewport content=\"initial-scale=1, minimum-scale=1, width=device-width\">\n  <title>Error 404 (Not Found)!!1</title>\n  <style>\n    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}\n  </style>\n  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>\n  <p><b>404.</b> <ins>That\226\128\153s an error.</ins>\n  <p>The requested URL <code>/resumable/drive/v3/files/1VMzJ3q8viUbwJdrMUjkrFv_IKyBNrLOb?fields=appProperties,capabilities(canEdit),createdTime,explicitlyTrashed,fileExtension,fullFileExtension,id,md5Checksum,mimeType,modifiedTime,name,parents,size,trashed,version,viewedByMeTime,webViewLink,exportLinks,shortcutDetails(targetId,targetResourceKey),shared,resourceKey&amp;enforceSingleParent=true&amp;supportsAllDrives=true</code> was not found on this server.  <ins>That\226\128\153s all we know.</ins>\n (HTTP response code: 404)")
Backtrace:
[562.439359] TID=532: release /TEST.TXT O_WRONLY
[562.439383] TID=532: BEGIN: Loading resource /TEST.TXT (trashed=false) from db
[562.439395] TID=532: END: Loading resource /TEST.TXT (trashed=false) from db: Found (id=59, state=Uploading)
[571.240513] TID=2: Flushing DB...done

curl.log excerpt:

[562.316414] curl: data out: {"modifiedTime":"2023-03-03T14:41:27.000Z"}
[562.436784] curl: header in: HTTP/2 404 
[562.436819] curl: header in: x-guploader-uploadid: ADPycdsJO6yHp1BHSFwxDXDesswW5PZVfVyNZfafxMZr1a2j1-GGHt6BgKwX_dPXkOqAALzSqtJ7up3z2cnq7JaB2yYDVg
[562.436825] curl: header in: content-type: text/html; charset=UTF-8
[562.436828] curl: header in: date: Fri, 03 Mar 2023 14:41:27 GMT
[562.436832] curl: header in: server: ESF
[562.436835] curl: header in: x-content-type-options: nosniff
[562.436838] curl: header in: x-frame-options: SAMEORIGIN
[562.436842] curl: header in: x-xss-protection: 0
[562.436845] curl: header in: content-length: 1953
[562.436849] curl: header in: alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
[562.436854] curl: info: HTTP error before end of send, stop sending
[562.436858] curl: header in: 
[562.436869] curl: data in: <!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images
[562.437188] curl: data in: /branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>The requested URL <code>/resumable/drive/v3/files/1VMzJ3q8viUbwJdrMUjkrFv_IKyBNrLOb?fields=appProperties,capabilities(canEdit),createdTime,explicitlyTrashed,fileExtension,fullFileExtension,id,md5Checksum,mimeType,modifiedTime,name,parents,size,trashed,version,viewedByMeTime,webViewLink,exportLinks,shortcutDetails(targetId,targetResourceKey),shared,resourceKey&amp;enforceSingleParent=true&amp;supportsAllDrives=true</code> was not found on this server.  <ins>That’s all we know.</ins>
[562.437205] curl: info: Connection #0 to host www.googleapis.com left intact
lekzz commented 1 year ago

I have my borg backups failing since sunday. I did a manual run on monday that succeeded but after that everything fails again.

error: Failed to create/acquire the lock xx/lock.exclusive (timeout).

Updated to 0.7.30, redid the auth and even removed my backup archive as history is not that important, but still nothing.

I was thinking that the error was maybe in borg/python but that works fine on a local dir. Now i see that even a simple cp gives errors. I guess google changed stuff. Hope it can be fixed soon.

astrada commented 1 year ago

It seems to be impacting some Drive API users. There is this issue in the Google's tracker: https://issuetracker.google.com/issues/271083853.

therealcodlord commented 1 year ago

My rsync backup ran successfully this AM (4th March 2023) and today I can (so far) copy files to google drive without any errors.

astrada commented 1 year ago

I've uploaded a new version on the beta ppa (https://launchpad.net/~alessandro-strada/+archive/ubuntu/google-drive-ocamlfuse-beta) that uses the "official" path for resumable uploads (https://developers.google.com/drive/api/guides/manage-uploads#resumable) even if the Discovery API (https://www.googleapis.com/discovery/v1/apis/drive/v3/rest) still returns /resumable/upload/drive/v3/files as the path for resumable uploads.