500 server error after a few day

I have a very strange issue on one of my sites: https://construction-expert.com

I’m using Trellis on DO with a standard setup. Every 3-5 days the site starts showing 500 error. When it shows this error, I cannot reach the site or the dashboard.

In the past, I’ve tried (nothing worked):

  • Redeploying
  • Re-provisioning the server
  • Creating a new server instance
  • Removing the autoptimize plugin which was the only change since this issue started occurring
  • Reverting to an older commit when I knew everything was working

The fix that I’m using now is to load the development database onto production every few days when the 500 error returns.

A strange point regarding this fix is that if I re-import the previous development db export it doesn’t work. Every time I need to generate a new development db export.

Another strange point, if I export the production DB during the 500 error and import into development, it works fine on development.

The development site is functioning without issue.

Any ideas on what this could be?

What’s in the error log? Look in /srv/www/example.com/logs

3 Likes

Error log:

root@DO-ConstructionExpert:/srv/www/construction-expert.com/logs# tail error.log
2017/06/15 17:04:27 [error] 11968#11968: *26535 FastCGI sent in stderr: "PHP message: PHP Warning:  is_readable(): open_basedir restriction in effect. File(/home/web/.aws/credentials) is not within the allowed path(s): (/srv/www/:/tmp) in /srv/www/construction-expert.com/releases/20170615164852/web/app/plugins/s3-uploads/lib/aws-sdk/Aws/Credentials/CredentialProvider.php on line 267
PHP message: PHP Fatal error:  Uncaught Aws\Exception\CredentialsException: Error retrieving credentials from the instance profile metadata server. (Client error: `GET http://169.254.169.254/latest/meta-data/iam/security-credentials/` resulted in a `404 Not Found` response:
not found
) in /srv/www/construction-expert.com/releases/20170615164852/web/app/plugins/s3-uploads/lib/aws-sdk/Aws/Credentials/InstanceProfileProvider.php:79
Stack trace:
#0 /srv/www/construction-expert.com/releases/20170615164852/web/app/plugins/s3-uploads/lib/aws-sdk/GuzzleHttp/Promise/Promise.php(201): Aws\Credentials\InstanceProfileProvider->Aws\Credentials\{closure}(Object(GuzzleHttp\Exception\ClientException))
#1 /srv/www/construction-expert.com/releases/20170615164852/web/app/plugins/s3-uploads/lib/aws-sdk/GuzzleHttp/Promise/Promise.php(154): GuzzleHttp\Promise\Promise::callHandler(2, Array, Array)
#2 /srv/www/construction-expert.com/releases/20170615164852/web/app/plugins/s3-uploads/lib/aws-sdk/GuzzleHttp/Promise/TaskQueue.php(" while reading response header from upstream, client: 84.10.94.205, server: construction-expert.com, request: "GET /wp-login.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "construction-expert.com"
2017/06/15 17:06:30 [error] 11968#11968: *26544 open() "/srv/www/construction-expert.com/current/web/favicon.ico" failed (2: No such file or directory), client: 152.3.34.3, server: construction-expert.com, request: "GET /favicon.ico HTTP/2.0", host: "construction-expert.com", referrer: "https://construction-expert.com/"
2017/06/15 17:11:22 [error] 11968#11968: *26556 open() "/srv/www/construction-expert.com/current/web/favicon.ico" failed (2: No such file or directory), client: 54.89.92.4, server: construction-expert.com, request: "GET /favicon.ico HTTP/1.1", host: "construction-expert.com", referrer: "https://slack.com"

Access log:

root@DO-ConstructionExpert:/srv/www/construction-expert.com/logs# tail access.log
152.3.34.3 - - [15/Jun/2017:17:10:35 +0000] "GET /app/themes/Avada/assets/min/js/general/avada-drop-down.js HTTP/2.0" 200 1234 "https://construction-expert.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36" "-"
152.3.34.3 - - [15/Jun/2017:17:10:35 +0000] "GET /app/themes/Avada/assets/min/js/general/avada-mobile-image-hover.js HTTP/2.0" 200 591 "https://construction-expert.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36" "-"
152.3.34.3 - - [15/Jun/2017:17:10:35 +0000] "GET /app/themes/Avada/assets/min/js/general/avada-gravity-forms.js HTTP/2.0" 200 956 "https://construction-expert.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36" "-"
152.3.34.3 - - [15/Jun/2017:17:10:35 +0000] "GET /app/themes/Avada/assets/min/js/library/jquery.elasticslider.js HTTP/2.0" 200 1963 "https://construction-expert.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36" "-"
152.3.34.3 - - [15/Jun/2017:17:10:35 +0000] "GET /app/themes/Avada/assets/min/js/general/avada-elastic-slider.js HTTP/2.0" 200 554 "https://construction-expert.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36" "-"
152.3.34.3 - - [15/Jun/2017:17:10:35 +0000] "GET /app/plugins/fusion-core/js/min/avada-fusion-slider.js HTTP/2.0" 200 4365 "https://construction-expert.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36" "-"
152.3.34.3 - - [15/Jun/2017:17:10:35 +0000] "GET /wp/wp-includes/js/wp-embed.min.js HTTP/2.0" 200 1086 "https://construction-expert.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36" "-"
54.89.92.4 - - [15/Jun/2017:17:11:21 +0000] "GET / HTTP/1.1" 200 53649 "-" "Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots)" "-"
54.174.33.17 - - [15/Jun/2017:17:11:21 +0000] "GET /wp-json/oembed/1.0/embed?url=https%3A%2F%2Fconstruction-expert.com%2F&maxheight=150 HTTP/1.1" 200 1117 "-" "Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots)" "-"
54.89.92.4 - - [15/Jun/2017:17:11:22 +0000] "GET /favicon.ico HTTP/1.1" 404 162 "https://slack.com" "Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots)" "-"

There’s your error :slight_smile: