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

Warning: session_write_close(): Cannot call session save handler in a recursive manner #1239

Open
matteorossi-thespacesm opened this issue Sep 29, 2020 · 6 comments

Comments

@matteorossi-thespacesm
Copy link
Contributor

Preconditions (*)

  1. OpenMage version 1.9.4.x-dev
  2. php 7.3
  3. session saved in redis

Steps to reproduce (*)

  1. logging in amasty checkout (logged message is quite generic)

Expected result (*)

  1. not to receive a warning on session close

Actual result (*)

  1. Warning: session_write_close(): Cannot call session save handler in a recursive manner in /{actual path}/htdocs/app/code/core/Mage/Core/Model/Resource/Session.php on line 97

As per php documentation: https://www.php.net/manual/en/function.session-set-save-handler.php
"It is possible to call session_write_close() from the destructor to solve this chicken and egg problem but the most reliable way is to register the shutdown function as described above."
Maybe it would be better to destroy session calling session_register_shutdown(). Where could it be called? Would it be better to call in constructor?

@seansan
Copy link
Contributor

seansan commented Sep 29, 2020

#906
#1127

Our problem was eventually related to php user and filerights

@matteorossi-thespacesm
Copy link
Contributor Author

We are saving sessions on redis.
I think such issue is related to the method used to apply session_write_close function.

@colinmollenhour
Copy link
Member

Is this specific to the Amasty extension? Perhaps it is unregsitering the session singletons? I've not seen this before and I think would need to use a debugger or see a backtrace to solve it. You can log backtraces with Firegento_Logger.

@matteorossi-thespacesm
Copy link
Contributor Author

I have made a simple change in Mage_Core_Model_Resource_session and I'm testing it. If it does not introduce any new bug I'll do a pull request.
I'm also watching to firegento logs about about amasty warning because it seems to be specifically related to a single call to cart_delete_id. I'm still investigating on it.

@joshua-bn
Copy link
Contributor

@matteorossi-thespacesm any updates? Seeing this a lot in my logs.

@prasol
Copy link

prasol commented Feb 15, 2021

Still have this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants