What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hi, I am trying to access a function in the MerchantRelationshipProductListRepository, but I get an
Hi, I am trying to access a function in the MerchantRelationshipProductListRepository, but I get an error upon calling.
No connection defined for database "zed". Did you forget to define a connection or is it wrong written?
I didn't change this class at all, so I'm a bit surprised that there's no stream already π€ (Full stacktrace in Thread)
Comments
-
[2020-02-17 14:58:21] Yves.CRITICAL: Propel\Runtime\Exception\RuntimeException - No connection defined for database "zed". Did you forget to define a connection or is it wrong written? in "/data/shop/development/current/vendor/propel/propel/src/Propel/Runtime/ServiceContainer/StandardServiceContainer.php::279" {"exception":"[object] (Propel\\Runtime\\Exception\\RuntimeException(code: 0): No connection defined for database \"zed\". Did you forget to define a connection or is it wrong written? at /data/shop/development/current/vendor/propel/propel/src/Propel/Runtime/ServiceContainer/StandardServiceContainer.php:279) [stacktrace] #0 /data/shop/development/current/vendor/propel/propel/src/Propel/Runtime/ServiceContainer/StandardServiceContainer.php(372): Propel\\Runtime\\ServiceContainer\\StandardServiceContainer->getConnectionManager('zed') #1 /data/shop/development/current/vendor/propel/propel/src/Propel/Runtime/ActiveQuery/ModelCriteria.php(992): Propel\\Runtime\\ServiceContainer\\StandardServiceContainer->getReadConnection('zed') #2 /data/shop/development/current/vendor/spryker/merchant-relationship-product-list/src/Spryker/Zed/MerchantRelationshipProductList/Persistence/MerchantRelationshipProductListRepository.php(64): Propel\\Runtime\\ActiveQuery\\ModelCriteria->find() #3 /data/shop/development/current/src/Pyz/Client/MerchantRelationship/MerchantRelationshipClient.php(33): Spryker\\Zed\\MerchantRelationshipProductList\\Persistence\\MerchantRelationshipProductListRepository->findProductListCollectionByIdMerchantRelationship(1) #4 /data/shop/development/current/src/Pyz/Client/ProductList/PListClient.php(53): Pyz\\Client\\MerchantRelationship\\MerchantRelationshipClient->findProductListCollectionByIdMerchantRelationship(Object(Generated\\Shared\\Transfer\\MerchantRelationshipTransfer)) #5 /data/shop/development/current/src/Pyz/Client/ProductList/PListClient.php(40): Pyz\\Client\\ProductList\\PListClient->getProductListsForMerchantRelation(Object(Generated\\Shared\\Transfer\\MerchantRelationshipTransfer)) #6 /data/shop/development/current/src/Pyz/Yves/CompanyPage/Controller/ProductListPageController.php(35): Pyz\\Client\\ProductList\\PListClient->getProductListCollectionByOwnerCompanyBusinessUnit(Object(Generated\\Shared\\Transfer\\CompanyBusinessUnitTransfer)) #7 /data/shop/development/current/vendor/symfony/http-kernel/HttpKernel.php(151): Pyz\\Yves\\CompanyPage\\Controller\\ProductListPageController->indexAction(Object(Symfony\\Component\\HttpFoundation\\Request)) #8 /data/shop/development/current/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1) #9 /data/shop/development/current/vendor/spryker/application/src/Spryker/Shared/Application/Application.php(105): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request)) #10 /data/shop/development/current/vendor/spryker/application/src/Spryker/Shared/Application/Application.php(86): Spryker\\Shared\\Application\\Application->handle(Object(Symfony\\Component\\HttpFoundation\\Request)) #11 /data/shop/development/current/public/Yves/index.php(22): Spryker\\Shared\\Application\\Application->run() #12 {main} "} {"environment":{"application":"YVES","environment":"development","store":"DE","locale":"de_DE"},"server":{"url":"[www.de.suite.local](http://www.de.suite.local/company/assortment>","is_https":false,"hostname":"<http://www.de.suite.local)","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36","user_ip":"10.10.0.1","request_method":"GET","referer":"<http://www.de.suite.local/company/business-unit>"},"request":{"requestId":"54e39ce4","type":"WEB","request_params":[]}}
0 -
I had such issue once when one of my containers has crashed. Have you tried to re-start it (in case youβre using docker)?
0 -
I also saw that when I tried to run acceptance tests in a very specific manner on devtest environment, not sure itβs your case, however
0 -
You are accessing Repository from Yves application. Yves should access Zed things through Client only.
0 -
Oh, that could be it, too π
0 -
and client do rpc call to zed (through gateway controller).
0 -
I am actually doing this π€
PageController calls the ProductListClient. I resolve a MerchantRelation and call
return $this->getFactory()createMerchantRelationshipClient()->findProductListCollectionByIdMerchantRelationship($merchantRelation);
The findProductListCollectionByIdMerchantRelationship() itself comes from Client.. am I missing something?
0 -
@ULL0N440J, according to your stacktrace:
/data/shop/development/current/src/Pyz/Client/MerchantRelationship/MerchantRelationshipClient.php(33): Spryker\\Zed\\MerchantRelationshipProductList\\Persistence\\MerchantRelationshipProductListRepository->findProductListCollectionByIdMerchantRelationship(1)
0 -
which means youβre trying to run query from the Client
0 -
Ah.. alright, got it. Will put this code compeltely into GatewayController
0 -
Thanks π
0 -
This should be the flow on Zed:
Gateway Controller (communication) => Facade (Business) => Some model (Business) -> Query (Persistence)0 -
there are other possible options, but try to avoid doing queries in the GatewayController π
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 78 Spryker News
- 936 Developer Corner
- 793 Spryker Development
- 90 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 27 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 33 Product & Business Questions
- 69 Spryker Safari Questions
- 50 Random