magento setup:upgrade error "deployment configuration is absent"

  • When I try to upgrade Magento 2 php bin/magento setup:upgrade I get

    I get

    Can't run this operation: deployment configuration is absent. Run 'magento setup:config:set --help' for options. setup:upgrade

    [--keep-generated] [--magento-init-params="..."]

    How to fix it? Updating using the web updater gives the following errors:

    enter image description here

    I asked my hosting provider to fix them and they did install the right php version 5.6 and all extensions recommended by magento and created a cron job but I still see the error.

    UPDATE: (from comments)
    env.php wasn't there, when I run magento setup:config:set I get this error:

    $ bin/magento setup:config:set
    SQLSTATE[HY000] [2002] No such file or directory

    Parameter validation failed

    Check to see if `/app/etc/env.php` is present. That is the deployment configuration. If it's absent, run the `magento setup:config:set` command again to create it.

    @SteveJohnson env.php wasn't there, when I run `magento setup:config:set` i get this error

    The error indicates your Magento database user name and password don't match. I'm not sure it's a good idea to run your Magento database as `root`; have you seen our MySQL setup instructions? Maybe try that and see if the command succeeds.

  • 7ochem

    7ochem Correct answer

    5 years ago

    I ran into the same issue today. It appeared that the app/etc/env.php was missing. This means that Magento was not yet installed. During Magento installation it will create this file, so:

    • make sure app/etc/ is writable for the magento user/webuser
    • run bin/magento setup:install ...params...

    In my case, some script that I made was not copying my env.php file into the app/etc/ folder.

    It is also possible that the file is there, but it is not readable for the Magento user/webuser.

License under CC-BY-SA with attribution

Content dated before 7/24/2021 11:53 AM

Tags used