Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied when writing to folder shared with service account #687

Closed
andytheapedemontague opened this issue Dec 30, 2020 · 4 comments

Comments

@andytheapedemontague
Copy link

I have a folder in my Google Drive which I have shared with a service account as Editor.

Mounted like so:

google-drive-ocamlfuse -serviceaccountpath key.json -serviceaccountuser xxxxxxxx-compute@developer.gserviceaccount.com /tmp/googledrive

Read operations work fine.

My problem is that write operations always fail with "Permission denied".

/tmp/googledrive/.shared/shared_folder$ ls
bar.txt
/tmp/googledrive/.shared/shared_folder$ cp bar.txt foo.txt
cp: cannot create regular file 'foo.txt': Permission denied

-debug logs show nothing insightful:

[1779.889564] TID=301: fopen /.shared/shared_folder/bar.txt O_RDONLY
[1779.889573] TID=301: BEGIN: Getting metadata from context
[1779.889577] TID=301: END: Getting metadata: Valid
[1779.889582] TID=301: BEGIN: Loading resource /.shared/shared_folder/bar.txt (trashed=false) from db
[1779.889593] TID=301: END: Loading resource /.shared/shared_folder/bar.txt (trashed=false) from db: Found (id=897, state=ToDownload)
[1779.889671] TID=302: getattr /.shared/shared_folder/foo.txt
[1779.889679] TID=302: BEGIN: Getting metadata from context
[1779.889683] TID=302: END: Getting metadata: Valid
[1779.889687] TID=302: BEGIN: Loading resource /..shared/shared_folder/foo.txt (trashed=false) from db
[1779.889702] TID=302: END: Loading resource /.shared/shared_folder/foo.txt (trashed=false) from db: Found (id=901, state=NotFound)
[1779.889713] TID=302: File not found: stat /.shared/shared_folder/foo.txt
[1779.889763] TID=303: mknod /.shared/shared_folder/foo.txt 100755
[1779.889772] TID=303: Permission denied: mknod /.shared/shared_folder/foo.txt

Authenticating as myself everything works as expected.

Tried everything I could think of: root/non-root, different machines, checked scopes, checked share permissions...

Any ideas, or suggestions how to debug further?

@astrada astrada closed this as completed in 9084bdd Jan 5, 2021
@andytheapedemontague
Copy link
Author

Thanks for the quick fix @astrada I'll get some time to test that in the next few days.

@astrada
Copy link
Owner

astrada commented Jan 5, 2021

Sure, thanks! I'm publishing version 0.7.24 that should fix your issue. I wasn't allowing file/folder creation and renaming in the .shared folder to avoid accidentally messing with shared resources, but with service accounts I don't think there are other workarounds (like add to my drive).

@andytheapedemontague
Copy link
Author

Hi @astrada just confirming all working as expected with 0.7.24. Many thanks!

@anishjp
Copy link

anishjp commented Dec 25, 2023

@astrada This issue was also driving me nuts, spent a lot of time trying to figure out why can't the shared file be edited & saved. I wished I had visited this page earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants