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 come with another issue, I get an error prompt when going to `

U01G4K5E0J2
U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

hi, I come with another issue,
I get an error prompt when going to <http://zed.en.suite.local/availability-gui>
Ill add logs and error messages in replies

Comments

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    in propel.log i get

    [2020-12-10T08:33:39.288657+00:00] defaultLogger.ERROR: SQLSTATE[42P01]: Undefined table: 7 ERROR:  missing FROM-clause entry for table "spy_stock" LINE 1: ...ct"."id_product"=spy_stock_product.fk_product AND spy_stock....                                                              ^ [] []
    

    application and exception logs remain empty

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    when I check console I get 500 from <http://zed.en.suite.local/availability-gui/index/availability-abstract-table>

    Unable to execute SELECT statement [SELECT spy_product_abstract.id_product_abstract, spy_product_abstract.fk_tax_set, spy_product_abstract.attributes, spy_product_abstract.color_code, spy_product_abstract.new_from, spy_product_abstract.new_to, spy_product_abstract.sku, spy_product_abstract.created_at, spy_product_abstract.updated_at, "spy_product_abstract_localized_attributes"."name" AS productName, spy_availability_abstract.quantity AS availabilityQuantity, GROUP_CONCAT(spy_stock_product.is_never_out_of_stock) AS concreteNeverOutOfStockSet, SUM(spy_stock_product.quantity) AS stockQuantity, GROUP_CONCAT(CONCAT("spy_product"."sku",':',"spy_oms_product_reservation"."reservation_quantity")) AS reservationQuantity FROM spy_product_abstract INNER JOIN spy_availability_abstract ON (spy_product_abstract.sku=spy_availability_abstract.abstract_sku) LEFT JOIN spy_product ON (spy_product_abstract.id_product_abstract="spy_product"."fk_product_abstract") LEFT JOIN spy_stock_product ON ("spy_product"."id_product"=spy_stock_product.fk_product AND spy_stock.id_stock=spy_stock_product.fk_stock) LEFT JOIN spy_oms_product_reservation ON ("spy_product"."sku"="spy_oms_product_reservation"."sku" AND spy_availability_abstract.fk_store="spy_oms_product_reservation"."fk_store") INNER JOIN "spy_product_abstract_localized_attributes" ON (spy_product_abstract.id_product_abstract="spy_product_abstract_localized_attributes"."fk_product_abstract") WHERE "spy_product_abstract_localized_attributes"."fk_locale"=:p1 AND spy_availability_abstract.fk_store=:p2 AND 1<>1 GROUP BY spy_product_abstract.id_product_abstract,spy_product_abstract.fk_tax_set,spy_product_abstract.attributes,spy_product_abstract.color_code,spy_product_abstract.new_from,spy_product_abstract.new_to,spy_product_abstract.sku,spy_product_abstract.created_at,spy_product_abstract.updated_at,"spy_product_abstract_localized_attributes"."name",spy_availability_abstract.quantity]
    
  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    does anyone have and idea what's going on?

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hi, dunno whats ur problem. Have you tryed to run propel:install or assigned the warehouse unter http://shop/stock-gui/warehouse/list ?

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    I've run propel:install

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    are you sure assigning a warehouse would solve the missing join problem? because it seems to me that for some reason spy_stock is not joined in this query

  • U01G4K5E0J2
    U01G4K5E0J2 Posts: 194 πŸ§‘πŸ»β€πŸš€ - Cadet

    ok, I tracked this issue to class
    vendor/spryker/availability/src/Spryker/Zed/Availability/Persistence/AvailabilityQueryContainer.php
    method querySpyProductAbstractAvailabilityWithStock
    spy_stock is joined only if $stockNames is not empty

            if (count($stockNames) > 0) {
                $joinStockProduct = (new Join())->setRightTableName(SpyStockTableMap::TABLE_NAME);
                $joinStockProduct->setJoinType(Criteria::LEFT_JOIN);
    
                $stockTypeCriterion = (new Criteria())->getNewCriterion(
                    SpyStockTableMap::COL_NAME,
                    $stockNames,
                    Criteria::IN
                );
    
                $joinStockProduct->setJoinCondition($stockTypeCriterion);
    
                $query->addJoinObject($joinStockProduct);
            }
    

    but I if I understand correctly whats going on its used in next join whether it was joined earlier or not

            $query->addJoin(
                [
                    SpyProductTableMap::COL_ID_PRODUCT,
                    SpyStockTableMap::COL_ID_STOCK,
                ],
                [
                    SpyStockProductTableMap::COL_FK_PRODUCT,
                    SpyStockProductTableMap::COL_FK_STOCK,
                ],
                Criteria::LEFT_JOIN
            )
    

    I realize that empty $stockNames is a corner case, but the fact this seems not to be checked anywhere, and one could even call this method using defalut parameter value makes me think that this method should either
    β€’ handle empty $stockNames
    β€’ disallow empty $stockNames explicitly
    Or I am entirely wrong about this πŸ™‚
    Now I wish someone from spryker peeked into this conversation πŸ™