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.3k forks source link

1 exception(s): Exception #0 (Exception): Warning: Undefined array key 0 in vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/Handler.php on line 515 #38399

Closed xtremevision closed 8 months ago

xtremevision commented 8 months ago

Preconditions and environment

PHP 8.1.27 (cli) (built: Dec 19 2023 20:35:55) (NTS gcc x86_64) Copyright (c) The PHP Group Zend Engine v4.1.27, Copyright (c) Zend Technologies with Zend OPcache v8.1.27, Copyright (c), by Zend Technologies with Xdebug v3.3.1, Copyright (c) 2002-2023, by Derick Rethans

Steps to reproduce

  1. Navigate to category pae
  2. Add product to cart
  3. Go to checkout

Expected result

No error message

Actual result

1 exception(s): Exception #0 (Exception): Warning: Undefined array key 0 in /home/michael/www/xxxxxxxxxx/xxxxxxxxxx/vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/Handler.php on line 515

Exception #0 (Exception): Warning: Undefined array key 0 in /home/michael/www/xxxxxxxxx/xxxxxxxxx/vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/Handler.php on line 515

#1 Cm\RedisSession\Handler->read() called at [vendor/magento/framework/Session/SaveHandler/Redis.php:98]
#2 Magento\Framework\Session\SaveHandler\Redis->read() called at [vendor/magento/framework/Session/SaveHandler.php:212]
#3 Magento\Framework\Session\SaveHandler->callSafely() called at [vendor/magento/framework/Session/SaveHandler.php:125]
#4 Magento\Framework\Session\SaveHandler->read()
#5 session_start() called at [vendor/magento/framework/Session/SessionManager.php:186]
#6 Magento\Framework\Session\SessionManager->start() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#7 Magento\Framework\Session\Generic\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#8 Magento\Framework\Session\Generic\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#9 Magento\Framework\Session\Generic\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/Session/Generic/Interceptor.php:23]
#10 Magento\Framework\Session\Generic\Interceptor->start() called at [vendor/magento/framework/Session/SessionManager.php:123]
#11 Magento\Framework\Session\SessionManager->__construct() called at [generated/code/Magento/Framework/Session/Generic/Interceptor.php:14]
#12 Magento\Framework\Session\Generic\Interceptor->__construct() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121]
#13 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() called at [vendor/magento/framework/ObjectManager/Factory/Compiled.php:108]
#14 Magento\Framework\ObjectManager\Factory\Compiled->create() called at [vendor/magento/framework/ObjectManager/Factory/Compiled.php:150]
#15 Magento\Framework\ObjectManager\Factory\Compiled->get() called at [vendor/magento/framework/ObjectManager/Factory/Compiled.php:79]
#16 Magento\Framework\ObjectManager\Factory\Compiled->create() called at [vendor/magento/framework/ObjectManager/Factory/Compiled.php:150]
#17 Magento\Framework\ObjectManager\Factory\Compiled->get() called at [vendor/magento/framework/ObjectManager/Factory/Compiled.php:79]
#18 Magento\Framework\ObjectManager\Factory\Compiled->create() called at [vendor/magento/framework/ObjectManager/Factory/Compiled.php:150]
#19 Magento\Framework\ObjectManager\Factory\Compiled->get() called at [vendor/magento/framework/ObjectManager/Factory/Compiled.php:79]
#20 Magento\Framework\ObjectManager\Factory\Compiled->create() called at [vendor/magento/framework/ObjectManager/Factory/Compiled.php:150]
#21 Magento\Framework\ObjectManager\Factory\Compiled->get() called at [vendor/magento/framework/ObjectManager/Factory/Compiled.php:125]
#22 Magento\Framework\ObjectManager\Factory\Compiled->parseArray() called at [vendor/magento/framework/ObjectManager/Factory/Compiled.php:86]
#23 Magento\Framework\ObjectManager\Factory\Compiled->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]
#24 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/App/FrontController.php:109]
#25 Magento\Framework\App\FrontController->__construct() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:14]
#26 Magento\Framework\App\FrontController\Interceptor->__construct() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121]
#27 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() called at [vendor/magento/framework/ObjectManager/Factory/Compiled.php:108]
#28 Magento\Framework\ObjectManager\Factory\Compiled->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]
#29 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/App/Http.php:115]
#30 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]
#31 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:30]

image

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 8 months ago

Hi @xtremevision. 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:

m2-assistant[bot] commented 8 months ago

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

TheRealHunzik commented 8 months ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 8 months ago

Hi @TheRealHunzik. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 8 months ago

Hi @TheRealHunzik, here is your Magento Instance: https://13419714cb153513679fd5669e6724c3.instances-prod.magento-community.engineering Admin access: https://13419714cb153513679fd5669e6724c3.instances-prod.magento-community.engineering/admin_4de8 Login: 1559d545 Password: cdd1a062be42

engcom-Bravo commented 8 months ago

Hi @xtremevision,

Thank you for reporting and collaboration.

Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.

Steps to reproduce

Screenshot from 2024-01-31 11-41-45

Screenshot from 2024-01-31 11-42-51

We are able to see the shipping methods and able to place the order.

Kindly recheck the issue in Magento 2.4-develop instance and check if any third party modules causing the issue.

Thanks.

xtremevision commented 8 months ago

Ok, I will test with Luma theme instead of the 3rd party theme, as well as by switching off custom modules / 3rd party modules.

eldaly commented 8 months ago

Hi i Have Same issue when i open multi products in one time Exception #0 (Exception): Warning: Undefined array key 0 in /vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/Handler.php on line 515

Amadeco commented 8 months ago

Good evening, I see this issue also on Magento 2.4.6-p3, redis_version:7.2.4

[2024-02-01T19:10:19.046017+00:00] main.ERROR: Warning: Undefined array key 0 in /home/amadeco/public_html/vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/Handler.php on line 515 [] [] [2024-02-01T19:10:19.046802+00:00] main.CRITICAL: Warning: Undefined array key 0 in /home/amadeco/public_html/vendor/colinmollenhour/php-redis-session-abstract/src/Cm/RedisSession/Handler.php on line 515 [] []

xtremevision commented 8 months ago

I noticed these messages today in var/log/system.log:

[2024-02-02T19:35:17.139662+00:00] main.WARNING: localhost|2475: Did not write session for ID b3f7mpdhrg0dmgkg8tlnb2uq8r: another process took the lock. /themelayoutpro/ajax/cmsblock/?blockidentifier=unlimited-furniture-newsletter-popup [] [] [2024-02-02T19:35:18.689020+00:00] main.WARNING: localhost|2478: Did not write session for ID b3f7mpdhrg0dmgkg8tlnb2uq8r: another process took the lock. /customer/section/load/?sections=&=1706902508672 [] []

Found this article: https://magento.stackexchange.com/questions/296730/redis-session-error-successfully-broke-lock-for-id-sess-ebfc12b22fa8c8e1fb81dca

I updated the values as per the accepted answer, but to be 100% safe I also created a dedicated redis instance for this site on port 6378.

So far, the checkout error has gone away, and the write session messages as well.

Could it be that I have too many sites accessing the same redis instance, albeit with different redis databases? Could it be another site is accessing the same database as this one effectively corrupting data?

hostep commented 8 months ago

Hi @xtremevision

The bug should only trigger when the setting max_concurrency gets exceeded if I understand it correctly.

According to the comments on https://github.com/colinmollenhour/php-redis-session-abstract/commit/47a1df331c16b8ed3387102933eaeac2fd52f0e8, this seems to be a bug that existed in versions 1.5.3 and 1.5.4 of the colinmollenhour/php-redis-session-abstract package. It should be fixed in version 1.5.5, could you try to update this package to the latest version and see if that solves it for you?

engcom-Bravo commented 8 months ago

@hostep Thanks for your contribution and collaboration here.

Hi @xtremevision,

Thanks for your update.

Kindly refer this comment https://github.com/magento/magento2/issues/38399#issuecomment-1925339677 and please let us know if you are still facing any issue.

Thanks.

xtremevision commented 8 months ago

I updated colinmollenhour/php-redis-session-abstract to 1.5.5 and it seems to have fixed the issue, but I'll do a bit more testing to make sure. Thanks.

engcom-Bravo commented 8 months ago

Hi @xtremevision,

Thanks for your update.

As per this comment https://github.com/magento/magento2/issues/38399#issuecomment-1932107224 We are Closing this issue Please feel free to reopen the issue if you are still facing any issue.

Thanks.