magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.31k forks source link

signifyd table used in sales-archive di.xml, but module is not required #33400

Closed riconeitzel closed 3 years ago

riconeitzel commented 3 years ago

Preconditions (*)

Magento Commerce Edition, 2.3 and 2.4

To prevent the installation of not required modules we used composer's "replace" feature to strip out unnecessary core modules from the magento meta package. This should improve performance as not required functionality is not even installed.

    "replace": {
        "amzn/amazon-pay-and-login-magento-2-module": "*",
        "amzn/amazon-pay-and-login-with-amazon-core-module": "*",
        "amzn/amazon-pay-module": "*",
        "amzn/amazon-pay-sdk-php": "*",
        "amzn/login-with-amazon-module": "*",
        "dotmailer/dotmailer-magento2-extension": "*",
        "dotmailer/dotmailer-magento2-extension-package": "*",
        "dotmailer/dotmailer-magento2-extension-enterprise": "*",
        "dotmailer/dotmailer-magento2-extension-chat": "*",
        "klarna/m2-payments": "*",
        "klarna/module-core": "*",
        "klarna/module-kp": "*",
        "klarna/module-ordermanagement": "*",
        "temando/module-shipping": "*",
        "temando/module-shipping-m2": "*",
        "temando/module-shipping-remover": "*",
        "vertex/product-magento-module": "*",
        "vertex/module-tax": "*",
        "vertex/sdk": "*",
        "vertex/module-address-validation": "*",
        "yotpo/magento2-module-yotpo-reviews": "*",
        "yotpo/magento2-module-yotpo-reviews-bundle": "*",
        "astock/stock-api-libphp": "*",
        "magento/adobe-stock-integration": "*",
        "magento/module-adobe-ims": "*",
        "magento/module-adobe-ims-api": "*",
        "magento/module-adobe-stock-admin-ui": "*",
        "magento/module-adobe-stock-asset": "*",
        "magento/module-adobe-stock-asset-api": "*",
        "magento/module-adobe-stock-client": "*",
        "magento/module-adobe-stock-client-api": "*",
        "magento/module-adobe-stock-image": "*",
        "magento/module-adobe-stock-image-admin-ui": "*",
        "magento/module-adobe-stock-image-api": "*",
        "magento/google-shopping-ads": "*",
        "magento/module-authorizenet": "*",
        "magento/module-authorizenet-acceptjs": "*",
        "magento/module-authorizenet-cardinal": "*",
        "magento/module-cybersource": "*",
        "magento/module-dhl": "*",
        "magento/module-eway": "*",
        "magento/module-fedex": "*",
        "magento/module-google-adwords": "*",
        "magento/module-google-optimizer": "*",
        "magento/module-marketplace": "*",
        "magento/module-new-relic-reporting": "*",
        "magento/module-sample-data": "*",
        "magento/module-signifyd": "*",
        "magento/module-swagger": "*",
        "magento/module-swagger-webapi": "*",
        "magento/module-swagger-webapi-async": "*",
        "magento/module-tax-import-export": "*",
        "magento/module-ups": "*",
        "magento/module-usps": "*",
        "magento/module-version": "*",
        "magento/module-worldpay": "*",
        "magento/module-bundle-sample-data": "*",
        "magento/module-catalog-rule-sample-data": "*",
        "magento/module-catalog-sample-data": "*",
        "magento/module-cms-sample-data": "*",
        "magento/module-configurable-sample-data": "*",
        "magento/module-customer-sample-data": "*",
        "magento/module-downloadable-sample-data": "*",
        "magento/module-grouped-product-sample-data": "*",
        "magento/module-msrp-sample-data": "*",
        "magento/module-offline-shipping-sample-data": "*",
        "magento/module-product-links-sample-data": "*",
        "magento/module-review-sample-data": "*",
        "magento/module-sales-rule-sample-data": "*",
        "magento/module-sales-sample-data": "*",
        "magento/module-swatches-sample-data": "*",
        "magento/module-tax-sample-data": "*",
        "magento/module-theme-sample-data": "*",
        "magento/module-widget-sample-data": "*",
        "magento/module-wishlist-sample-data": "*",
        "magento/sample-data-media": "*",
        "magento/language-es_es": "*",
        "magento/language-fr_fr": "*",
        "magento/language-nl_nl": "*",
        "magento/language-pt_br": "*",
        "magento/language-zh_hans_cn": "*"
    },

Steps to reproduce (*)

  1. Install magento with the composer.json addition above
  2. place some orders
  3. rebuild the sales_order_archive_grid table

Expected result (*)

  1. updated archive grid table
  2. not errors in log files

Actual result (*)

INSERT INTO `magento_sales_order_grid_archive` (`refunded_to_store_credit`, `entity_id`, `status`, `store_id`, `store_name`, `customer_id`, `base_grand_total`, `base_total_paid`, `grand_total`, `total_paid`, `increment_id`, `base_currency_code`, `order_currency_code`, `shipping_name`, `billing_name`, `created_at`, `updated_at`, `billing_address`, `shipping_address`, `shipping_information`, `customer_email`, `customer_group`, `subtotal`, `shipping_and_handling`, `customer_name`, `payment_method`, `total_refunded`, `signifyd_guarantee_status`) SELECT sales_order.customer_bal_total_refunded AS `refunded_to_store_credit`, sales_order.entity_id AS `entity_id`, sales_order.status AS `status`, sales_order.store_id AS `store_id`, sales_order.store_name AS `store_name`, sales_order.customer_id AS `customer_id`, sales_order.base_grand_total AS `base_grand_total`, sales_order.base_total_paid AS `base_total_paid`, sales_order.grand_total AS `grand_total`, sales_order.total_paid AS `total_paid`, sales_order.increment_id AS `increment_id`, sales_order.base_currency_code AS `base_currency_code`, sales_order.order_currency_code AS `order_currency_code`, TRIM(CONCAT_WS(' ', IF(`sales_shipping_address`.`firstname` <> '', `sales_shipping_address`.`firstname`, NULL), IF(`sales_shipping_address`.`lastname` <> '', `sales_shipping_address`.`lastname`, NULL))) AS `shipping_name`, TRIM(CONCAT_WS(' ', IF(`sales_billing_address`.`firstname` <> '', `sales_billing_address`.`firstname`, NULL), IF(`sales_billing_address`.`lastname` <> '', `sales_billing_address`.`lastname`, NULL))) AS `billing_name`, sales_order.created_at AS `created_at`, sales_order.updated_at AS `updated_at`, TRIM(CONCAT_WS(',', IF(`sales_billing_address`.`company` <> '', `sales_billing_address`.`company`, NULL), IF(`sales_billing_address`.`street` <> '', `sales_billing_address`.`street`, NULL), IF(`sales_billing_address`.`city` <> '', `sales_billing_address`.`city`, NULL), IF(`sales_billing_address`.`region` <> '', `sales_billing_address`.`region`, NULL), IF(`sales_billing_address`.`postcode` <> '', `sales_billing_address`.`postcode`, NULL))) AS `billing_address`, TRIM(CONCAT_WS(',', IF(`sales_shipping_address`.`company` <> '', `sales_shipping_address`.`company`, NULL), IF(`sales_shipping_address`.`street` <> '', `sales_shipping_address`.`street`, NULL), IF(`sales_shipping_address`.`city` <> '', `sales_shipping_address`.`city`, NULL), IF(`sales_shipping_address`.`region` <> '', `sales_shipping_address`.`region`, NULL), IF(`sales_shipping_address`.`postcode` <> '', `sales_shipping_address`.`postcode`, NULL))) AS `shipping_address`, sales_order.shipping_description AS `shipping_information`, sales_order.customer_email AS `customer_email`, sales_order.customer_group_id AS `customer_group`, sales_order.base_subtotal AS `subtotal`, sales_order.base_shipping_amount AS `shipping_and_handling`, TRIM(CONCAT_WS(' ', IF(`sales_order`.`customer_firstname` <> '', `sales_order`.`customer_firstname`, NULL), IF(`sales_order`.`customer_lastname` <> '', `sales_order`.`customer_lastname`, NULL))) AS `customer_name`, sales_order_payment.method AS `payment_method`, sales_order.total_refunded AS `total_refunded`, signifyd_case.guarantee_disposition AS `signifyd_guarantee_status` FROM `sales_order`
 LEFT JOIN `sales_order_address` AS `sales_shipping_address` ON sales_order.shipping_address_id = sales_shipping_address.entity_id
 LEFT JOIN `sales_order_address` AS `sales_billing_address` ON sales_order.billing_address_id = sales_billing_address.entity_id
 LEFT JOIN `sales_order_payment` ON sales_order.entity_id = sales_order_payment.parent_id
 LEFT JOIN `signifyd_case` ON sales_order.entity_id = signifyd_case.order_id WHERE (sales_order.entity_id = '2') ON DUPLICATE KEY UPDATE `refunded_to_store_credit` = VALUES(`refunded_to_store_credit`), `entity_id` = VALUES(`entity_id`), `status` = VALUES(`status`), `store_id` = VALUES(`store_id`), `store_name` = VALUES(`store_name`), `customer_id` = VALUES(`customer_id`), `base_grand_total` = VALUES(`base_grand_total`), `base_total_paid` = VALUES(`base_total_paid`), `grand_total` = VALUES(`grand_total`), `total_paid` = VALUES(`total_paid`), `increment_id` = VALUES(`increment_id`), `base_currency_code` = VALUES(`base_currency_code`), `order_currency_code` = VALUES(`order_currency_code`), `shipping_name` = VALUES(`shipping_name`), `billing_name` = VALUES(`billing_name`), `created_at` = VALUES(`created_at`), `updated_at` = VALUES(`updated_at`), `billing_address` = VALUES(`billing_address`), `shipping_address` = VALUES(`shipping_address`), `shipping_information` = VALUES(`shipping_information`), `customer_email` = VALUES(`customer_email`), `customer_group` = VALUES(`customer_group`), `subtotal` = VALUES(`subtotal`), `shipping_and_handling` = VALUES(`shipping_and_handling`), `customer_name` = VALUES(`customer_name`), `payment_method` = VALUES(`payment_method`), `total_refunded` = VALUES(`total_refunded`), `signifyd_guarantee_status` = VALUES(`signifyd_guarantee_status`) {"exception":"[object] (Zend_Db_Statement_Exception(code: 42): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db-1.signifyd_case' doesn't exist, query was: INSERT INTO `magento_sales_order_grid_archive` (`refunded_to_store_credit`, `entity_id`, `status`, `store_id`, `store_name`, `customer_id`, `base_grand_total`, `base_total_paid`, `grand_total`, `total_paid`, `increment_id`, `base_currency_code`, `order_currency_code`, `shipping_name`, `billing_name`, `created_at`, `updated_at`, `billing_address`, `shipping_address`, `shipping_information`, `customer_email`, `customer_group`, `subtotal`, `shipping_and_handling`, `customer_name`, `payment_method`, `total_refunded`, `signifyd_guarantee_status`) SELECT sales_order.customer_bal_total_refunded AS `refunded_to_store_credit`, sales_order.entity_id AS `entity_id`, sales_order.status AS `status`, sales_order.store_id AS `store_id`, sales_order.store_name AS `store_name`, sales_order.customer_id AS `customer_id`, sales_order.base_grand_total AS `base_grand_total`, sales_order.base_total_paid AS `base_total_paid`, sales_order.grand_total AS `grand_total`, sales_order.total_paid AS `total_paid`, sales_order.increment_id AS `increment_id`, sales_order.base_currency_code AS `base_currency_code`, sales_order.order_currency_code AS `order_currency_code`, TRIM(CONCAT_WS(' ', IF(`sales_shipping_address`.`firstname` <> '', `sales_shipping_address`.`firstname`, NULL), IF(`sales_shipping_address`.`lastname` <> '', `sales_shipping_address`.`lastname`, NULL))) AS `shipping_name`, TRIM(CONCAT_WS(' ', IF(`sales_billing_address`.`firstname` <> '', `sales_billing_address`.`firstname`, NULL), IF(`sales_billing_address`.`lastname` <> '', `sales_billing_address`.`lastname`, NULL))) AS `billing_name`, sales_order.created_at AS `created_at`, sales_order.updated_at AS `updated_at`, TRIM(CONCAT_WS(',', IF(`sales_billing_address`.`company` <> '', `sales_billing_address`.`company`, NULL), IF(`sales_billing_address`.`street` <> '', `sales_billing_address`.`street`, NULL), IF(`sales_billing_address`.`city` <> '', `sales_billing_address`.`city`, NULL), IF(`sales_billing_address`.`region` <> '', `sales_billing_address`.`region`, NULL), IF(`sales_billing_address`.`postcode` <> '', `sales_billing_address`.`postcode`, NULL))) AS `billing_address`, TRIM(CONCAT_WS(',', IF(`sales_shipping_address`.`company` <> '', `sales_shipping_address`.`company`, NULL), IF(`sales_shipping_address`.`street` <> '', `sales_shipping_address`.`street`, NULL), IF(`sales_shipping_address`.`city` <> '', `sales_shipping_address`.`city`, NULL), IF(`sales_shipping_address`.`region` <> '', `sales_shipping_address`.`region`, NULL), IF(`sales_shipping_address`.`postcode` <> '', `sales_shipping_address`.`postcode`, NULL))) AS `shipping_address`, sales_order.shipping_description AS `shipping_information`, sales_order.customer_email AS `customer_email`, sales_order.customer_group_id AS `customer_group`, sales_order.base_subtotal AS `subtotal`, sales_order.base_shipping_amount AS `shipping_and_handling`, TRIM(CONCAT_WS(' ', IF(`sales_order`.`customer_firstname` <> '', `sales_order`.`customer_firstname`, NULL), IF(`sales_order`.`customer_lastname` <> '', `sales_order`.`customer_lastname`, NULL))) AS `customer_name`, sales_order_payment.method AS `payment_method`, sales_order.total_refunded AS `total_refunded`, signifyd_case.guarantee_disposition AS `signifyd_guarantee_status` FROM `sales_order`
 LEFT JOIN `sales_order_address` AS `sales_shipping_address` ON sales_order.shipping_address_id = sales_shipping_address.entity_id
 LEFT JOIN `sales_order_address` AS `sales_billing_address` ON sales_order.billing_address_id = sales_billing_address.entity_id
 LEFT JOIN `sales_order_payment` ON sales_order.entity_id = sales_order_payment.parent_id
 LEFT JOIN `signifyd_case` ON sales_order.entity_id = signifyd_case.order_id WHERE (sales_order.entity_id = '2') ON DUPLICATE KEY UPDATE `refunded_to_store_credit` = VALUES(`refunded_to_store_credit`), `entity_id` = VALUES(`entity_id`), `status` = VALUES(`status`), `store_id` = VALUES(`store_id`), `store_name` = VALUES(`store_name`), `customer_id` = VALUES(`customer_id`), `base_grand_total` = VALUES(`base_grand_total`), `base_total_paid` = VALUES(`base_total_paid`), `grand_total` = VALUES(`grand_total`), `total_paid` = VALUES(`total_paid`), `increment_id` = VALUES(`increment_id`), `base_currency_code` = VALUES(`base_currency_code`), `order_currency_code` = VALUES(`order_currency_code`), `shipping_name` = VALUES(`shipping_name`), `billing_name` = VALUES(`billing_name`), `created_at` = VALUES(`created_at`), `updated_at` = VALUES(`updated_at`), `billing_address` = VALUES(`billing_address`), `shipping_address` = VALUES(`shipping_address`), `shipping_information` = VALUES(`shipping_information`), `customer_email` = VALUES(`customer_email`), `customer_group` = VALUES(`customer_group`), `subtotal` = VALUES(`subtotal`), `shipping_and_handling` = VALUES(`shipping_and_handling`), `customer_name` = VALUES(`customer_name`), `payment_method` = VALUES(`payment_method`), `total_refunded` = VALUES(`total_refunded`), `signifyd_guarantee_status` = VALUES(`signifyd_guarantee_status`)

here you can see the two LEFT JOIN signifyd_case which are the result of the following entry in vendor/magento/module-sales-archive/etc/di.xml

    <virtualType name="Magento\SalesArchive\Model\ResourceModel\Order\Grid" type="Magento\Sales\Model\ResourceModel\Grid">
        <arguments>
            …
            <argument name="columns" xsi:type="array">
                 …
                <item name="signifyd_guarantee_status" xsi:type="string">signifyd_case.guarantee_disposition</item>
            </argument>
        </arguments>
    </virtualType>

m2-assistant[bot] commented 3 years ago

Hi @riconeitzel. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 3 years ago

Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Delta commented 3 years ago

Hi @riconeitzel, Actual result is not understandable , Request to provide clear steps to get actual results.Hence added label 'Needs Update'

Thanks

riconeitzel commented 3 years ago

@engcom-Delta What exactly is not understandable?

The cause of the issue is:

In the di.xml of the salesarchive module is a hardcoded reference to the sygnifyd_case table … but that table doesn't exists as the module was never installed. This kind of hard dependency breaks the pluggability of modules.

engcom-Delta commented 3 years ago

Hi @riconeitzel, Kindly help me in understanding @step 3 "rebuild the sales_order_archive_grid table".How to do it please?

Thanks

navarr commented 3 years ago

I don't see Signifyd in SalesArchive's di.xml in 2.4.2-p1

Check if your version of SalesArchive's composer.json requires magento/module-signifyd. If so, this is not a bug - you've told composer that Signifyd is installed (via "replace") so the necessary code could not be pulled in.

riconeitzel commented 3 years ago

@navarr no, it's just in the "suggest" section

    "suggest": {
        "magento/module-signifyd": "100.3.*"
    },

I will verify with 2.4.2-p1 once I have time to download a copy.

engcom-Delta commented 3 years ago

Hi @riconeitzel,

Any update on this ticket please ?

Thanks

engcom-Hotel commented 3 years ago

Dear @riconeitzel,

We have noticed that this ticket has not been updated for a period of more than 14 Days. Hence we assume that this issue is fixed now, so we are closing it. Please raise a fresh ticket or reopen this ticket if you need more assistance on this.

Regards