Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downtime during deployment. Missing Composer autoload file. Failed to open stream: No such file or directory #3767

Open
farrance opened this issue Jan 15, 2024 · 0 comments

Comments

@farrance
Copy link

  • Deployer version: deployer/deployer": "^7.3
  • Deployment OS: Ubuntu 20.04.6 LTS
import:
  - recipe/deploy/cleanup.php
  - recipe/laravel.php
  - contrib/npm.php

config:
  keep_releases: 5
  application: '{My application name}'
  repository: '{My private repo}'
  base_deploy_path: '/var/www'
  remote_user: ubuntu
  identity_file: '{My key}'
  become: 'root'

hosts:
  production:
    deploy_path: '{{base_deploy_path}}/{My web site}'
    hostname: '{My IP}'
    port: {My port}

tasks:
  deploy:
    - deploy:prepare
    - deploy:vendors
    - deploy:unlock

after:
  deploy:failed:
    - deploy:unlock
  deploy:update_code:
    - npm:install
  npm:install:
    - npm:build

My project takes a few minutes to deploy. During this period the whole site goes down. I checked the Nginx error logs and it seems my autoload.php for Composer goes missing during the deployment. The deployment itself is successful and will come back online once completed.

2024/01/09 16:20:37 [error] 1217744#1217744: *201 FastCGI sent in stderr: "PHP message: PHP Warning: require(/var/www/{My web site}/releases/15/public/../vendor/autoload.php): Failed to open stream: No such file or directory in /var/www/{My web site}/releases/15/public/index.php on line 34PHP message: PHP Fatal error: Uncaught Error: Failed opening required '/var/www/{My web site}/releases/15/public/../vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/{My web site}/releases/15/public/index.php:34

Stack trace:
#0 {main}

thrown in /var/www/{My web site}/releases/15/public/index.php on line 34" while reading response header from upstream, client: 51.155.34.90, server: {Any sub domain}.{My web site}.net, request: "GET /{My web site}/{Any web page} HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: "{Any sub domain}.{My web site}.net", referrer: "{Any sub domain}.{My web site}.net"

{Curly brackets} omitted for sensitivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant