Reputation: 48818
I've been developing Laravel app and deploying regularly to an Elastic Beanstalk instance without issue, but suddenly, and without warning, deployments have begun to fail.
Obviously I immediately wondered what I might have changed in the code to cause this, but I haven't made any changes to the core configuration. I rolled back to an earlier commit just to make sure it wasn't my code, and I got the same error.
It's failing after I run eb deploy
and running the .ebextensions
configs.
Here's the error message from the logs:
[2018-01-08T10:50:34.672Z] INFO [9457] : Running 4 of 5 actions: EbExtensionPostBuild...
[2018-01-08T10:50:35.523Z] ERROR [9457] : Command execution failed: Activity failed. (ElasticBeanstalk::ActivityFatalError) caused by:
In Connection.php line 664:
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = custom and table_name
= migrations)
In Connector.php line 67:
SQLSTATE[HY000] [2002] Connection refused
(ElasticBeanstalk::ExternalInvocationError)
The DB connection credentials are absolutely correct (and haven't changed either).
The command that it's attempting when it fails is simply:
php artisan migrate --force
I've tried connecting over SSH to the server, and I can manually run the same command without issue.
I just can't understand why the deployment is suddenly having its connection refused. Could it be something to do with the AWS security configuration? Could it expire or something? :-/
Upvotes: 1
Views: 2075
Reputation: 48818
It turns out the issue was caused by local settings becoming cached and then deployed to the server in: bootstrap/cache/config.php
.
Clearing the cache with php artisan config:clear
deleted the file and solved the problem.
Upvotes: 3