tarbell-project / tarbell

A Flask-based static site authoring tool.
https://tarbell.readthedocs.io/en/latest/index.html
BSD 3-Clause "New" or "Revised" License
165 stars 32 forks source link

Problem with S3 deployment - "S3ResponseError: 301 Moved Permanently" #458

Closed sergiospagnuolo closed 6 years ago

sergiospagnuolo commented 6 years ago

I can't deploy a Tarbell project for some reason.

Using default bucket credentials
Error: S3 error! See below:
S3ResponseError: 301 Moved Permanently

I saw something like this on #306 but honestly didn't find a proper solution. I am running Python 2.7.14 and Tarbell 1.0.10

eyeseast commented 6 years ago

Sounds like this may be more an S3 problem than a Tarbell problem. I've never gotten a 301 redirect from S3 before. Here's a quick way to isolate the problem:

First, install aws-cli. Then generate your site to a local folder and try to upload it.

tarbell generate _site
aws s3 sync _site s3://bucket/path

That will create a folder called _site in your project directory. Your fully baked project should be there, which you can serve by running:

cd _site
python -m SimpleHTTPServer

See if that works. If you can generate the site but S3 fails, check your AWS settings and make sure your bucket name is right.

AWS CLI S3 docs: https://docs.aws.amazon.com/cli/latest/reference/s3/

sergiospagnuolo commented 6 years ago

thanks @eyeseast this is a cool solution, and it worked for that matter, but it does not sync as it should as the original AWS solution. Sure, I can apply Fabric to it, but I wonder if I really have to. Thanks anyway for the help, in any case, I will use this with Fabric until I figure out how to fix that.

sergiospagnuolo commented 6 years ago

just figured it out @eyeseast - changed the name of the bucket to one without a dot "." into it. go figure