elementor / wp2static-addon-s3

S3 deployment Add-on for WP2Static
The Unlicense
35 stars 23 forks source link

catch S3Exception ie for DNS/connectivity issues #38

Closed leonstafford closed 2 years ago

leonstafford commented 3 years ago

some issues within Docker container, perhaps specific to certain host networks:

2020/12/06 04:46:23 [error] 71#71: *38 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught exception 'Aws\S3\Exception\S3Exception' with message 'Error executing "PutObject" on "https://s3.amazonaws.com/thisguyblogs.com/robots.txt"; AWS HTTP error: cURL error 6: Could not resolve host: s3.amazonaws.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://s3.amazonaws.com/thisguyblogs.com/robots.txt'

GuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: s3.amazonaws.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://s3.amazonaws.com/thisguyblogs.com/robots.txt in /usr/html/wp-content/plugins/wp2static/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:210
Stack trace:
#0 /usr/html/wp-content/plugins/wp2static/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(158): GuzzleHttp\Handler\CurlFactory::createRejection()
#1 /usr/html/wp-content/plugins/wp2static/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(110): GuzzleHttp\Handler\CurlFactory::finishError()
#2 /usr/html/wp-content/plugins/w" while reading response header from upstream, client: 172.17.0.1, server: , request: "POST /wp-admin/admin-ajax.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php8-fpm.sock:", host: "localhost:4338", referrer: "http://localhost:4338/wp-admin/admin.php?page=wp2static"

throws 500 back to user, should catch and show/log actual message