astrada / google-drive-ocamlfuse

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

Extended attributes and ACL 'key expired' when moving certain files #751

Open puterboy opened 2 years ago

puterboy commented 2 years ago

I have a few files that I manually copied to my google drive mounted using google-drive-ocamlfuse that seem to have messed up Extended Attributes and ACLs. , Specifically, if I run any Linux command that accesses the ACLs or Extended Attributes of those file (e.g. 'mv' or even 'rsync -navXA' (which only reads the files but doesn't actually transfer them), then I get the following pair of errors:

mv: getting attribute 'btrfs.compression' of 'btrfs.compression': Key has expired
mv: getting attribute 'system.posix_acl_access' of 'system.posix_acl_access': Key has expired

Or rsync: get_xattr_data: lgetxattr(""/home/myuser/gdrive/myfile","btrfs.compression",4) failed: Key has expired (127)

Clearing the google-drive-ocamlfuse cache or even restarting google-drive-ocamlfuse didn't help. Nor did touching or renaming the file on gdrive.

I was able to clear the error by mv'ing the file first to my native Linux drive (and ignoring the above attribute errors) and then mv'ing them back to my gdrive.

This may or may not ultimately be a Google problem, but

  1. It only seems to be triggered by files that I move/copy to Google Drive using google-drive-ocamlfuse
  2. The error seems to only show up when I access the files from google-drive-ocamlfuse (in part, because native Google Drive access doesn't show ACLs and Extended Attributes)

Also, note that this only occurs to a few recently transferred files among many thousands of files transferred over the years.

astrada commented 2 years ago

Any idea what may be going on here?

No sorry, and searching on Google "Key has expired" with xattr context doesn't find anything useful.

Any idea on how to reset the expired keys without having to move the files from Google Drive and then back?

It looks like you can use setfattr to reset the xattr on your files, but I have no idea what value you should set or if removing the attribute is enough.

puterboy commented 2 years ago

I noticed that someone else had posted a similar error in https://github.com/astrada/google-drive-ocamlfuse/issues/640 And my multiple Google searches also came up blank except for the above bug report...

This makes me wonder whether it is indeed something specific to google-drive-ocamlfuse -- since with the literally billions of people using Google Drive and the many apps that interface with it, it would seem strange that nobody else has surfaced such an error with any other application... but this is just my speculation...

astrada commented 2 years ago

Yes, the problem is with google-drive-ocamlfuse because it maps xattrs on Drive properties. But the real problem is that I have no idea where the "Key has expired" error comes from. My app doesn't handle xattrs, it just stores/retrieves them, and that's all. That error must be returned by the OS/FS but I don't know why.

puterboy commented 2 years ago

Are you able to reproduce the error? I am struggling to reproduce it...

astrada commented 2 years ago

Are you able to reproduce the error?

No.sorry, I never got it. But I don't use btrfs.