Symfony Console Commands

Keep on Learning!

If you liked what you've learned so far, dive in!
Subscribe to get access to this tutorial plus
video, code and script downloads.

Start your All-Access Pass
Buy just this tutorial for $10.00

The project is working! Except... that it's not actually our project: this is the Symfony Standard Edition. Our cow customers are waiting: let's install MooTube!

Head over to https://github.com/knpuniversity/ansible to find the code behind this project. Copy the clone URL and open your editor. Find the spot where we clone the repo and use our new URL:

---
- hosts: vb
... lines 3 - 9
tasks:
... lines 11 - 119
- name: Checkout Git repository
git:
repo: https://github.com/knpuniversity/ansible.git
... lines 123 - 163

You know the drill: run the playbook!

ansible-playbook ansible/playbook.yml -i ansible/hosts.ini

Our repository is public... which makes life easy. If you have a private repository, you'll need to make sure that your server has access to it. They talk about that a bit in the git module docs. You can also use a deploy key.

Using the Console

Once we have the code, we need to setup a few other things, like the database. The README.md file talks about these: after you download the composer dependencies, you can set up the database by running these three commands. Each runs through Symfony's console: an executable file in the bin/ directory.

This is a perfect situation for the command module... because... well, we literally just need to run 3 commands. Head to your playbook. Right above the handlers, add a comment: "Symfony Console Commands". We'll start with a task called "Create DB if not exists":

---
- hosts: vb
... lines 3 - 10
tasks:
... lines 12 - 151
# Symfony console commands
- name: Create DB if not exists
... lines 154 - 174

Use the command module. For the value... we need to know the path to that bin/console file.

This is another good spot for a variable! Create a new one called symfony_console_path set to {{ symfony_root_dir }}/bin/console:

---
- hosts: vb
vars:
... line 5
symfony_root_dir: /var/www/project
... lines 7 - 8
symfony_console_path: "{{ symfony_root_dir }}/bin/console"
... lines 10 - 174

Use that in the command: {{ symfony_console_path }} doctrine:database:create --if-not-exists:

---
- hosts: vb
... lines 3 - 10
tasks:
... lines 12 - 151
# Symfony console commands
- name: Create DB if not exists
command: '{{ symfony_console_path }} doctrine:database:create --if-not-exists'
... lines 155 - 174

That last flag prevents an error if the database is already there.

Awesome! Copy that task to create the second one: "Execute migrations". Use doctrine:migrations:migrate --no-interaction:

---
- hosts: vb
... lines 3 - 10
tasks:
... lines 12 - 151
# Symfony console commands
- name: Create DB if not exists
command: '{{ symfony_console_path }} doctrine:database:create --if-not-exists'
- name: Execute migrations
command: '{{ symfony_console_path }} doctrine:migrations:migrate --no-interaction'
... lines 158 - 174

And add one more: "Load data fixtures". This is something that we only want to run if this is a development machine, because it resets the database. We'll talk about controlling that later.

For this command, use hautelook_alice:doctrine:fixtures:load --no-interaction:

---
- hosts: vb
... lines 3 - 10
tasks:
... lines 12 - 151
# Symfony console commands
- name: Create DB if not exists
command: '{{ symfony_console_path }} doctrine:database:create --if-not-exists'
- name: Execute migrations
command: '{{ symfony_console_path }} doctrine:migrations:migrate --no-interaction'
- name: Load data fixtures
command: '{{ symfony_console_path }} hautelook_alice:doctrine:fixtures:load --no-interaction'
... lines 161 - 174

Ok! The 3 commands are ready! Head back to the terminal. Woh! It exploded!

And actually... the reason is not that important: it says an error occurred during the cache:clear --no-warmup command. After we run composer install, Symfony runs several post install commands. One clears the cache. Changing from one project to an entirely different project temporarily put things in a weird state. This one time, in the virtual machine, just remove the cache manually:

rm -rf var/cache/*

Try the playbook now:

ansible-playbook ansible/playbook.yml -i ansible/hosts.ini

This time composer install should work and hopefully our new commands will setup the database. By the way! A Symfony 3 app reads its configuration from a parameters.yml file... which is not committed to the repository. So... in theory, that file should not yet exist... and none of this should work. But that file does exist! Why? Thanks to a special line in composer.json, after composer install finishes, the parameters.yml.dist file is copied to parameters.yml. And thanks to that dist file, Symfony will try to connect to MySQL using the root user and no password. If that's not right, just modify the file on the VM directly for now. Later, we'll talk about how we could properly update this file.

Yes! It worked! Notice: the three new tasks all say changed. That's because the command module isn't smart enough to know whether or not these actually changed anything. But, more on that soon!

Find your browser and refresh! Welcome to MooTube! The fact that it's showing these videos means our database is working. Now, let's talk about tags: a cool way to help us run only part of our playbook.

Leave a comment!

  • 2020-05-12 weaverryan

    Hey @Sayil!

    > I noticed that some of them changed after running the playbook so I changed them in the playbook before creating the DB but nothing.

    I wonder what happens if you ssh into your machine, check the permissions, run chmod -R 777 and then check the permissions immediately after. You may notice that even this seems to *not* change the permissions. In that case, I would *really* think that you are hitting a permissions issue because the directory is a "network" directory. It might help you dig ;).

    Cheers!

  • 2020-05-09 Sayil

    Hi Ryan,

    Thank you for your answer.
    Yes, I can run the the php bin/console doctrine:database:create when I ssh into the VM. This was the only way of creating the DB and continue with the tutorial.
    Yes, I checked again and it is the same user, in my case vagrant user.
    When I ssh into the VM I am able tu run the two commands you suggested without any problems.
    I played with the permissions of most files in the VM ans still nothing. I noticed that some of them changed after running the playbook so I changed them in the playbook before creating the DB but nothing.
    I will keep looking for the answer and let you know if I find anything.
    Thanks for all the support!
    Cheers.

  • 2020-05-04 weaverryan

    Hey @Sayil!

    Hmm, this is trick! I have 2 questions/comments:

    1) If you SSH into the machine, are you able to run the php bin/console doctrine:database:create? I think the answer is yes (you said so in your previous comment) but I wanted to be absolutely sure :).

    2) Are you using the same SSH user for your Ansible script as when you SSH in manually? Again, my guess is "Yes", but I wanted to check ;).

    3) Are you able to, for example, do tasks that look like this in ansible?


    # this would prove whether or not you can call PHP
    php -v

    # this would prove that you can "read" the bin/console file
    cat bin/console

    4) Finally, while I can't explain why you can ssh in and run the command but Ansible cannot, one thing that *could* be affecting the permissions are network mounts. If your project directory is shared between your host and guest machine, then sometimes setting permissions in your VM is strange... because the file actually exists on your host machine (and is mounted as a network mount inside your VM). It's just something to keep in mind.

    Let me know if you find anything! Good luck!

    Cheers!

  • 2020-04-30 Sayil

    Hi Victor,

    I create the database with the exact same command from inside the VM, "php bin/console doctrine:database:create". That's why I don't understand what is hapening when I try to create it with the playbook.

    After I yhe task to change permissions I still have 777 so I don't understand.
    Any ideas?

    Thanks in advance!

  • 2020-04-29 Victor Bocharsky

    Hey Sayil,

    Hm, how do you create DB when you ssh-ed into the VM? Did you use "mysql" or "bin/console doctrine:database:create" command? It makes me think that probably you your DB credentials are incorrect? So, you don't have permissions to create DB, not execute that bin/console. Please, double check that you set DB permissions correctly for your VM machine

    Cheers!

  • 2020-04-29 Victor Bocharsky

    Hey Sayil,

    OK, and it still does not work? I'd recommend you to use file module instead: https://docs.ansible.com/an... - see examples below how to change permissions.

    So, it's weird as for me, if you set 777 it should just work. Could you double check it has 777 after this task?

    Cheers!

  • 2020-04-28 Sayil

    I also added a task before the DB is created to make sure that bin/console has permissions, looks like this:




    - name: Fix permission to create database
    become: true
    shell: 'chmod 0777 /var/www/project/bin/console'


  • 2020-04-28 Sayil

    Hi Victor,
    thanks for answering.

    I checked my permissions and changed the bin/console ones. I still have the same problem but a bit different. Now this is the result I am getting:


    TASK [Create DB if not exists] ************************************************************************************************************************************************************************************************
    fatal: [192.168.33.11]: FAILED! => {"changed": false, "cmd": "/var/www/project php bin/console doctrine:database:create --if-not-exists", "msg": "[Errno 13] Permission denied", "rc": 13}

    It does not show where the permissions where denied like in the first message. Which permissions should I change?
    When I ssh into the VM I can create the DB with the vagrant user and without using sudo.
    I changed all the permissions in /var/www/project to try to find the solution but I still get the same message.

    What am I missing here? Any Ideas?
    I also added the php before the bin/console but still no.

  • 2020-04-27 Victor Bocharsky

    Hey Sayil,

    Hm, could you check its permissions? Most probably you don't have executable permissions on it. Also, are you sure the user is the same and you run it without sudo when ssh-ed to the server?

    Btw, you can try to add php in front of the command, it might help. Or, just simply try to set permissions that allows execution.

    I hope this helps!

    Cheers!

  • 2020-04-23 Sayil

    Hi guys,
    I am having some problems when trying to create the DB from the playbook.

    TASK [Create DB if not exists] ************************************************************************************************************************************************************************************************
    fatal: [192.168.33.11]: FAILED! => {"changed": false, "cmd": "/var/www/project/bin/console doctrine:database:create --if-not-exists", "msg": "[Errno 13] Permission denied: b'/var/www/project/bin/console'", "rc": 13}

    My .env is fine and when I ssh to the VM I can create the DB manually but with the playbook it seems quite difficult.

    Why does it work when I ssh to the VM but not over the playbook? I am supposed to be the same user!

  • 2020-02-26 weaverryan

    Hey dhruv sahu!

    Hmm, it looks like your database password is incorrect for your database:

    > Access denied for user 'root'@'localhost'

    This is happening when you're running bin/console doctrine:database:create. Have you configured your database credentials in .env (or parameters.yml, depending on your Symfony version) before you've run this command?

    Cheers!

  • 2020-02-26 dhruv sahu

    no nothing worked

  • 2020-02-26 dhruv sahu

    a new error occured after i installed composer dependencies.

  • 2020-02-26 dhruv sahu

    thanks

  • 2020-02-26 dhruv sahu

    fatal: [127.0.0.1]: FAILED! => {"changed": true, "cmd": ["/var/www/project/bin/console", "--if-not-exists", "doctrine:database:create"], "delta": "0:00:00.120540", "end": "2020-02-26 16:37:40.124195", "msg": "non-zero return code", "rc": 1, "start": "2020-02-26 16:37:40.003655", "stderr": "\nIn AbstractMySQLDriver.php line 115:\n \n An exception occured in driver: SQLSTATE[HY000] [1698] Access denied for us \n er 'root'@'localhost' \n \n\nIn PDOConnection.php line 47:\n \n SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' \n \n\nIn PDOConnection.php line 43:\n \n SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' \n \n\ndoctrine:database:create [--shard SHARD] [--connection [CONNECTION]] [--if-not-exists] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>", "stderr_lines": ["", "In AbstractMySQLDriver.php line 115:", " ", " An exception occured in driver: SQLSTATE[HY000] [1698] Access denied for us ", " er 'root'@'localhost' ", " ", "", "In PDOConnection.php line 47:", " ", " SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' ", " ", "", "In PDOConnection.php line 43:", " ", " SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' ", " ", "", "doctrine:database:create [--shard SHARD] [--connection [CONNECTION]] [--if-not-exists] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>"], "stdout": "", "stdout_lines": []}
    ____________

  • 2020-02-24 Victor Bocharsky

    Hey dhruv,

    From the output, I see the problem is that you don't have Composer dependencies installed. Please, make sure you run "composer install" first before calling any Symfony console commands.

    I hope this helps!

    Cheers!

  • 2020-02-24 Victor Bocharsky

    Hey dhruv,

    Sorry, but what error exactly are you talking about? Could you give us a bit more context, please?

    Cheers!

  • 2020-02-24 Victor Bocharsky

    He ydhruv,

    Hm, this sounds like indentation problems, no? Anyway, were you able to fix this yourself? Quotes helped you?

    Cheers!

  • 2020-02-22 dhruv sahu

    ERROR! Syntax Error while loading YAML.
    mapping values are not allowed in this context

    The error appears to be in '/etc/ansible/playbook.yml': line 114, column 16, but may
    be elsewhere in the file depending on the exact syntax problem.

    The offending line appears to be:

    - name: Create DB if not exists
    command: "{{ symfony_console_path }} doctrine:database:create --if-not-exists"
    ^ here
    We could be wrong, but this one looks like it might be an issue with
    missing quotes. Always quote template expression brackets when they
    start a value. For instance:

    with_items:
    - {{ foo }}

    Should be written as:

    with_items:
    - "{{ foo }}"

  • 2020-02-22 dhruv sahu

    please rectify this error

  • 2020-02-22 dhruv sahu

    fatal: [127.0.0.1]: FAILED! => {"changed": true, "cmd": ["/var/www/project/bin/console", "doctrine:database:create", "--if-not-exists"], "delta": "0:00:00.024293", "end": "2020-02-22 12:08:42.155989", "msg": "non-zero return code", "rc": 255, "start": "2020-02-22 12:08:42.131696", "stderr": "PHP Warning: require(/var/www/project/app/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/project/app/autoload.php on line 9\nPHP Fatal error: require(): Failed opening required '/var/www/project/app/../vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/project/app/autoload.php on line 9", "stderr_lines": ["PHP Warning: require(/var/www/project/app/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/project/app/autoload.php on line 9", "PHP Fatal error: require(): Failed opening required '/var/www/project/app/../vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/project/app/autoload.php on line 9"], "stdout": "", "stdout_lines": []}

  • 2019-01-02 Victor Bocharsky

    You're welcome! Glad you've figured it out.

    Cheers!

  • 2019-01-02 Emin

    Hey Victor,

    Aah i see now i get it thank man! :)

    Cheers!

  • 2019-01-02 Victor Bocharsky

    Hey Emin,

    I suppose you mean this step:


    - name: Create project directory and set its permissions
    become: true
    file:
    path: "{{ symfony_root_dir }}"
    state: directory
    owner: "{{ ansible_user }}"
    group: "{{ ansible_user }}"
    recurse: yes

    If so - the answer is no, you don't need to delete the /var/www/project/ directory on each run, because in this step Ansible whether create this folder of it does not exist or just skip this step if it's already created. So, it's like Ansible just make sure that this folder always exists and have proper owner/group permissions and that's it.

    Cheers!

  • 2019-01-02 Emin

    Hey Victor,
    What i mean is do i need to delete the whole /var/www/project map in the way that the path needs to be created again or only in the project file.

  • 2018-12-31 Victor Bocharsky

    Hey Emin,

    Could you clarify what are you trying to do, please? It depends on what you need.

    Cheers!

  • 2018-12-28 Emin

    Hey Victor,

    Yes thank you for the fast reply now i understand it better but for this to work do i delete it al they to /var/ or only stuff inside /var/www/project?

    Cheers!

  • 2018-12-28 Victor Bocharsky

    Hey Emin,

    You need to specify the full path to the directories / files, because each Ansible command is isolated, so if you change the dir in one step, in another step your command still will be executed in the home directory. So, Ansible do not understand the "project" and each step starts from the home directory. But each step may have "args" option where you can change dir with "chdir" sub-option, then, in the module, you can specify a path relative to the changed dir. See examples for "command" module: https://docs.ansible.com/an...

    Cheers!

  • 2018-12-28 Emin

    Wait do you need the directory's all the way to var or just the file inside project?
    I'm quite confused.

  • 2018-05-08 Victor Bocharsky

    Hey toporovvv ,

    Thanks for sharing your solution with others!

    Cheers!

  • 2018-05-07 toporovvv

    If you face a problem "There are no commands defined in the \"doctrine:migrations\" namespace. \n Did you mean one of these?", whick I and Евгений Явгель got after a first playbook execution in this tutorial, you need to delete /var/www/project folder. Because, I suppose, Ansible do not clean it after a changing repo path in a "Checkout Git repository" task. An after that I hadn't any issues with cache - just a proper look of MooTube on url http://mootube.l/

  • 2018-04-23 Victor Bocharsky

    Hey Dayron,

    Hm, that's a bit weird that you have to restart the host, clearing the cache should be enough. But I'm glad you solved it! And thanks for sharing your solution with other users

    Cheers!

  • 2018-04-20 Dayron Gallardo

    The only thing that helped me was restart the host.

  • 2018-04-20 Dayron Gallardo

    I'm getting this error -> There are no commands defined in the "doctrine:migrations" :(

  • 2018-01-29 Victor Bocharsky

    Hey Juan,

    Hm, I think the problem is that Nginx config works for web interface only, i.e. when you open your website in the browser. But when you run console commands - your Nginx config is pointless in this case, because, you know, console commands does not interact with Nginx at all. So you need to export those variables in console before executing any Symfony commands. For example, you need to do:


    $ export DATABASE_URL= mysql://db_user:db_password@127.0.0.1:3306/db_name"

    *before* that "Create DB if not exists" task. But since we're talking about Ansible, you can easily export env vars in your playbook, see "Setting an env var" here: https://knpuniversity.com/s... . You can try it and I bet it will solve the error. I also suppose you need to export all the remaining variables as well, i.e. all the env vars you've put in Nginx config.

    Cheers!

  • 2018-01-28 Juan Luis Garcia

    Hi guys!

    I'm passing my ansible playbook with symfony3 to symfony4 (flex), but I'm to stuck in Create DB if not exists task.


    - name: Create DB if not exists
    command: '{{ symfony_console_path }} doctrine:database:create --if-not-exists'
    register: db_create_result
    changed_when: "not db_create_result.stdout|search('already exists. Skipped.')"

    With symfony flex I put the old parameters.yml with environment into nginx conf:


    #NGINX
    #https://symfony.com/doc/current/configuration/external_parameters.html#configuring-environment-variables-in-production

    fastcgi_param DATABASE_URL "mysql://db_user:db_password@127.0.0.1:3306/db_name";

    When I run my playbook return

    fatal: [34.243.245.12]: FAILED! => {"changed": true, "cmd": ["/var/www/project/bin/console", "doctrine:database:create", "--if-not-exists"], "delta": "0:00:00.083435", "end": "2018-01-28 18:31:31.785378", "msg": "non-zero return code", "rc": 1, "start": "2018-01-28 18:31:31.701943", "stderr": "\nIn CreateDatabaseDoctrineCommand.php line 93:\n \n Connection does not contain a 'path' or 'dbname' parameter and cannot be dr \n opped. \n \n\ndoctrine:database:create [--shard SHARD] [--connection [CONNECTION]] [--if-not-exists] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>", "stderr_lines": ["", "In CreateDatabaseDoctrineCommand.php line 93:", " ", " Connection does not contain a 'path' or 'dbname' parameter and cannot be dr ", " opped. ", " ", "", "doctrine:database:create [--shard SHARD] [--connection [CONNECTION]] [--if-not-exists] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>"], "stdout": "", "stdout_lines": []}

    can you help me?
    Thanks guys!

  • 2017-06-14 mlavrik

    Thanks! Adding version parameter helps.

  • 2017-06-06 Victor Bocharsky

    Hey mlavrik ,

    It's weird enough. Did you change the repo link to another repository? I think pointing the version could fix it. Try:


    - name: Checkout Git repository
    git:
    repo: https://github.com/knpuniversity/ansible.git
    dest: "{{ symfony_root_dir }}"
    force: yes
    version: master

    Where "master" is a branch which you want to checkout.

    If it doesn't help, please, try to connect to the remove host manually ("vagrant ssh" if you're using VM) and drop the repository folder at all with "rm -rf" command. Then run the playbook - Ansible try to pull the whole repo again without problem I think.

    Cheers!

  • 2017-06-05 mlavrik

    Hello guys. Problem with git checkout task. After changing repo url it fails with message "Could not determine remote revision for HEAD". Debug log - https://pastebin.com/DdF49Hqm

    What could be the reason?
    Thanks!

  • 2017-05-28 zacball

    Just blow out your projects dir in the VM and re-run Ansible. Ansible isnt actually pulling the new project files in. You can see that by looking at app/AppKernel.php. The migrations and haute bundles arent even registered because you still have the symfony standard code. Once you blow out the project dir it'll see the change, pull the new code and Composer will install the new packages.

  • 2017-05-24 Victor Bocharsky

    Hey Евгений,

    Don't you forget to run "composer update" after changing the composer.json file? Because if you change composer.json manually - then you still have outdated composer.lock file, so running "composer install" has no effect.

    Maybe there's a difference between versions. Could you try to install the latest version of it? To install and enable the latest version correctly you may follow the installation guide here: https://symfony.com/doc/cur... . And also try to clear the cache and run this command directly on your VM first.

    Cheers!

  • 2017-05-24 Евгений Явгель

    Hi guys. Task 'Execute migrations' give me an error: fatal: [192.168.33.10]: FAILED! => {"changed": true, "cmd": ["/var/www/ansible_project/bin/console", "doctrine:migrations:migrate", "--no-interaction"], "delta": "0:00:00.182210", "end": "2017-05-23 21:41:51.013178", "failed": true, "rc": 1, "start": "2017-05-23 21:41:50.830968", "stderr": "\n \n [Symfony\\Component\\Console\\Exception\\CommandNotFoundException] \n There are no commands defined in the \"doctrine:migrations\" namespace. \n Did you mean one of these? \n doctrine \n doctrine:cache \n doctrine:database \n doctrine:generate \n doctrine:mapping \n doctrine:query \n doctrine:schema \n ", "stderr_lines": ["", " ", " [Symfony\\Component\\Console\\Exception\\CommandNotFoundException] ", " There are no commands defined in the \"doctrine:migrations\" namespace. ", " Did you mean one of these? ", " doctrine ", " doctrine:cache ", " doctrine:database ", " doctrine:generate ", " doctrine:mapping ", " doctrine:query ", " doctrine:schema ", " "], "stdout": "", "stdout_lines": []}

    I edited the composer.json: "doctrine/doctrine-migrations-bundle": "1.0.0",
    "doctrine/migrations": "1.0.1" AND added in the AppKernel.php this line: new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(). How it resolve? Thanks

  • 2017-05-22 Victor Bocharsky

    Hey Jian,

    Hm, try to re-install the assets again with "./bin/console assets:install". Does it fix the CSS problem? Actually, this command executes during the "composer install", at the end of it. But if due to the some reason "composer install" command failed it won't be run. Also, try to clear the cache: dev/prod, depends on what environment you're using.

    Cheers!

  • 2017-05-19 jian su

    Hi guys: for some reason the CSS is off... Is it because we did not configure boostrap theme in ansible?

  • 2017-05-12 Victor Bocharsky

    Hey Chea,

    Glad you got it working by remove the cache and also remove the composer.lock. Btw, I think you just need to remove the cache dir, you can keep the composer.lock file.

    Cheers!

  • 2017-05-12 sokphea chea

    Hello, Victor here is the out put error in terminal


    TASK [Install Composer's dependencies]
    fatal: [192.168.33.10]: FAILED! => {"changed": false, "failed": true, "msg": "Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Nothing to install or update Generating optimized autoload files > Incenteev\\ParameterHandler\\ScriptHandler::buildParameters > Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap > Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache Script Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception [RuntimeException] An error occurred when executing the \"'cache:clear --no-warmup'\" command: [Symfony\\Component\\Debug\\Exception\\ContextErrorException] Warning: Class __PHP_Incomplete_Class has no unserializer . install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...", "stdout": "Loading composer repositories with package information\nInstalling dependencies (including require-dev) from lock file\nNothing to install or update\nGenerating optimized autoload files\n> Incenteev\\ParameterHandler\\ScriptHandler::buildParameters\n> Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap\n> Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache\nScript Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception\n\n \n [RuntimeException] \n An error occurred when executing the \"'cache:clear --no-warmup'\" command: \n \n [Symfony\\Component\\Debug\\Exception\\ContextErrorException] \n Warning: Class __PHP_Incomplete_Class has no unserializer \n \n . \n \n\ninstall [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...\n\n", "stdout_lines": ["Loading composer repositories with package information", "Installing dependencies (including require-dev) from lock file", "Nothing to install or update", "Generating optimized autoload files", "> Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", "> Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", "> Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", "Script Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception", "", " ", " [RuntimeException] ", " An error occurred when executing the \"'cache:clear --no-warmup'\" command: ", " ", " [Symfony\\Component\\Debug\\Exception\\ContextErrorException] ", " Warning: Class __PHP_Incomplete_Class has no unserializer ", " ", " . ", " ", "", "install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...", ""]}

  • 2017-05-10 Victor Bocharsky

    Hey Chea,

    May I see your full error output here? You can also wrap this output with pre/code tags in your comment to avoid getting to the spam folder - see Syntax Highlighting section in https://help.disqus.com/cus...

    Cheers!

  • 2017-05-09 sokphea chea

    Hello, I still get the cache error on TASK [Install Composer's dependencies] after I remove the cache, is there something I need to check? thanks