Giter Club home page Giter Club logo

Comments (17)

arosenhagen avatar arosenhagen commented on July 21, 2024

I have a similar issue on final PHP 7.0 whereas I can overcome your issue with the directions mentioned in http://www.code007.ro/making-work-magento-with-php-7-rc1
But after patching this I always get a 502 Bad Gateway through nginx.

from cm_redissession.

sergeykalenyuk avatar sergeykalenyuk commented on July 21, 2024

@craigcarnell I have tested saving sessions in database with PHP 7.0.0 and both: enabled and disabled Cm_RedisSession. The error is the same. According to my testing the error not related to Cm_RedisSession but rather to a bug with PHP 7.0.0.
@arosenhagen thanks for sharing the solution. It would be better to not rewriting the getData, setData, unsetData but having a fix for PHP but I cannot find any related open bug: https://bugs.php.net/search.php?cmd=display&search_for=session_regenerate_id&x=9&y=5.

from cm_redissession.

arosenhagen avatar arosenhagen commented on July 21, 2024

Yes just stumbled upon Inchoo/Inchoo_PHP7#4 which mentions a rather old bug from the RCs of PHP7 (https://bugs.php.net/bug.php?id=70520). This should indeed be a more "global" problem to either ZEND Framework or PHP7 itself.

from cm_redissession.

ivanweiler avatar ivanweiler commented on July 21, 2024

Hello all, I didn't had time to test Redis, but it seems that similar problem with Db session handler and php7 is that Mage_Core_Model_Resource_Session::read($sessId) was returning false when called on session_regenerate_id(true), since there is no session at that point, and just casting return to string fixed the problem. Php5 was ok with false, php7 isn't.

And I was getting similar error with db session handler:
session_regenerate_id(): Failed to create(read) session ID: user (path: )

Can maybe someone check if it's the same problem? Just make sure string is always returned at
https://github.com/colinmollenhour/Cm_RedisSession/blob/master/code/Model/Session.php#L387

Regards

from cm_redissession.

JustinElst avatar JustinElst commented on July 21, 2024

I have applied the fix that resulted from: Inchoo/Inchoo_PHP7#4
The mysql database issue is fixed with that.
But now I have the same 502 Bad Gateway' message that @arosenhagen had using the redis sessions. I have no idea where to start investigating that issue...

from cm_redissession.

colinmollenhour avatar colinmollenhour commented on July 21, 2024

I added the string casting, but in the normal case it should have already worked. The only case the string casting should matter is if the session data read was not able to be decoded for some reason..

Has anyone tried with no compression or with different compression algorithms?

from cm_redissession.

arosenhagen avatar arosenhagen commented on July 21, 2024

@colinmollenhour tested this also moments ago - the error is still there and it looks more like an issue with redis itself. now trying to test against very latest phpredis.

from cm_redissession.

johnbendi avatar johnbendi commented on July 21, 2024

What's the status of this thing?

from cm_redissession.

colinmollenhour avatar colinmollenhour commented on July 21, 2024

Based on 7.0.3 changelog it sounds like the session issues should be fixed. Anyone tested latest Cm_RedisSession with PHP 7.0.3?

from cm_redissession.

arosenhagen avatar arosenhagen commented on July 21, 2024

I tested this with 7.0.2 just today and the issues disappeared completely!

from cm_redissession.

csdougliss avatar csdougliss commented on July 21, 2024

@arosenhagen Saw that too, just waiting for it to be released. I might get around to compiling it

from cm_redissession.

csdougliss avatar csdougliss commented on July 21, 2024

@colinmollenhour Will test as soon as brew is updated to 7.0.3, hopefully soon

from cm_redissession.

arosenhagen avatar arosenhagen commented on July 21, 2024

just as a follow-up: we have RedisSessions running in production with 7.0.2 without hic-ups.

from cm_redissession.

colinmollenhour avatar colinmollenhour commented on July 21, 2024

I've been using 7.0.2 myself and have no had this issue. Thanks for the testing, everyone!

from cm_redissession.

lilbumblebear avatar lilbumblebear commented on July 21, 2024

Based on your comments above, I thought this issue should be resolved, but I am encountering it with the following server setup:

NGINX 1.10.1
PHP 7.0.12
Redis 3.2.4
Magento 1.9.2.4

I have also installed the PHP 7 extension from inchoo: https://github.com/Inchoo/Inchoo_PHP7

Here is the stacktrace:
Recoverable Error: session_regenerate_id(): Failed to create(read) session ID: memcache (path: tcp://127.0.0.1:11211?persistent=0&weight=2&timeout=60&retry_interval=10) in /home/dir/public_html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 492

0 [internal function]: mageCoreErrorHandler(4096, 'session_regener...', '/home/dir/p...', 492, Array)
1 /home/dir/public_html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php(492): session_regenerate_id(true)
2 /home/dir/public_html/app/code/core/Mage/Core/Model/Session/Abstract.php(570): Mage_Core_Model_Session_Abstract_Varien->regenerateSessionId()
3 /home/dir/public_html/app/code/core/Mage/Admin/Model/Session.php(120): Mage_Core_Model_Session_Abstract->renewSession()
4 /home/dir/public_html/app/code/core/Mage/Admin/Model/Observer.php(77): Mage_Admin_Model_Session->login('user', 'password', Object(Mage_Core_Controller_Request_Http))
5 /home/dir/public_html/app/code/core/Mage/Core/Model/App.php(1358): Mage_Admin_Model_Observer->actionPreDispatchAdmin(Object(Varien_Event_Observer))
6 /home/dir/public_html/app/code/core/Mage/Core/Model/App.php(1337): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Admin_Model_Observer), 'actionPreDispat...', Object(Varien_Event_Observer))
7 /home/dir/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
8 /home/dir/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(527): Mage::dispatchEvent('controller_acti...', Array)
9 /home/dir/public_html/app/code/core/Mage/Adminhtml/Controller/Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
10 /home/dir/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Adminhtml_Controller_Action->preDispatch()
11 /home/dir/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
12 /home/dir/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
13 /home/dir/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
14 /home/dir/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
15 /home/dir/public_html/index.php(82): Mage::run('domain_co', 'website')
16 {main}

Any ideas how to resolve this error? Thank you!

from cm_redissession.

colinmollenhour avatar colinmollenhour commented on July 21, 2024

Very first line shows that the error is related to memcache, not redis.

from cm_redissession.

gvanto avatar gvanto commented on July 21, 2024

Having this same problem on Magento Enterprise edition ... can't seem to find the corresponding 'read' function anywhere ...

from cm_redissession.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.