-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Session size of 276672 exceeded allowed session max size of 256000 - but in Magento 2.4.3 backend #33748
Comments
Hi @groomershop-mt. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Confirmed! Exact same issue here after upgrade to Magento 2.4.3! We are also using Redis for sessions. |
From https://devdocs.magento.com/guides/v2.4/release-notes/backward-incompatible-changes/reference.html Now the sesssion record is being saved - it has size over 256000. We have check this record and there is a lot of date with privileges settings - we have quite a lot of extensions installed, so there is more privileges, then in clear Magento setup. |
Our suggestion is to increase the default value for system/security/max_session_size_admin to 512000 (or minimalize the the permissions entries in session record). The same problem occur, when we change session storage to files. |
Yes thats it. Why not set it as "0" to disable it? What can go wrong? |
Hello, Same issue, I have edit: /vendor/magento/module-security/etc/config.xml .... |
Had this morning also the same problem, the value should be set in any case high or to 0 |
You can also change this in your /app/etc/env.php for avoid lock issues: 'disable_locking' => '0', to 'disable_locking' => '1' in your redis session settings section |
Same problem here, when trying to create an order in the admin, could add the 1st product fine, adding any additional products to the order would cause it to hang. @achatpc fix for session size worked perfectly. |
Look i got same behavior but still got admin work. But sometimes loaders seem load longer than usual preconditions 'session' => [
'save' => 'redis',
'redis' => [
'host' => 'redis',
'port' => '6379',
'password' => '',
'timeout' => '2.5',
'persistent_identifier' => '',
'database' => '2',
'compression_threshold' => '2048',
'compression_library' => 'gzip',
'log_level' => '3',
'max_concurrency' => '20',
'break_after_frontend' => '5',
'break_after_adminhtml' => '30',
'first_lifetime' => '600',
'bot_first_lifetime' => '60',
'bot_lifetime' => '7200',
'disable_locking' => '0',
'min_lifetime' => '60',
'max_lifetime' => '2592000',
'sentinel_master' => '',
'sentinel_servers' => '',
'sentinel_connect_retries' => '5',
'sentinel_verify_master' => '0'
]
],
'cache' => [
'frontend' => [
'default' => [
'id_prefix' => '69d_',
'backend' => 'Magento\\Framework\\Cache\\Backend\\Redis',
'backend_options' => [
'server' => 'redis',
'database' => '0',
'port' => '6379',
'password' => '',
'compress_data' => '1',
'compression_lib' => 'gzip',
'persistent' => '',
'force_standalone' => '0',
'connect_retries' => '1',
'read_timeout' => '10',
'automatic_cleaning_factor' => '0',
'compress_tags' => '1',
'compress_threshold' => '20480',
'preload_keys' => [
'69d_EAV_ENTITY_TYPES',
'69d_GLOBAL_PLUGIN_LIST',
'69d_DB_IS_UP_TO_DATE',
'69d_SYSTEM_DEFAULT'
]
]
],
'page_cache' => [
'id_prefix' => '69d_',
'backend' => 'Magento\\Framework\\Cache\\Backend\\Redis',
'backend_options' => [
'server' => 'redis',
'database' => '1',
'port' => '6379',
'password' => '',
'compress_data' => '0',
'compression_lib' => ''
]
]
],
'allow_parallel_generation' => false
], Updated to 2.4.3 Log show Tempor workaround: bin/magento config:set system/security/max_session_size_admin 0 Or config session in app/etc/env.php |
Look likes updates in this commit |
Upon upgrading from 2.3.7 to 2.4.3 I was unable to complete an admin login, the MFA would succeed and then loop back to asking for the MFA again. Chased this for hours thinking it was a MFA issue. Simply disabling Two Factor Authentication would allow a successful login and all looked good. The looping on MFA was apparently related to the session limit issue. The default value for 'session limit' was 256000 and needs to be much larger at least for our installation. Increased to 512000, which resolved the issue. |
Having the same issue after upgrading to 2.4.3 |
Yes problem still exist but curiously if we put value to something does magento will got session size go beyond of that ?? |
@mrtuvn it seems its the write call is only executed when the size is not exceeded yet or the max size is null.
If the max size is exceeded, the current session data is retrieved and saved again, this seems to create a loop thats constantly locking the session handler. @michaelyu0123 can you maybe explain the idea / intended behaviour behind this? |
@marvinhinz It is as you said, the original intention was just to set the session content to what is already stored. |
@michaelyu0123 wouldnt it be sufficent to just discard the "to-be-saved" data and throw an exception when the limit is reached? |
@marvinhinz, that is something that will be looked into. Thanks. |
We are experiencing what look to be very similar symptoms to the bug described here, but on Magento 2.3.7-p1. It looks like the changes to SaveHandler.php are also present in this security-only release. |
My issue was showing up as a different error: ^^^ this would pop up on every admin page. The URL that was failing: ^^^ looks like it was some kind of notification area Ajax update. Notification area where "indexers are invalid" shows up was not there so, no data was coming through. The response to the error was:
In exception logs, I was getting: Security session setting to 512000 did not work. Only after I set it to 0 it worked. UPDATE: Setting 'disable_locking' => '0', to 'disable_locking' => '1' also worked. I just added the maximum allowed size in env.php - 'max_lifetime' => '2592000' |
Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Once all required labels are present, please add |
❌ Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.magento.com/browse/AC-1170 |
Hello, Just want to report that this is also happening in version It would be nice to mention this in the release notes as currently there is no mention at the moment. |
@sidolov @sivaschenko why this issue was closed without any comments? |
It's probably because of AC-1170 Session size of 276672 exceeded allowed session max size of 256000 which got merged an hour ago. It would also be very nice if an answer could come to this question I posted yesterday. |
@mrtuvn that seems to be fixable by setting the frontend max session size because of this check: https://github.com/magento/magento2/blob/2.4-develop/lib/internal/Magento/Framework/Session/SaveHandler.php#L133
Replace 1048576 with a size you that suits you. |
thanks @n2diving-dgx this solved my problem. |
UPDATE: as per discussion, we agreed that is ok to have a low limit for session size to prevent DDOS attacks, value can be changed via the admin panel if needed.
Another problem that should be addressed is - suppressed problem, without any error notification to the user and solution for the issue should be provided.
After upgrading to Magento 2.4.3, when we log into backend (admin panel), everypage hangs/is loading about 30 seconds.
In logs we see exceptions:
Session size of 276672 exceeded allowed session max size of 256000.
We are ursing Redis for sessions.
Does anybody else have similar issue after upgrading to Magento 2.4.3?
From redis-cli monitor we see that in each second is repeated:
1628681344.757076 [3 127.0.0.1:34310] "hincrby" "sess_1g2sgh25saul85a424puad785d" "lock" "1"
Steps to reproduce (*)
Upgrade Magento 2.4.2-p1 to 2.4.3
Configured Magento to use Redis for session storage
Stores -> Configuration -> Advanced -> System -> Security - Max Session Size in Admin and Max Session Size in Storefront set to 100 and Saved
Navigate to any page from Admin -
Expected result (*)
It should not break/impact any store functionality
Actual result (*)
Page load time is increased to more than 30 sec
The text was updated successfully, but these errors were encountered: