Jump to content

"Shop id 0 is invalid" error during a clean install using CLI


Recommended Posts

Hello,

I'm doing a clean install (1.7.8.6) under PHP7.4 (also tried with 7.3, 7.2, 7.1) using the CLI tool.

php /usr/home/mydomain/web/install/index_cli.php --language=es --domain=mydomain --db_clear=1 --db_create=1 --prefix=mypref_ --firstname=myname --password=mypasswd --name=myname --db_name=prestashop --db_user=mydbuser --db_password=mydbpass

 

That line was working until yesterday. Now, I get this error:

PrestaShop\PrestaShop\Core\Domain\Shop\Exception\ShopException: Shop id 0 is invalid. Shop id must be number that is greater than zero. in /usr/home/mydomain/web/src/Core/Domain/Shop/ValueObject/ShopId.php:69
Stack trace:
#0 /usr/home/mydomain/web/src/Core/Domain/Shop/ValueObject/ShopId.php(48): PrestaShop\PrestaShop\Core\Domain\Shop\ValueObject\ShopId->assertIsGreaterThanZero(0)
#1 /usr/home/mydomain/web/src/Core/Domain/Shop/ValueObject/ShopConstraint.php(103): PrestaShop\PrestaShop\Core\Domain\Shop\ValueObject\ShopId->__construct(0)
#2 /usr/home/mydomain/web/src/Core/Domain/Shop/ValueObject/ShopConstraint.php(64): PrestaShop\PrestaShop\Core\Domain\Shop\ValueObject\ShopConstraint->__construct(0, NULL, false)
#3 /usr/home/mydomain/web/src/Adapter/Configuration.php(422): PrestaShop\PrestaShop\Core\Domain\Shop\ValueObject\ShopConstraint::shop(0)
#4 /usr/home/mydomain/web/src/Adapter/Configuration.php(106): PrestaShop\PrestaShop\Adapter\Configuration->buildShopConstraintFromContext()
#5 /usr/home/mydomain/web/src/Core/Addon/Theme/ThemeRepository.php(74): PrestaShop\PrestaShop\Adapter\Configuration->get('_PS_ALL_THEMES_...')
#6 /usr/home/mydomain/web/classes/shop/Shop.php(495): PrestaShop\PrestaShop\Core\Addon\Theme\ThemeRepository->getInstanceByName('classic')
#7 /usr/home/mydomain/web/classes/shop/Shop.php(137): ShopCore->setTheme()
#8 /usr/home/mydomain/web/classes/shop/Shop.php(395): ShopCore->__construct(1)
#9 /usr/home/mydomain/web/install/controllers/console/process.php(71): ShopCore::initialize()
#10 /usr/home/mydomain/web/install/controllers/console/process.php(307): InstallControllerConsoleProcess->initializeContext()
#11 /usr/home/mydomain/web/install/controllers/console/process.php(161): InstallControllerConsoleProcess->processInstallTheme()
#12 /usr/home/mydomain/web/install/classes/controllerConsole.php(117): InstallControllerConsoleProcess->process()
#13 /usr/home/mydomain/web/install/index_cli.php(64): InstallControllerConsole::execute(12, Array)
#14 {main}

 

I think the permissions and owner of the files and folders are correct (I also tried with 777 to discard permissions problem):

find . -type f -exec chmod 644 -- {} +
find . -type d -exec chmod 755 -- {} +
chown -R myuser: *
chown myuser: .htaccess

 

I've tried removing cache files, but still not doing a correct installation.

 

If I access my domain, it seems that the installation is fine, but the database has not been imported as expected, because we cannot see the login button, categories and other missing options:

image.thumb.png.a50bf51eb23fe12e37c1eb951d4e7441.png

 

With dev mode enable, PrestaShop reports the following, as if it expected to load data that is not there. Possibly because the database was not imported correctly and was left halfway.

image.thumb.png.9158e3494fbc1d23c2d80194420e7583.png

 

Has anyone had the same problem and can give me an idea please? We've been working on a solution for hours and we can't find it.

Manual installation works fine, but we are interested in installation using CLI.

 

Thanks in advance.

Daniel

Link to comment
Share on other sites

10 hours ago, marcandreg said:

Find out that it work with version <= 1.7.7.8.

Thanks for your answer @marcandreg, I appreciate it.


I think that we can use that version, but our automation takes the latest version automatically. So ideally, we are interested to always install the latest one.

I hope I find the problem soon.

 

Best regards.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...