magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Warning: Trying to access array offset on value of type int in /vendor/magento/framework/Session/Validator.php on line 132

Open kovinet opened this issue 1 year ago • 3 comments

Preconditions and environment

  • Magento version 2.4.6-p3
  • While browsing the site on production this error suddenly appeared when entering a query to main search. Now on front all URLs have this error. If I open website in different browser the error is gone, as it seems to be related to current user's session. Admin area works.

Steps to reproduce

It happened once and I am not able to reproduce it. But there is exact same problem posted on StackExchange by another user https://magento.stackexchange.com/questions/369979/trying-to-access-array-offset-on-value-of-type-int-in-vendor-magento-framework so I am not alone in having this issue

Expected result

Webpage working normally

Actual result

Error message "There has been an error processing your request" is shown to user with error log number.

Additional information

When deleting sesion cookie named PHPSESSID the website is again functional for the user. But of course cart content is lost etc.

Release note

No response

Triage and priority

  • [] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • [X] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • [ ] 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”.

kovinet avatar Jan 09 '24 08:01 kovinet

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


Join Magento Community Engineering Slack and ask your questions in #github channel. :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.

m2-assistant[bot] avatar Jan 09 '24 08:01 m2-assistant[bot]

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:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • [ ] 3. Add Area: XXXXX label to the ticket, indicating the functional areas 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 Jan 09 '24 08:01 m2-assistant[bot]

Hi @kovinet,

Thank you for reporting and collaboration.

Please try to follow below instructions to fix this:


Delete the generated/code directory rm -rf generated/code
Then run
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
chmo -R 0777 var/ pub/ generated/

Thanks.

engcom-Bravo avatar Jan 09 '24 12:01 engcom-Bravo

@engcom-Bravo: please don't advise people to use chmod 0777, it could introduce security problems. @sdzhepa, @sidolov: can you guys have a word with your support people so they no longer give "advise" like this. Thanks!

hostep avatar Jan 20 '24 14:01 hostep

@engcom-Bravo just deleting cookies cookies solved the issue for me and I can't reproduce if now, so running setup:upgrade etc doesn't make sense now. But I reported the issue so maybe this edge case bug could be solved. My guess is that user's session data gets corrupted somehow but I don't have deeper understanding.

kovinet avatar Jan 21 '24 09:01 kovinet

Hi @hostep Thanks for your guidance! We will take care in the future.

@kovinet,

Thanks for your update.

As per this comment https://github.com/magento/magento2/issues/38339#issuecomment-1902562612 since the issue has been resolved We are closing this issue please feel free to reopen the issue if you are still facing any issue.

Thanks.

engcom-Bravo avatar Jan 22 '24 04:01 engcom-Bravo

We are also facing this error, and we don't know what causes it.

Eddcapone avatar Feb 01 '24 16:02 Eddcapone