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

err :: Script @auto-scripts was called via post-install-cmd #78

Open
Alexain opened this issue Oct 2, 2018 · 4 comments
Open

err :: Script @auto-scripts was called via post-install-cmd #78

Alexain opened this issue Oct 2, 2018 · 4 comments

Comments

@Alexain
Copy link

Alexain commented Oct 2, 2018

In Symfony 4.1.x when deploying the app, int "---> Installing Composer dependencies" section the scripts crash with this message:

| err :: Script @auto-scripts was called via post-install-cmd

Composer version is 1.7.2

@ferdynator
Copy link

Add this to your deploy configuration:

->composerInstallFlags('--prefer-dist --no-interaction --no-dev')

This will disable the --quiet flag from composer. Most likely something went wrong there with composer install

@kingchills
Copy link

If you remove the --quiet flag and there are package updates wouldn't this still cause it to fail?

@numediaweb
Copy link

numediaweb commented Jun 19, 2020

In my case it was due to .env file:

| err :: Executing script cache:clear [KO]
| err ::  [KO]
| err :: Script cache:clear returned with error code 255
| err :: !!  PHP Fatal error:  Uncaught Symfony\Component\Dotenv\Exception\PathException: Unable to read the "/var/www/project/releases/20200619075019/.env" environment file. in /var/www/project/releases/20200619075019/vendor/symfony/dotenv/Dotenv.php:510
| err :: !!  Stack trace:
| err :: !!  #0 /var/www/project/releases/20200619075019/vendor/symfony/dotenv/Dotenv.php(65): Symfony\Component\Dotenv\Dotenv->doLoad(false, Array)
| err :: !!  #1 /var/www/project/releases/20200619075019/vendor/symfony/dotenv/Dotenv.php(85): Symfony\Component\Dotenv\Dotenv->load('/var/www/bm-dok...')
| err :: !!  #2 /var/www/project/releases/20200619075019/config/bootstrap.php(17): Symfony\Component\Dotenv\Dotenv->loadEnv('/var/www/bm-dok...')
| err :: !!  #3 /var/www/project/releases/20200619075019/bin/console(30): require('/var/www/bm-dok...')
| err :: !!  #4 {main}
| err :: !!    thrown in /var/www/project/releases/20200619075019/vendor/symfony/dotenv/Dotenv.php on line 510
| err :: !!
| err :: Script @auto-scripts was called via post-install-cmd
[ERROR] Cancelling the deployment and reverting the changes

Fixed it by:


    /**
     * Executed just before doing the composer install, setting the permissions, installing assets, etc.
     */
    public function beforePreparing()
    {
        $this->runRemote('cp {{ deploy_dir }}/repo/.env {{ project_dir }}/.env');
        $this->runRemote('cp {{ deploy_dir }}/.env.prod {{ project_dir }}/.env.prod');
    }

@adxl
Copy link

adxl commented Jun 29, 2022

@numediaweb Hey, where did you exactly put the function beforePreparing() please ?

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

5 participants