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

Cannot instantiate interface Magento\Store\Api\StoreRepositoryInterface #9

Open
codingkoaladev opened this issue Nov 21, 2024 · 4 comments

Comments

@codingkoaladev
Copy link

codingkoaladev commented Nov 21, 2024

Hi there,

I tried to test the installer twice today on a ddev environment, once with apache and once with nginx. Each time I got the following error:

[2024-11-21T06:12:30.872279+00:00] main.CRITICAL: Error: Cannot instantiate interface Magento\Store\Api\StoreRepositoryInterface in /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/Dynamic/Developer.php:50 Stack trace: #0 /var/www/html/vendor/mage-os/framework/ObjectManager/ObjectManager.php(73): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Store\\A...') #1 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/AbstractFactory.php(170): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Store\\A...') #2 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/AbstractFactory.php(276): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Store\\A...', NULL, 'storeRepository', 'Magento\\Store\\A...') #3 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/AbstractFactory.php(239): Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument('Magento\\Store\\A...', Array, Array) #4 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Store\\A...', Array, Array) #5 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Store\\A...', Array, Array) #6 /var/www/html/vendor/mage-os/framework/ObjectManager/ObjectManager.php(73): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Store\\A...') #7 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/AbstractFactory.php(170): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Store\\A...') #8 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/AbstractFactory.php(276): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Store\\A...', NULL, 'storePathInfoVa...', 'Magento\\Store\\A...') #9 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/AbstractFactory.php(239): Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument('Magento\\Store\\A...', Array, Array) #10 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Store\\A...', Array, Array) #11 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Store\\A...', Array, Array) #12 /var/www/html/vendor/mage-os/framework/ObjectManager/ObjectManager.php(73): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Store\\A...') #13 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/AbstractFactory.php(170): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Store\\A...') #14 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/AbstractFactory.php(276): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Store\\A...', NULL, 'subject', 'Magento\\Backend...') #15 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/AbstractFactory.php(239): Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument('Magento\\Backend...', Array, Array) #16 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Backend...', Array, Array) #17 /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Backend...', Array, Array) #18 /var/www/html/vendor/mage-os/framework/ObjectManager/ObjectManager.php(73): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Backend...') #19 /var/www/html/generated/code/Magento/Backend/App/Request/PathInfoProcessor/Proxy.php(94): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Backend...') #20 /var/www/html/generated/code/Magento/Backend/App/Request/PathInfoProcessor/Proxy.php(105): Magento\Backend\App\Request\PathInfoProcessor\Proxy->_getSubject() #21 /var/www/html/vendor/mage-os/framework/App/Request/Http.php(154): Magento\Backend\App\Request\PathInfoProcessor\Proxy->process(Object(Magento\Framework\App\Request\Http), '') #22 /var/www/html/vendor/mage-os/framework/App/Request/Http.php(169): Magento\Framework\App\Request\Http->getOriginalPathInfo() #23 /var/www/html/vendor/mage-os/framework/App/Request/Http.php(219): Magento\Framework\App\Request\Http->getPathInfo() #24 /var/www/html/vendor/mage-os/framework/App/Http.php(111): Magento\Framework\App\Request\Http->getFrontName() #25 /var/www/html/vendor/mage-os/framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch() #26 /var/www/html/pub/index.php(30): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http)) #27 {main} {"exception":"[object] (Error(code: 0): Cannot instantiate interface Magento\\Store\\Api\\StoreRepositoryInterface at /var/www/html/vendor/mage-os/framework/ObjectManager/Factory/Dynamic/Developer.php:50)"} []

I followed the installation instruction from the repository

@codingkoaladev
Copy link
Author

codingkoaladev commented Nov 21, 2024

Update:

This error might have been caused by the presence of env.php generated by ddev automatically. I retried by recreating the project inside the container, ensuring no additional files were created by any tools. The installer tries to launch, but I'm facing a constant redirection issue.

image

ddev config:

name: mageos
type: magento2
docroot: magento/pub
php_version: "8.2"
webserver_type: nginx-fpm
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
database:
    type: mariadb
    version: "10.6"
upload_dirs:
    - media
use_dns_when_possible: true
composer_version: "2"
disable_settings_management: true
web_environment: []
corepack_enable: false

@jakwinkler
Copy link
Collaborator

Haven't worked with ddev for a long time, but it seems you have the same issue mentioned on Discord

@jakwinkler
Copy link
Collaborator

I've done some digging and this error happens when Magento tries to load a store and load the frontend, not the installer.
It seems like you are not executing the script under /setup/index.php

@codingkoaladev
Copy link
Author

codingkoaladev commented Nov 22, 2024 via email

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

2 participants