GCP Error 301 Moved Permanently error while trying to access a directory path on google cloud storage

0 votes
Accessing a directory path returns an empty object and a 301 HTTP response code.
Oct 9, 2019 in GCP by Sam
• 6,260 points
1,369 views

1 answer to this question.

0 votes

If your browser downloads a zero byte object and you get a 301 HTTP response code when accessing a directory, such as http://www.example.com/dir/, your bucket most likely contains an empty object of that name. 

To check that this is the case and fix the issue:

  1. Open the Cloud Storage browser in the Google Cloud Platform Console.

  2. Click the Activate Cloud Shell button at the top of the Google Cloud Platform Console. 

  3. Run gsutil ls -R gs://www.example.com/dir/. If the output includes http://www.example.com/dir/, you have an empty object at that location.

  4. Remove the empty object with the command: gsutil rm gs://www.example.com/dir/

You can now access http://www.example.com/dir/  and have it return that directory's index.html file instead of the empty object.

Hope it works!!

If you want to become a professional Google Cloud Architect, Its recommended to go for the certification course first.

Thanks!

answered Oct 9, 2019 by Sirajul
• 59,230 points

Related Questions In GCP

0 votes
1 answer

Access not configured Error while trying to use Cloud DNS.

This might be probably because you wouldn't ...READ MORE

answered Oct 10, 2019 in GCP by Sirajul
• 59,230 points
775 views
0 votes
1 answer

Can I give a user access to cloud storage who doesn't have a GCP account?

Yes, you could certainly do this.  You can ...READ MORE

answered Nov 5, 2019 in GCP by Sirajul
• 59,230 points
1,033 views
0 votes
1 answer

GCP Error : 409 "duplicate" while trying to create a table.

This error returns when trying to create ...READ MORE

answered Nov 20, 2019 in GCP by Sirajul
• 59,230 points
2,906 views
0 votes
1 answer

GCP Error: 403: Access Denied

Check that your credentials are correct. For ...READ MORE

answered Oct 9, 2019 in GCP by Sirajul
• 59,230 points
4,007 views
0 votes
1 answer

Permissions issue with Google Cloud Storage Bucket.

You can regain access to the object by assigning an applicable role, like roles/storage.objectAdmin, to ...READ MORE

answered Oct 10, 2019 in GCP by Sirajul
• 59,230 points
4,945 views
0 votes
1 answer
0 votes
1 answer

How to create a Google Cloud Filestore instance?

Create an instance by running the instances create command, ...READ MORE

answered Oct 23, 2019 in GCP by Sirajul
• 59,230 points
1,731 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP