magento/magento2

"bin/magento setup:upgrade" error when upgrading database schema

yavery opened this issue · 8 comments

yavery commented

Preconditions and environment

  • Magento version: 2.4.5 (upgrading 2.4.2 database schema)

Then running bin/magento setup:upgrade
The first run will error out, but immeidately run the same command the second time, it will run through without any error

setup-upgrade-error

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entity_id' in 'NEW', query was: CREATE TRIGGER trg_catalog_category_entity_int_after_insert AFTER INSERT ON catalog_category_entity_int FOR EACH ROW
BEGIN
INSERT IGNORE INTO `catalog_category_product_cl` (`entity_id`) VALUES (NEW.`entity_id`);
END

Steps to reproduce

  1. a project with 2.4.2 database
  2. php is upgraded to 8.1
  3. updated the project to 2.4.5, assume eliminated all errors at the php code level
  4. bin/magento setup:upgrade

Expected result

first run should succeed

Actual result

first run fails, second run succeeds

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Hi @yavery. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

Hi @engcom-Dash. 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: 👇

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
    1. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

Hi @yavery ,

Verified the issue in 2.4.2 instance and the issue is not reproducible
Kindly refer the below screenshots:
Screenshot 2023-07-06 at 7 01 37 PM
Screenshot 2023-07-07 at 9 06 34 AM

Steps to reproduce:
1.Install 2.4.2 magento instance
2.upgrade to instance to 2.4.5
3.run setup upgrade command with PHP 8.1
Setup upgrade command ran successfully without any issues on first attempt.

Thanks!

Hi @yavery ,

Do you Need further investigation regarding this issue,Still we are waiting for your response, If you are providing any information about this issue it really helps us.

Thanks.

I get this error when moving from Commerce to Open Source. Maybe you did that by accident?

yavery commented

@evs-xsarus

Our upgrading is from commerce 242 to commerce 245 (245-p3)

"magento/product-enterprise-edition": "2.4.5-p3"

Hi @yavery ,

Verified the issue in adobe commerce 2.4.2 and the issue is not reproducible, We can successfully upgrade the commerce version 2.4.2 to 2.4.5-p3 without any interruptions. Kindly refer the below screenshot:
Screenshot 2023-07-31 at 9 53 07 AM

Thanks!

Hi @yavery ,

We have noticed that this issue has not been updated since long time.
Hence we assume that this issue is fixed now, so we are closing it. Please feel to raise a fresh ticket or reopen this ticket if you need more assistance on this.

Thanks.