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.48k stars 9.29k forks source link

PHP 8 crash: TypeError: strtotime(): Argument #1 ($datetime) must be of type string, null given in vendor/magento/module-security/Model/AdminSessionInfo.php:136 #35837

Open snez opened 2 years ago

snez commented 2 years ago

Preconditions and environment

Steps to reproduce

Enabled and rolled db backup as per Devdocs On running the command bin/magento setup:rollback [-c|--code-file=""] [-m|--media-file=""] [-d|--db-file=""], below php error is getting displayed on both the instances.

Expected result

Restore DB backup is successful.

Actual result

main.ERROR: SQLSTATE[HY000]: General error: 1100 Table 'queue_lock' was not locked with LOCK TABLES, query was: DELETE FROM `queue_lock` WHERE (created_at <= '2022-07-28 11:23:15') #0 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php(91): Magento\Framework\DB\Statement\Pdo\Mysql->tryExecute() #1 /var/www/html/mgce/magento2/vendor/magento/zendframework1/library/Zend/Db/Statement.php(313): Magento\Framework\DB\Statement\Pdo\Mysql->_execute() #2 /var/www/html/mgce/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute() #3 /var/www/html/mgce/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query() #4 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(564): Zend_Db_Adapter_Pdo_Abstract->query() #5 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(634): Magento\Framework\DB\Adapter\Pdo\Mysql->_query() #6 /var/www/html/mgce/magento2/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php(95): Magento\Framework\DB\Adapter\Pdo\Mysql->query() #7 /var/www/html/mgce/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(664): Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->query() #8 /var/www/html/mgce/magento2/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php(1067): Zend_Db_Adapter_Abstract->delete() #9 /var/www/html/mgce/magento2/app/code/Magento/MessageQueue/Model/ResourceModel/Lock.php(103): Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->delete() #10 /var/www/html/mgce/magento2/app/code/Magento/MessageQueue/Model/Plugin/ResourceModel/Lock.php(39): Magento\MessageQueue\Model\ResourceModel\Lock->releaseOutdatedLocks() #11 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(146): Magento\MessageQueue\Model\Plugin\ResourceModel\Lock->afterSet() #12 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Framework\App\MaintenanceMode\Interceptor->Magento\Framework\Interception\{closure}() #13 /var/www/html/mgce/magento2/generated/code/Magento/Framework/App/MaintenanceMode/Interceptor.php(32): Magento\Framework\App\MaintenanceMode\Interceptor->___callPlugins() #14 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/App/Console/MaintenanceModeEnabler.php(67): Magento\Framework\App\MaintenanceMode\Interceptor->set() #15 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/App/Console/MaintenanceModeEnabler.php(93): Magento\Framework\App\Console\MaintenanceModeEnabler->disableMaintenanceMode() #16 /var/www/html/mgce/magento2/setup/src/Magento/Setup/Console/Command/RollbackCommand.php(154): Magento\Framework\App\Console\MaintenanceModeEnabler->executeInMaintenanceMode() #17 /var/www/html/mgce/magento2/vendor/symfony/console/Command/Command.php(298): Magento\Setup\Console\Command\RollbackCommand->execute() #18 /var/www/html/mgce/magento2/vendor/symfony/console/Application.php(1024): Symfony\Component\Console\Command\Command->run() #19 /var/www/html/mgce/magento2/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand() #20 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/Console/Cli.php(116): Symfony\Component\Console\Application->doRun() #21 /var/www/html/mgce/magento2/vendor/symfony/console/Application.php(171): Magento\Framework\Console\Cli->doRun() #22 /var/www/html/mgce/magento2/bin/magento(23): Symfony\Component\Console\Application->run() #23 {main} [] []

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 2 years ago

Hi @snez. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

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:

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

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


: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, join the Community Contributions Triage session to discuss the appropriate ticket.

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

m2-assistant[bot] commented 2 years ago

Hi @engcom-November. 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-November commented 2 years ago

Thank you for reporting and collaboration @snez . Verified the issue on both Magento 2.4-develop branch and 2.4.4 project-community edition as well, but I'm getting different exception when trying to restore DB backup. Steps performed: Enabled and rolled db backup as per Devdocs On running the command bin/magento setup:rollback [-c|--code-file="<name>"] [-m|--media-file="<name>"] [-d|--db-file="<name>"], below php error is getting displayed on both the instances. image Please check and confirm if you are able to restore db backup or facing same issue/error to confirm the issue with different description.. Also provide missing steps /configuration details: 3rd party extesnions / modules enabled if any if the issue is different. Logs: ``main.ERROR: SQLSTATE[HY000]: General error: 1100 Table 'queue_lock' was not locked with LOCK TABLES, query was: DELETE FROMqueue_lock` WHERE (created_at <= '2022-07-28 11:23:15')

0 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php(91): Magento\Framework\DB\Statement\Pdo\Mysql->tryExecute()

1 /var/www/html/mgce/magento2/vendor/magento/zendframework1/library/Zend/Db/Statement.php(313): Magento\Framework\DB\Statement\Pdo\Mysql->_execute()

2 /var/www/html/mgce/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute()

3 /var/www/html/mgce/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query()

4 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(564): Zend_Db_Adapter_Pdo_Abstract->query()

5 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(634): Magento\Framework\DB\Adapter\Pdo\Mysql->_query()

6 /var/www/html/mgce/magento2/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php(95): Magento\Framework\DB\Adapter\Pdo\Mysql->query()

7 /var/www/html/mgce/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(664): Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->query()

8 /var/www/html/mgce/magento2/generated/code/Magento/Framework/DB/Adapter/Pdo/Mysql/Interceptor.php(1067): Zend_Db_Adapter_Abstract->delete()

9 /var/www/html/mgce/magento2/app/code/Magento/MessageQueue/Model/ResourceModel/Lock.php(103): Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor->delete()

10 /var/www/html/mgce/magento2/app/code/Magento/MessageQueue/Model/Plugin/ResourceModel/Lock.php(39): Magento\MessageQueue\Model\ResourceModel\Lock->releaseOutdatedLocks()

11 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(146): Magento\MessageQueue\Model\Plugin\ResourceModel\Lock->afterSet()

12 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Framework\App\MaintenanceMode\Interceptor->Magento\Framework\Interception{closure}()

13 /var/www/html/mgce/magento2/generated/code/Magento/Framework/App/MaintenanceMode/Interceptor.php(32): Magento\Framework\App\MaintenanceMode\Interceptor->___callPlugins()

14 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/App/Console/MaintenanceModeEnabler.php(67): Magento\Framework\App\MaintenanceMode\Interceptor->set()

15 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/App/Console/MaintenanceModeEnabler.php(93): Magento\Framework\App\Console\MaintenanceModeEnabler->disableMaintenanceMode()

16 /var/www/html/mgce/magento2/setup/src/Magento/Setup/Console/Command/RollbackCommand.php(154): Magento\Framework\App\Console\MaintenanceModeEnabler->executeInMaintenanceMode()

17 /var/www/html/mgce/magento2/vendor/symfony/console/Command/Command.php(298): Magento\Setup\Console\Command\RollbackCommand->execute()

18 /var/www/html/mgce/magento2/vendor/symfony/console/Application.php(1024): Symfony\Component\Console\Command\Command->run()

19 /var/www/html/mgce/magento2/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand()

20 /var/www/html/mgce/magento2/lib/internal/Magento/Framework/Console/Cli.php(116): Symfony\Component\Console\Application->doRun()

21 /var/www/html/mgce/magento2/vendor/symfony/console/Application.php(171): Magento\Framework\Console\Cli->doRun()

22 /var/www/html/mgce/magento2/bin/magento(23): Symfony\Component\Console\Application->run()

23 {main} [] []```

ryanisn commented 2 years ago

Seem to be fixed in https://github.com/magento/magento2/issues/34531 Which is surprisingly not in 2.4.4 as the PR was merged back in Feb

engcom-November commented 2 years ago

As different exception/error is observed on Magento 2.4-develop branch as mentioned above here, confirming the issue by updating description with current behavior.

github-jira-sync-bot commented 2 years ago

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

m2-assistant[bot] commented 2 years ago

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