Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Update Magento Error in SchemaBuilder.php at line: 253 #38592

Closed
1 of 5 tasks
nomis11uk opened this issue Apr 9, 2024 · 25 comments
Closed
1 of 5 tasks

Unable to Update Magento Error in SchemaBuilder.php at line: 253 #38592

nomis11uk opened this issue Apr 9, 2024 · 25 comments
Labels
Area: Upgrades - Upgrade Compatibility Tool Component: DB Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P0 This generally occurs in cases when the entire functionality is blocked. Progress: done Reported on 2.4.7 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@nomis11uk
Copy link

nomis11uk commented Apr 9, 2024

Preconditions and environment

ver. 2.4.6-p4
PHP 8.2

Steps to reproduce

  1. php82 composer.phar require magento/product-community-edition 2.4.7 --no-update
  2. php82 composer.phar update
  3. php82 bin/magento setup:upgrade

Note : The issue occurs when the database prefix is added with more than 4 characters eg: --db-prefix=tsts_

Expected result

Update comple

Actual result

Updating modules:
Schema creation/updates:

There is an error in vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php at line: 253
Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder::processTable(): Return value must be of type Magento\Framework\Setup\Declaration\Schema\Dto\Table, bool returned#0 vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php(150): Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder->processTable(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema), Array)
#1 vendor/magento/framework/Setup/Declaration/Schema/SchemaConfig.php(78): Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder->build(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema))
#2 setup/src/Magento/Setup/Model/DeclarationInstaller.php(57): Magento\Framework\Setup\Declaration\Schema\SchemaConfig->getDeclarationConfig()
#3 setup/src/Magento/Setup/Model/Installer.php(868): Magento\Setup\Model\DeclarationInstaller->installSchema(Array)
#4 setup/src/Magento/Setup/Model/Installer.php(916): Magento\Setup\Model\Installer->declarativeInstallSchema(Array)
#5 setup/src/Magento/Setup/Console/Command/UpgradeCommand.php(147): Magento\Setup\Model\Installer->installSchema(Array)
#6 vendor/symfony/console/Command/Command.php(326): Magento\Setup\Console\Command\UpgradeCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 vendor/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(Magento\Setup\Console\Command\UpgradeCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 vendor/magento/framework/Console/Cli.php(118): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 vendor/symfony/console/Application.php(175): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 bin/magento(23): Symfony\Component\Console\Application->run()
#12 {main}

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”.
Copy link

m2-assistant bot commented Apr 9, 2024

Hi @nomis11uk. 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.

@engcom-Dash engcom-Dash added the Reported on 2.4.6-p4 Indicates original Magento version for the Issue report. label Apr 9, 2024
@engcom-Dash engcom-Dash self-assigned this Apr 9, 2024
Copy link

m2-assistant bot commented Apr 9, 2024

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!

@likearocket
Copy link

I also encountered this error when attempting to upgrade 2.4.6-p4 to 2.4.7.

@prbt2016
Copy link

Hello ,

I encountered the same error while fresh installing Magento 2.4.7 community edition on Centos 7 with Apache 2.4, PHP 8.2/8.3 , MYSQL 8 i.e on executing ./bin/magento setup:install {{PARAMS}} :

There is an error in /{{PATH}}/{{TO}}/{{MAGENTO}}/vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php at line: 253
Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder::processTable(): Return value must be of type Magento\Framework\Setup\Declaration\Schema\Dto\Table, bool returned#0 /{{PATH}}/{{TO}}/{{MAGENTO}}/vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php(150): Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder->processTable(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema), Array)
#1 /{{PATH}}/{{TO}}/{{MAGENTO}}/vendor/magento/framework/Setup/Declaration/Schema/SchemaConfig.php(78): Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder->build(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema))
#2 /{{PATH}}/{{TO}}/{{MAGENTO}}/setup/src/Magento/Setup/Model/DeclarationInstaller.php(57): Magento\Framework\Setup\Declaration\Schema\SchemaConfig->getDeclarationConfig()
#3 /{{PATH}}/{{TO}}/{{MAGENTO}}/setup/src/Magento/Setup/Model/Installer.php(868): Magento\Setup\Model\DeclarationInstaller->installSchema(Array)
#4 /{{PATH}}/{{TO}}/{{MAGENTO}}/setup/src/Magento/Setup/Model/Installer.php(916): Magento\Setup\Model\Installer->declarativeInstallSchema(Array)
#5 [internal function]: Magento\Setup\Model\Installer->installSchema(Array)
#6 /{{PATH}}/{{TO}}/{{MAGENTO}}/setup/src/Magento/Setup/Model/Installer.php(407): call_user_func_array(Array, Array)
#7 /{{PATH}}/{{TO}}/{{MAGENTO}}/setup/src/Magento/Setup/Console/Command/InstallCommand.php(237): Magento\Setup\Model\Installer->install(Array)
#8 /{{PATH}}/{{TO}}/{{MAGENTO}}/vendor/symfony/console/Command/Command.php(326): Magento\Setup\Console\Command\InstallCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /{{PATH}}/{{TO}}/{{MAGENTO}}/vendor/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /{{PATH}}/{{TO}}/{{MAGENTO}}/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(Magento\Setup\Console\Command\InstallCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /{{PATH}}/{{TO}}/{{MAGENTO}}/vendor/magento/framework/Console/Cli.php(118): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /{{PATH}}/{{TO}}/{{MAGENTO}}/vendor/symfony/console/Application.php(175): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /{{PATH}}/{{TO}}/{{MAGENTO}}/bin/magento(23): Symfony\Component\Console\Application->run()
#14 {main}

Is this a known bug?. Could you please replicate this at your end?.

@devchris79
Copy link

devchris79 commented Apr 15, 2024

Also seeing this on upgrade from 2.4.6-p4 to 2.4.7

It seems like it may be related to this issue #37756, but I don't know why it works fine in 2.4.6-p4 and 2.4.7 throws an error.
We do have a small prefix on database table names, buts only 4 characters and then a underscore character.

@nomis11uk
Copy link
Author

Yes, we also have a prefix (4 characters) in database table names and get the error.

@likearocket
Copy link

4 character prefix here too. So we know what the problem is, question is how to resolve and how long?

@engcom-Dash
Copy link

Hi @nomis11uk

Thanks for reporting and collaboration.

Verified the issue by upgrading the instance from 2.4.6-p4 to 2.4.7 and the issue is not reproducible. Able to upgrade successfully.

Steps to reproduce

  1. php82 composer.phar require magento/product-community-edition 2.4.7 --no-update
  2. php82 composer.phar update
    3.php82 bin/magento setup:upgrade

Please refer the attached screenshots and let us know if we missed anything.

Screenshot 2024-04-15 at 5 13 27 PM Screenshot 2024-04-15 at 5 16 45 PM

@engcom-Dash engcom-Dash added the Issue: needs update Additional information is require, waiting for response label Apr 15, 2024
@nomis11uk
Copy link
Author

@engcom-Dash do you have a prefix in database?

@devchris79
Copy link

I am wondering if this is some strange effect of an old version of Mariadb (we are on a shared server using 10.3.39 and 10.6 is the current tested requirement) or an extension/theme issue. We don't really have many extensions though, Porto, Ebizmarts, Vnecomms, Owebia, Mageplaza core and that's about it.

@nomis11uk @likearocket are you running Mariadb 10.6?

@likearocket
Copy link

Mariadb 10.6 here.

@nomis11uk
Copy link
Author

MySQL 5.7.44-48

@devchris79
Copy link

devchris79 commented Apr 15, 2024

I took our server down for a bit to test what table was throwing this error, hopefully it will shed some light for someone far more clued up than me!

I added a print of the table names to the upgrade output, on line 253 of /vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php:

print $tableData['name'];
print "\n";

The final line printed that presumably is the table causing the issue is:
payment_services_order_status_data_production_submitted_hash

I don't know if that helps???

@devchris79
Copy link

devchris79 commented Apr 15, 2024

OK, this looks like its been added in 2.4.7

The table name of payment_services_order_status_data_production_submitted_hash is too long in my opinion, its 60 characters and adding my prefix of 5 characters takes it to 65 and is beyond the Mariadb limit of 64 characters.

@engcom-Dash This is obviously going to affect alot of users who have a prefix on the database, are we going to have to look into reducing the prefix or do you think the table name size needs reducing?

@engcom-Dash
Copy link

Hi @nomis11uk

Verified the issue again with prefix but we are still not able to reproduce the issue.

We have upgraded from 2.4.6-p4 to 2.4.7.

Please refer the attached screenshots.

Screenshot 2024-04-16 at 4 54 57 PM Screenshot 2024-04-16 at 4 55 05 PM

@nomis11uk
Copy link
Author

Hi @engcom-Dash
Please can you confirm the prefix length used? Was it 4 characters?

@engcom-Dash
Copy link

Hi @nomis11uk

I have used --db-prefix=tsts as prefix.

Thanks.

@nomis11uk
Copy link
Author

@engcom-Dash please can you try with one more character e.g 'tsts_'

@engcom-Dash
Copy link

Hi @nomis11uk

Sure, will try and update the status.

Thanks.

@engcom-Dash
Copy link

engcom-Dash commented Apr 17, 2024

Hi @nomis11uk

Verified the issue on 2.4.7 after upgrading the instance from 2.4.6-p4 and the issue is reproducable.

Hence, Confirming the issue.

Steps to reproduce

  1. php82 composer.phar require magento/product-community-edition 2.4.7 --no-update
  2. php82 composer.phar update
  3. php82 bin/magento setup:upgrade

We are getting the below error when we have database prefix with more than 4 characters eg: --db-prefix=tsts_

There is an error in vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php at line: 253
Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder::processTable(): Return value must be of type Magento\Framework\Setup\Declaration\Schema\Dto\Table, bool returned#0 vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php(150): Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder->processTable(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema), Array)
#1 vendor/magento/framework/Setup/Declaration/Schema/SchemaConfig.php(78): Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder->build(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema))
#2 setup/src/Magento/Setup/Model/DeclarationInstaller.php(57): Magento\Framework\Setup\Declaration\Schema\SchemaConfig->getDeclarationConfig()
#3 setup/src/Magento/Setup/Model/Installer.php(868): Magento\Setup\Model\DeclarationInstaller->installSchema(Array)
#4 setup/src/Magento/Setup/Model/Installer.php(916): Magento\Setup\Model\Installer->declarativeInstallSchema(Array)
#5 setup/src/Magento/Setup/Console/Command/UpgradeCommand.php(147): Magento\Setup\Model\Installer->installSchema(Array)
#6 vendor/symfony/console/Command/Command.php(326): Magento\Setup\Console\Command\UpgradeCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 vendor/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(Magento\Setup\Console\Command\UpgradeCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 vendor/magento/framework/Console/Cli.php(118): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 vendor/symfony/console/Application.php(175): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 bin/magento(23): Symfony\Component\Console\Application->run()
#12 {main}

Please refer the attached screenshot.

38592_Confirmed

@engcom-Dash engcom-Dash added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Component: DB Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch labels Apr 17, 2024
@m2-community-project m2-community-project bot removed the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Apr 17, 2024
@m2-community-project m2-community-project bot removed the Issue: needs update Additional information is require, waiting for response label Apr 17, 2024
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-11806 is successfully created for this GitHub issue.

@m2-community-project m2-community-project bot added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Apr 17, 2024
Copy link

m2-assistant bot commented Apr 17, 2024

✅ Confirmed by @engcom-Dash. Thank you for verifying the issue.
Issue Available: @engcom-Dash, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@github-jira-sync-bot
Copy link

❌ You don't have permission to export this issue.

@engcom-Delta engcom-Delta added the Priority: P0 This generally occurs in cases when the entire functionality is blocked. label Apr 17, 2024
@devchris79
Copy link

@engcom-Dash The label you have added is for 2.4.6-P4, but this is actually an error in 2.4.7.

The issue is the new table in 2.4.7 payment_services_order_status_data_production_submitted_hash being 60 characters long, adding a 5 character prefix takes it beyond a Mariadb limit of 64 characters.

I don't know if there is any officially documented maximum prefix length, but most guides tend to be 5 characters.

@engcom-Dash engcom-Dash added Reported on 2.4.7 Indicates original Magento version for the Issue report. and removed Reported on 2.4.6-p4 Indicates original Magento version for the Issue report. labels Apr 18, 2024
@chernenm
Copy link

The fix for this issue has just been released in scope of a new Payment Services package version 2.5.0, the package is available at repo.magento.com
If you are already on 2.4.7 please run
composer require magento/payment-services:2.5.0 --with-all-dependencies to get the latest version.
If you are upgrading to 2.4.7 the latest package will be used automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Upgrades - Upgrade Compatibility Tool Component: DB Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P0 This generally occurs in cases when the entire functionality is blocked. Progress: done Reported on 2.4.7 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Development

No branches or pull requests

8 participants