magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

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

Open snez opened this issue 3 years ago • 7 comments

Preconditions and environment

  • Magento version 2.4.4
  • PHP 8.x

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

  • [ ] 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.
  • [X] 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”.

snez avatar Jul 28 '22 10:07 snez

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

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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.


:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

: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] avatar Jul 28 '22 10:07 m2-assistant[bot]

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:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. 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!

  • [ ] 5. Add label Issue: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

m2-assistant[bot] avatar Jul 28 '22 11:07 m2-assistant[bot]

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 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} [] []

engcom-November avatar Jul 28 '22 11:07 engcom-November

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

ryanisn avatar Aug 04 '22 18:08 ryanisn

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.

engcom-November avatar Aug 09 '22 13:08 engcom-November

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

github-jira-sync-bot avatar Aug 09 '22 13:08 github-jira-sync-bot

: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.

m2-assistant[bot] avatar Aug 09 '22 13:08 m2-assistant[bot]