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..
Error on Redis integration

Hi Herdโฆ
Trying to integrate Redis and getting this error:
Propel\Runtime\Exception\RuntimeException - Exception: No connection defined for database "zed". Did you forget to
define a connection or is it wrong written?
in /data/vendor/propel/propel/src/Propel/Runtime/ServiceContainer/StandardServiceContainer.php (303)
Got this while running step 5 in this: https://docs.spryker.com/docs/scos/dev/back-end-development/data-manipulation/data-pu[โฆ]blishing/handling-data-with-publish-and-synchronization.html
Comments
-
@valerii.trots Any idea on this one ?
0 -
is your database really called "zed"?
0 -
can you try to replace with name specified in deploy.yml file?
0 -
I would rather ask what version of spryker/console is used in the project? There was such kind of problem in the past.
0 -
This Spryker was installed in December 2021
0 -
The DB is called โeu-dockerโ and the only mention of โzedโ in our deploy file is for โbackend_api_euโ application:
0 -
This Spryker was installed in December 2021
Then it's something else. Not related to spryker/console.
0 -
I think i am also wrong, as i see that zed is also defined in other schema.xmls
0 -
I can find many occurrences of the same error message but majority related to running tests.
There is a recent one not related to testing but without resolution. Asked the guy if he was able to find a cause.0 -
can you check whether zed is defined in
/config/Shared/config_propel.php
0 -
so โzedโ is configured in runtime connections, but database connections array is empty? should โzedโ be added here also? just confused as to why it works to get data into zed database in the default redis implementations such as for products? and why this value would only need added now โฆ
0 -
it might not be the root cause for your problem, but maybe you can compare this file with the stock demoshop one. Or is your shop a vanilla demo shop from Dec 2021?
0 -
<?php use Spryker\Shared\Propel\PropelConstants; use Spryker\Zed\Propel\PropelConfig; use Spryker\Zed\PropelOrm\Business\Builder\ExtensionObjectBuilder; use Spryker\Zed\PropelOrm\Business\Builder\ExtensionQueryBuilder; use Spryker\Zed\PropelOrm\Business\Builder\ObjectBuilder; use Spryker\Zed\PropelOrm\Business\Builder\QueryBuilder; $placeholder = '%s:host=%s;port=%d;dbname=%s'; $dsn = sprintf( $placeholder, $config[PropelConstants::ZED_DB_ENGINE], $config[PropelConstants::ZED_DB_HOST], $config[PropelConstants::ZED_DB_PORT], $config[PropelConstants::ZED_DB_DATABASE] ); $slaves = []; foreach ($config[PropelConstants::ZED_DB_REPLICAS] ?? [] as $slaveData) { $slaves[] = [ 'dsn' => sprintf( $placeholder, $config[PropelConstants::ZED_DB_ENGINE], $slaveData[PropelConstants::ZED_DB_HOST], $slaveData[PropelConstants::ZED_DB_PORT], $config[PropelConstants::ZED_DB_DATABASE] ), 'user' => $config[PropelConstants::ZED_DB_USERNAME], 'password' => $config[PropelConstants::ZED_DB_PASSWORD], ]; } $connections = [ 'pgsql' => [ 'adapter' => PropelConfig::DB_ENGINE_PGSQL, 'dsn' => $dsn, 'user' => $config[PropelConstants::ZED_DB_USERNAME], 'password' => $config[PropelConstants::ZED_DB_PASSWORD], 'slaves' => $slaves, 'settings' => [], ], 'mysql' => [ 'adapter' => PropelConfig::DB_ENGINE_MYSQL, 'dsn' => $dsn, 'user' => $config[PropelConstants::ZED_DB_USERNAME], 'password' => $config[PropelConstants::ZED_DB_PASSWORD], 'slaves' => $slaves, 'settings' => [ 'charset' => 'utf8', 'queries' => [ 'utf8' => 'SET NAMES utf8 COLLATE utf8_unicode_ci, COLLATION_CONNECTION = utf8_unicode_ci, COLLATION_DATABASE = utf8_unicode_ci, COLLATION_SERVER = utf8_unicode_ci', ], ], ], ]; $config[PropelConstants::PROPEL] = [ 'database' => [ 'connections' => [], ], 'runtime' => [ 'defaultConnection' => 'default', 'connections' => ['default', 'zed'], ], 'generator' => [ 'defaultConnection' => 'default', 'connections' => ['default', 'zed'], 'objectModel' => [ 'defaultKeyType' => 'fieldName', 'builders' => [ // If you need full entity logging on Create/Update/Delete, then switch to // Spryker\Zed\PropelOrm\Business\Builder\ObjectBuilderWithLogger instead. 'object' => ObjectBuilder::class, 'objectstub' => ExtensionObjectBuilder::class, 'query' => QueryBuilder::class, 'querystub' => ExtensionQueryBuilder::class, ], ], ], 'paths' => [ 'phpDir' => APPLICATION_ROOT_DIR, 'sqlDir' => APPLICATION_ROOT_DIR . '/src/Orm/Propel/Sql', 'migrationDir' => APPLICATION_ROOT_DIR . '/src/Orm/Propel/Migration_' . $config[PropelConstants::ZED_DB_ENGINE], 'schemaDir' => APPLICATION_ROOT_DIR . '/src/Orm/Propel/Schema', 'loaderScriptDir' => APPLICATION_ROOT_DIR . '/src/Orm/Propel/generated-conf/', ], ]; $ENGINE = $config[PropelConstants::ZED_DB_ENGINE]; $config[PropelConstants::PROPEL]['database']['connections']['default'] = $connections[$ENGINE]; $config[PropelConstants::PROPEL]['database']['connections']['zed'] = $connections[$ENGINE];
0 -
yes it is a standard B2C demo shop
0 -
yea it seems that is very similar to our implementation, also the database connections array is empty there also so seems that may not be the issue
0 -
If this is not urgent, we can take a closer look on this docu next week and come back to you
0 -
yea sure any help whenever you guys get time would be appreciated, thank you Thomas ๐
0 -
Sure thing, have a good weekend
0 -
Any updates found on this @U02U16B54Q7? Is there any member of your team thatโd have specific knowledge on docs sections and what they mean, e.g.
0 -
what it means here by run the controller ? like how do we do this ?
0 -
Hey just to clarifyโฆ weโre on step 5 of this: https://docs.spryker.com/docs/scos/dev/back-end-development/data-manipulation/data-pu[โฆ]blishing/handling-data-with-publish-and-synchronization.html
The step is to: โ*Create a controller class as follows and run it.*โ
We donโt know how to โrun itโ โฆ since weโre not using Yves then we canโt simply โrun itโ โฆ so we decided to hook up a Glue API endpoint to try to run it and thatโs where we get the โzedโ error.
My guess is, that since weโre in Glue, thereโs no direct access to ZED.
If we back up a littleโฆ is there any way to โrunโ a ZED module here without Yves? Or is there something weโre missing when trying to run a ZED module from Glue?
0 -
Hey Ray, i have asked one of our team to investigate and share results
0 -
And your explanation sounds reasonable
0 -
cool thanks Thomas !
0 -
While this is going on, can you please share a description of your use case? Like what are you building here and for what purpose? Makes it easier to check
0 -
weโre building our own custom Recipe module, so in this case recipe storage, weโre trying to get the recipes into Redis, already have them in Elasticsearch and MariaDB
0 -
We built the original module using the info from the intermediate course on the Spryker Academy. One of the tasks is to build the ES side โฆ weโre now trying to build the Redis side of the same module.
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 80 Spryker News
- 954 Developer Corner
- 810 Spryker Development
- 91 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 36 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
- 70 Spryker Safari Questions
- 50 Random