Reputation: 11
I'm facing an issue with a deployment pipeline test in Laravel's Vapor named "Ensure Environment Is Healthy" that keeps failing. I'm relatively new to AWS, and the project was initially set up by someone else. I'm trying to navigate and understand where the issue could be coming from.
The last time of the project being deployed, six months ago, this pipeline test did not exist. It seems to have been added by AWS in the meantime, but I can't really find anything about it.
As you can see, failed "Ensure Environment Is Healthy" test. Locally, however, I have no problems at all. This is my vapor.yml file:
id: 29629
name: theprojectname
environments:
production:
memory: 1024
cli-memory: 512
runtime: 'php-8.0:al2'
storage: theprojectname-storage-production
database: theprojectname-production
build:
- 'COMPOSER_MIRROR_PATH_REPOS=1 composer install --no-dev'
- 'php artisan event:cache'
deploy:
- 'php artisan migrate --force'
staging:
memory: 1024
cli-memory: 512
runtime: 'php-8.0:al2'
storage: theprojectname-storage-staging
database: theprojectname-production
build:
- 'COMPOSER_MIRROR_PATH_REPOS=1 composer install --no-dev'
- 'php artisan event:cache'
deploy:
- 'php artisan migrate --force'
# - 'php artisan db:seed --force'
I'm happy if someone has the slightest idea how to fix this. I want to understand the test for this, be able to fix it or even at least disable it. Thank you everyone!
Upvotes: 1
Views: 972
Reputation: 1
When you get that message:
This is the check that is failing in the Vapor CLI: https://github.com/laravel/vapor-core/blob/157dcdf630891a87ad2a4687ed26604c10dbb64b/src/Console/Commands/VaporHealthCheckCommand.php#L10
Basically there are 2 checks there:
One of these is going wrong (in our case it was a custom Redis cache and some misconfiguration)
Upvotes: 0
Reputation: 11
If it helps anyone in the future. In the vapor.yml file, i changed the php runtime version from 8.0 to 8.2: runtime: 'php-8.2:al2'
. This solved it for me. This is my new vapor.yml file:
id: 29629 name: theprojectname environments: production: memory: 1024 cli-memory: 512 runtime: 'php-8.2:al2' storage: theprojectname-storage-production database: theprojectname-production build: - 'COMPOSER_MIRROR_PATH_REPOS=1 composer install --no-dev' - 'php artisan event:cache' deploy: - 'php artisan migrate --force' staging: memory: 1024 cli-memory: 512 runtime: 'php-8.2:al2' storage: theprojectname-storage-staging database: theprojectname-production build: - 'COMPOSER_MIRROR_PATH_REPOS=1 composer install --no-dev' - 'php artisan event:cache' deploy: - 'php artisan migrate --force' # - 'php artisan db:seed --force'
Upvotes: 0
Reputation: 1643
This is like timeout, but for Ensure Environment Is Healthy
i always look at CLI log errors, if you can find anything then by fixing it this issue will be solved.
About the changing timeout that did nothing, you need to keep in mind that Vapor has three lambda function, so if you had any errors you need to know which function you are in to check the logs. Because vapor has three lambda function for each one of them you can set different timeouts.
So if you increase the Http timeout it wont effect the cli function.
Upvotes: 0