0

I've been able to do this before so I know it works. In any case, I ran the command

sudo gcsfuse deduction3 /mnt/disks/temp_dir
Using mount point: /mnt/disks/temp_dir
Opening GCS connection...
Opening bucket...
Mounting file system...
File system has been successfully mounted.

I then ran

kylefoley@kfoley76:/mnt/disks/temp_dir$ ls

But nothing showed up. There are 3 files and one folder on that storage bucket.


UPDATE


I also tried running python's os.listdir(path) which is what I will be ultimately using anyway. But that ended up yielding nothing.

DuniX33
  • 20
  • 5
logic1976
  • 519
  • 1
  • 6
  • 19

2 Answers2

0

Try running this from the Cloud Shell to get bucket's privacy information:

gsutil acl get gs://$MY_BUCKET_NAME/some_file.jpg > acl.txt
cat acl.txt
DuniX33
  • 20
  • 5
  • I got the error message `kylefoley@kfoley76:~$ gsutil acl get gs://$deduction3/hey.py CommandException: "acl" command does not support provider-only URLs.` – logic1976 Jan 28 '20 at 12:34
  • To avoid this error use the name of the bucket instead of a variable (ie. gs://python-proj-bucket/hey.py , notice I took the $ out otherwise it will be interpreted as a variable ) or execute `export deduction3=real-buckets-name` – DuniX33 Jan 28 '20 at 13:06
  • Change directory [permissions](https://wiki.archlinux.org/index.php/File_permissions_and_attributes) to `chmod o+rx -R /mnt/disks/temp_dir3` in order to be able to get in and try again. – DuniX33 Jan 28 '20 at 14:15
  • Thanks, I'll let you know what happens 12 hours from now. I can't get to it now. – logic1976 Jan 28 '20 at 14:31
  • I'm going to see if python's `os.listdir(path)` can read the contents. If it can then the problem is solved. For now I'm still working on permission problems over here https://superuser.com/questions/1521031/cannot-get-access-to-directory-that-i-was-just-in-5-minutes-ago – logic1976 Jan 29 '20 at 06:20
  • Got the permissions problem solved but python's `os.listdir(path)` does not work and gsutil is giving the insufficient permission error even though I can enter that directory without problems. – logic1976 Jan 29 '20 at 07:37
  • Make sure you have the right [permissions](https://cloud.google.com/storage/docs/quickstart-gsutil#give_someone_access_to_your_bucket). Were you able to execute the acl command? You may check another possible solution [here](https://stackoverflow.com/questions/42630856/how-to-mount-google-bucket-as-local-disk-on-linux-instance-with-full-access-righ?rq=1). – DuniX33 Jan 29 '20 at 09:20
  • I solved the problem. I had to run `sudo chmod 777 /mnt/disks/temp_dir4` before mounting the storage bucket. – logic1976 Jan 29 '20 at 09:39
0

The mistake I was making was that the directory did not have sufficient permissions before I mounted it. By running sudo chmod 777 /mnt/disks/temp_dir4 before running gcsfuse I solved the problem.

logic1976
  • 519
  • 1
  • 6
  • 19