dth981485742 2019-08-12 16:27
浏览 167

Docker上的magento2错误:“setup”命名空间中没有定义命令

I'm installating magento2 in a Docker container with OS as below.

Linux 8791be8c3c43 5.0.0-23-generic #24~18.04.1-Ubuntu SMP Mon Jul 29 16:12:28 UTC 2019 x86_64 GNU/Linux

When I try to setup magento with the command and parameters below and I get the error: There are no commands defined in the "setup" namespace.

bin/magento setup:install \
--base-url=http://localhost/magento2 \
--db-host=localhost \
--db-name=magento \
--db-user=magento \
--db-password=magento \
--backend-frontname=admin \
--admin-firstname=admin \
--admin-lastname=admin \
--admin-email=admin@admin.com \
--admin-user=admin \
--admin-password=admin123 \
--language=en_US \
--currency=USD \
--timezone=America/Chicago \
--use-rewrites=1

As per some post I've found I ran this command below, it seems that it displays issues in the magento setup. The last error, the one making reference to SODIUM I solved by installing sodium extension. The others seems to be solved too.

enter image description here

magento@8791be8c3c43:/var/www/html/magento2$ php bin/magento list
Magento CLI 2.3.2

In ServiceManager.php line 1130:

  An abstract factory could not create an instance of magentosetupconsolecommandbackupcommand(alias: Magento\Setup\Console\Command\BackupCommand).  


In ServiceManager.php line 941:

  An exception was raised while creating "Magento\Setup\Console\Command\BackupCommand"; no instance returned  


In Di.php line 865:

  Missing instance/object for parameter maintenanceMode for Magento\Setup\Console\Command\BackupCommand::__construct  


In ServiceManager.php line 1130:

  An abstract factory could not create an instance of magentoframeworkappmaintenancemode(alias: Magento\Framework\App\MaintenanceMode).  


In ServiceManager.php line 941:

  An exception was raised while creating "Magento\Framework\App\MaintenanceMode"; no instance returned  


In ErrorHandler.php line 61:

  Warning: Use of undefined constant SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13 - assumed 'SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13' (this will throw an Error in a future version of PHP) in /var/www/html/magento2/  
  lib/internal/Magento/Framework/Encryption/Encryptor.php on line 153 

I tried to solve the issue by following some steps I've found in some post, like removing the content of the directories below, then trying to execute php bin/magento cache:flush and php bin/magento setup:upgrade but anything I try to run starting with php bin/magento..... gets me the error: There are no commands defined in the "xxxxxx" namespace.

rm -Rf var/cache/*
rm -Rf var/generation/*

Some solutions I found were based on fixing permissions folder issues, but I believe I have no permission issues, as my "magento" user is member of owner group of installation folder (see my code below), and composer was installed with "magento" user and no errors were thrown.

   # Create a new user and group, which will be Magento file system owner
    useradd -m -U -r -d /opt/magento magento -s /bin/bash && \

    # Add the magento user to the www-data group and change the /opt/magento directory permissions so that the Nginx can access the Magento installation:
    usermod -a -G www-data magento && \
    chmod 750 /opt/magento && \

    wget https://github.com/magento/magento2/archive/2.3.2.tar.gz && \
    tar -xzvf 2.3.2.tar.gz && \
    chown -R www-data:www-data /var/www/html/magento2-2.3.2/ && \
    chmod -R 775 /var/www/html/magento2-2.3.2/ && \
    mv magento2-2.3.2/ magento2 && \
    rm 2.3.2.tar.gz && \
    cd magento2 && \
    su magento && \

Any ideas to troubleshoot this issue are very welcome, thanks in advanced.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥30 求一段fortran代码用IVF编译运行的结果
    • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
    • ¥15 lammps拉伸应力应变曲线分析
    • ¥15 C++ 头文件/宏冲突问题解决
    • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
    • ¥50 安卓adb backup备份子用户应用数据失败
    • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
    • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
    • ¥30 python代码,帮调试,帮帮忙吧
    • ¥15 #MATLAB仿真#车辆换道路径规划