S3 Upload fail - Exception: BAD RESPONSE STATUS FROM API (0)

S3 upload has started to fail.

Log attached.

Hi @VK2XXY,

That is fails part-way through the deployment hints to me of some rate limit being hit. There shouldn’t be one on the S3 side, so possibly triggering something within your server or hosting provider?

You can try to generate the static site files and then use AWS’s CLI tool to aws s3 sync the files there.

If it were a rate limit of connection issue on the AWS side, I’d expect we’d see any other response code besides 0.

It could possibly be some other execution timeout setting being hit, say on your webserver, where PHP is OK to run the long-running process, but something other service fails to handle the request completely…

Thanks for the reply.

The server is self hosted at home. I recently changed to a 4G/LTE internet connection so there might be some lag there.

The server is an old notebook but I am moving to a Raspberry Pi soon so I’ll see what happens then.

Hi @VK2XXY,

I had similar issues a few years back, but think it was on fiber connection in Indonesia, which was otherwise fast. It may be down to how those ISPs are handling traffic.

One way to confirm if it’s your connection, is to spin up a quick VPS and clone your site there and repeat the process. You’ll only be charged cents on the hour, so can terminate it once done without incurring much cost.

If you can let me know if that’s confirmed, will be great. Then the 0 “return” status should probably turn into a more general Network unreachable or such error that can better guide users to troubleshooting.

If you can let me know if that’s confirmed, will be great. Then the 0 “return” status should probably turn into a more general Network unreachable or such error that can better guide users to troubleshooting.

It looks like my internet connection is the issue.

A VPS works fine with version 7.1.6.

Using 7.1.6 on my local WP gives me cURL errors.

I can try the local WP with a better connection but I would have to do it from the command line which I’m not sure of.

1 Like

I’m a bit out of touch with the deploy options we have in WP2Static right now, but I did implement a Deploy Delay, either in WP2Static or Static HTML Output plugin, which may help avoid such issues with frequent outgoing bandwidth to the same address causing issues with ISPs.

If that would work in this case and isn’t in the current deployment options, I can expose a new WordPress action after each file/batch is sent, simply telling it to sleep for a little while, you can then call that from your theme’s functions.php to enable/disable it.

Depending on whether it’s active filtering by the ISP or poor connectivity issues, running a VPN on your home machine may also help. Sometimes, the VPNs improve performance by compression and better routing, but can otherwise mask the traffic’s address from your ISP, which could be enough.

I like (but haven’t used in years), sshuttle, the “poor man’s VPN”. Basically, if you’ve got SSH access to a VPS, sshuttle will easily allow you to route all your local PC’s traffic through that while sshuttle is running.