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..

Hello All, Does anyone know how to inactivate product (abstract and concrete) so it is not returned

Options
U015HHFCU1M
U015HHFCU1M Posts: 81 πŸ§‘πŸ»β€πŸš€ - Cadet

Hello All,
Does anyone know how to inactivate product (abstract and concrete) so it is not returned in Glue anymore?
I have two stores. I detached it from both store via Zed panel but I can still see it in GET /catalog-search Glue endpoint.

Comments

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet
    Options

    Maybe is the product still in ES? Did u checked it?

  • U015HHFCU1M
    U015HHFCU1M Posts: 81 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited February 2021
    Options

    Nope. Is there a way to resync products?

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet
    Options

    of course.. take a look to command sync:data

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    Options

    Let me experiment a bit and I will come back with a feedback ASAP.

  • U015HHFCU1M
    U015HHFCU1M Posts: 81 πŸ§‘πŸ»β€πŸš€ - Cadet
    Options

    I'll do the same

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    edited February 2021
    Options

    Using latest spryker-shop/suite demo shop I can see that one message goes to the error queue after I deactivated a concrete product.

    Failed to handle \"Entity.spy_product.update\" for listener \"Spryker\\Zed\\ProductListSearch\\Communication\\Plugin\\Event\\Listener\\ProductSearchListener\". Exception: \"Unable to execute SELECT statement [SELECT spy_product_category.id_product_category, spy_product_category.fk_category, spy_product_category.fk_product_abstract, spy_product_category.product_order, spy_category_node.id_category_node AS id_category_node FROM spy_product_category LEFT JOIN spy_category ON (spy_product_category.fk_category=spy_category.id_category) INNER JOIN spy_category_node ON (spy_category.id_category=spy_category_node.fk_category) LEFT JOIN spy_category_store ON (spy_category.id_category=spy_category_store.fk_category) LEFT JOIN spy_store ON (spy_category_store.fk_store=spy_store.id_store) WHERE spy_product_category.fk_product_abstract IN (:p1)]
    

    Maybe this is the reason.

    Could you check your rabbitmq as well?

  • U015HHFCU1M
    U015HHFCU1M Posts: 81 πŸ§‘πŸ»β€πŸš€ - Cadet
    Options

    Yes, one sec.

  • U015HHFCU1M
    U015HHFCU1M Posts: 81 πŸ§‘πŸ»β€πŸš€ - Cadet
    Options

    There are a lot of messages in error queue.

  • U015HHFCU1M
    U015HHFCU1M Posts: 81 πŸ§‘πŸ»β€πŸš€ - Cadet
    Options

    What would be the best way to see whats in there?

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    edited February 2021
    Options

    https://queue.spryker.local/#/queues/de-docker/publish.error

    Set how many messages you want to retrieve.

  • U015HHFCU1M
    U015HHFCU1M Posts: 81 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited February 2021
    Options

    working on it

  • U015HHFCU1M
    U015HHFCU1M Posts: 81 πŸ§‘πŸ»β€πŸš€ - Cadet
    Options

    It seems there issues with publishing:

    {
        "listenerClassName": "Spryker\\Zed\\ProductStorage\\Communication\\Plugin\\Event\\Listener\\ProductAbstractStoragePublishListener",
        "transferClassName": "Generated\\Shared\\Transfer\\EventEntityTransfer",
        "transferData": {
            "id": 1,
            "event": null,
            "name": null,
            "foreign_keys": [],
            "modified_columns": [],
            "original_values": [],
            "additional_values": []
        },
        "eventName": "Product.product_abstract.publish",
        "retry": 1,
        "retryMessage": "Retry on: Failed to handle \u0022Product.product_abstract.publish\u0022 for listener \u0022Spryker\\Zed\\ProductStorage\\Communication\\Plugin\\Event\\Listener\\ProductAbstractStoragePublishListener\u0022. Exception: \u0022Undefined index: US\u0022, \u0022#0 \/data\/vendor\/spryker\/rabbit-mq\/src\/Spryker\/Client\/RabbitMq\/Model\/Connection\/ConnectionManager.php(124): Spryker\\Shared\\ErrorHandler\\ErrorHandlerEnvironment-\u003ESpryker\\Shared\\ErrorHandler\\{closure}(8, \u0027Undefined index...\u0027, \u0027\/data\/vendor\/sp...\u0027, 124, Array)\n#1 \/data\/vendor\/spryker\/rabbit-mq\/src\/Spryker\/Client\/RabbitMq\/Model\/Publisher\/Publisher.php(131):
    
  • U015HHFCU1M
    U015HHFCU1M Posts: 81 πŸ§‘πŸ»β€πŸš€ - Cadet
    Options

    It seems this is related with incorrect store index.

  • U015HHFCU1M
    U015HHFCU1M Posts: 81 πŸ§‘πŸ»β€πŸš€ - Cadet
    Options

    I can see incorrect store code in spy_product_abstract_storage as well.
    It's US and we have BR and GB only.

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    Options

    That means that you haven't adjusted your configuration accordingly.
    Check you deploy.*.yml files.

  • U015HHFCU1M
    U015HHFCU1M Posts: 81 πŸ§‘πŸ»β€πŸš€ - Cadet
    Options

    It's there. Everything seem to work as expected.

  • U015HHFCU1M
    U015HHFCU1M Posts: 81 πŸ§‘πŸ»β€πŸš€ - Cadet
    Options

    Is there a way to clean up _storage tables?
    Or to resync them?
    Will sync:data help here?

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    Options

    What is there? Do you mean RMQ connections for US shop? If you don't have it, you need to remove it.

    AFAIK sync:data will sync from _storage and _search tables to Redis and ES respectively.

    events:trigger will update _storage and _search tables.

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    edited February 2021
    Options

    Also I've run docker/sdk reset locally to check if my exception is reproducible. This time deactivating a concrete product ran without messages ending up into error queue. And after that /catalog-search doesn't return deactivated product anymore.

    So to answer to the initial question: it's enough to just deactivate all concretes of needed abstract product and it will disappear from Redis\ES and from Glue respectively.

  • U015HHFCU1M
    U015HHFCU1M Posts: 81 πŸ§‘πŸ»β€πŸš€ - Cadet
    Options

    Yes, we removed US sometimes back. We have BR and GB now.
    I triggered events:trigger earlier today, but still see US in _storage table.

  • U01LKKBK97T
    U01LKKBK97T Posts: 287 πŸ§‘πŸ»β€πŸš€ - Cadet
    Options

    Try console publish:trigger-events --resource=product_abstract and console publish:trigger-events --resource=product_concrete respectively.