Search code examples
amazon-web-servicesamazon-ec2aws-lambdaamazon-elastic-beanstalklaravel-vapor

Vapor Deployment Pipeline Test "Ensure Environment Is Healthy" Failing on AWS


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!

  • I tried in vapor.yml to increase the timeout time to a maximum, but it did nothing.
  • I searched AWS for possible error messages and found nothing.

Solution

  • 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'