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'm trying to figure out why `spy_product_abstract_category_storage` table is always empty and th
Hi I'm trying to figure out why spy_product_abstract_category_storage
table is always empty and thus redis also has no product_abstract_category
values. I run vendor/bin/console publish:trigger-events -r product_abstract_category
but nothing happens. Ideas?
Comments
-
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
I know you likely have already checked, but just to be sure: have you set a breakpoint in
vendor/spryker/product-category-storage/src/Spryker/Zed/ProductCategoryStorage/Communication/Plugin/Publisher/ProductCategoryPublisherTriggerPlugin.php
and checked what exactly happens and which condition might fail?0 -
that file has no conditions 🤔
0 -
something inside
$this->createFilterTransfer($offset, $limit);
?0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
maybe not related, but maybe it is: i remember a flaw i was running into in a project: they removes some db entries by hand from the db. so the IDs started not with 1 but somewhere 101 or so. The spryker ootb iteration was via id’s but since the first pagination was resulting in no entries the whole process did not continue. I think this was also something about pub&sync, maybe just sync
0 -
this is really unknown territory for me, but I think(?) it does publish the all the products
0 -
where do I break to see the queue being read?
0 -
or was it db first then queue 🤔
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
The ProductCategoryPublisherTriggerPlugin should normally read from the db first (the original entity) and then perform the publish the entity. this should create a sync message. and this all should happen in bulks.
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
so i would set a breakpoint in getData() first
0 -
it reads 2000+ ids just fine, does ?? and then ??
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
if getData does return something then my thought about the missing ids would not be valid here.
0 -
I think it writes it to sync.storage.product?
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
oh, i think i was wrong. I have not set a breakpoint or anything (working on sth else right now) but by looking into the Plugin i think it DOES trigger publish events
ProductCategory.category.publish
as ofgetEventName()
in the plugin0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
do you see right now with your breakpoint which class/method calls getData() ?
0 -
ProductCategoryPublisherTriggerPlugin.php:37, Spryker\Zed\ProductCategoryStorage\Communication\Plugin\Publisher\ProductCategoryPublisherTriggerPlugin->getData() EventResourceRepositoryBulkPluginIterator.php:36, Spryker\Zed\EventBehavior\Business\Model\EventResourceRepositoryBulkPluginIterator->updateCurrent() AbstractEventResourcePluginIterator.php:101, Spryker\Zed\EventBehavior\Business\Model\AbstractEventResourcePluginIterator->rewind() EventResourceRepositoryManager.php:138, Spryker\Zed\EventBehavior\Business\Model\EventResourceRepositoryManager->processEventsForRepositoryBulkPlugins() EventResourceRepositoryManager.php:105, Spryker\Zed\EventBehavior\Business\Model\EventResourceRepositoryManager->processEventsForBulkRepositoryPlugins() EventResourceRepositoryManager.php:63, Spryker\Zed\EventBehavior\Business\Model\EventResourceRepositoryManager->processResourceEvents() EventResourcePluginResolver.php:135, Spryker\Zed\EventBehavior\Business\Model\EventResourcePluginResolver->processResourceEvents() EventResourcePluginResolver.php:81, Spryker\Zed\EventBehavior\Business\Model\EventResourcePluginResolver->executeResolvedPluginsBySources() EventBehaviorFacade.php:142, Spryker\Zed\EventBehavior\Business\EventBehaviorFacade->executeResolvedPluginsBySources() PublisherToEventBehaviorFacadeBridge.php:34, Spryker\Zed\Publisher\Dependency\Facade\PublisherToEventBehaviorFacadeBridge->executeResolvedPluginsBySources() PublisherTriggerEventsConsole.php:103, Spryker\Zed\Publisher\Communication\Console\PublisherTriggerEventsConsole->execute() Command.php:298, Symfony\Component\Console\Command\Command->run() Application.php:1058, Symfony\Component\Console\Application->doRunCommand() Application.php:301, Symfony\Component\Console\Application->doRun() ConsoleBootstrap.php:114, Spryker\Zed\Console\Communication\Bootstrap\ConsoleBootstrap->doRun() Application.php:171, Symfony\Component\Console\Application->run() console:27, include() console:120, {main}()
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
https://github.com/spryker/event-behavior/blob/master/src/Spryker/Zed/EventBehavior/Business/Model/EventResourceRepositoryManager.php#L210 yeah, so it triggers the publish event - and depending on how it is setup it should write some event message to a publish-queue or to the event-queue if its the older way
0 -
I'm lost what happens after that. Does it go into a RabbitMQ queue named "publish"?
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
You have to follow the publish event -> it is defined in a constant with the name
PRODUCT_CATEGORY_PUBLISH
-> i found it invendor/spryker/product-category-storage/src/Spryker/Zed/ProductCategoryStorage/Communication/Plugin/Publisher/ProductCategory/ProductCategoryWriteForPublishingPublisherPlugin.php
and this is plugged-in insrc/Pyz/Zed/Publisher/PublisherDependencyProvider.php
and no extra queue name defined so it will be put to the default “publish” queue.0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
Long story short: at least in the latest ootb b2b-demoshop it should be put to that queue by the default settings once you execute
vendor/bin/console publish:trigger-events -r product_abstract_category
0 -
I traced the issue to
ProductCategoryStorageRepository::getAllCategoryNodeAggregationsOrderedByDescendant
, this query returns nothing 😓SELECT (CASE WHEN spy_category_closure_table.depth = 0 THEN 1 ELSE 0 END) AS boostedDepth, spy_category_node.id_category_node AS idCategoryNode, spy_category_closure_table.fk_category_node_descendant AS idCategoryNodeDescendant, spy_category_node.fk_category AS idCategory, spy_category_attribute.name AS name, spy_url.url AS url, spy_locale.locale_name AS locale, spy_store.name AS store FROM spy_category_node LEFT JOIN spy_url ON (spy_category_node.id_category_node=spy_url.fk_resource_categorynode) INNER JOIN spy_category_closure_table ON (spy_category_node.id_category_node=spy_category_closure_table.fk_category_node) INNER JOIN spy_category ON (spy_category_node.fk_category=spy_category.id_category) LEFT JOIN spy_category_store ON (spy_category.id_category=spy_category_store.fk_category) INNER JOIN spy_store ON (spy_category_store.fk_store=spy_store.id_store) LEFT JOIN spy_category_attribute ON (spy_category.id_category=spy_category_attribute.fk_category) INNER JOIN spy_locale ON (spy_category_attribute.fk_locale=spy_locale.id_locale) WHERE spy_url.fk_locale = spy_category_attribute.fk_locale AND spy_category_closure_table.depth IS NOT NULL AND spy_category_node.is_root=false ORDER BY boostedDepth DESC,spy_category_closure_table.depth ASC,spy_category_closure_table.fk_category_node_descendant DESC,spy_category_node.node_order DESC
0 -
what is this closure table?
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
tbh i did not know before by myself. I colleague of mine just told me that it allows you to get fast and easy all child categories via a single query. it’s like all relations of the category tree represented as a flat table
0 -
yeah I figured that out but who and what updates it?
0 -
we were forced to do some manual
spy_url
changes, I bet that data is stale0 -
or hmm 🤔 I think I can fix the data
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 ⚖️ - Guardians (admin)
who and what updates it
This i dont know, sry 😕
0 -
re-importing categories, and reindexing redis seems to halve solved this. Something was off in spy_url data
0 -
.
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 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
- 26 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
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random