magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Error on dashboard login: Invalid security or form key. Please refresh the page.

Open alitopaloglu opened this issue 5 years ago • 65 comments

Preconditions (*)

  1. v2.4.3

Steps to reproduce (*)

  1. Install magento v2.4.3 by using composer
  2. Go to /admin_XXXXXX which is a unique admin url that generated by magento
  3. Login with your admin credentials

Expected result (*)

  1. If login successful, it should show dashboard without any error

Actual result (*)

  1. Dashboard loads with an error -> Invalid security or form key. Please refresh the page.
  2. https://www.dropbox.com/s/i5c3epqcuh5mhjw/Screen%20Shot%202021-08-11%20at%2014.42.11.png?dl=0

Network section of browser, filtered by doc

  1. /admin_XXXXXX POST 302 found
  2. /admin_XXXXXX/admin_XXXXXX/index/index/key/XXXXXX/ GET 302 found
  3. /admin_XXXXXX/admin/dashboard/index/key/XXXXXX/ GET 200 OK

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • [ ] 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.
  • [x] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • [X] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

alitopaloglu avatar Aug 11 '21 11:08 alitopaloglu

Hi @alitopaloglu. Thank you for your report. To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


: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, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] avatar Aug 11 '21 11:08 m2-assistant[bot]

Isnt this the same issue as #33748 ? Check your logs if it says session size is exceeded.

jorgb90 avatar Aug 11 '21 12:08 jorgb90

No, this is not the same issue. After exceeding session size (solving issue #33748), the warning is still being diplayed:

Invalid security or form key. Please refresh the page.

groomershop-mt avatar Aug 11 '21 12:08 groomershop-mt

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

No, this is not the same issue. After exceeding session size (solving issue #33748), the warning is still being diplayed:

Invalid security or form key. Please refresh the page.

Mm for me it went away after exceeding the session size (I disabled it with "0").

jorgb90 avatar Aug 11 '21 13:08 jorgb90

Hi @achatpc, here is your Magento Instance: https://ccd28d956a54ce11d872ea27d25f9b05-2-4-develop.instances.magento-community.engineering Admin access: https://ccd28d956a54ce11d872ea27d25f9b05-2-4-develop.instances.magento-community.engineering/admin_99a1 Login: 8da6a650 Password: c29246f8fb4d

We also see this, the error appears on first entry to the admin panel but after a page refresh or navigating away from the initial screen it disappears.

devchris79 avatar Aug 11 '21 13:08 devchris79

Hi, I see the same error after upgrade my magento 2.4.2-p1 to 2.4.3. The error happens after admin login as @devchris79 said

oriolauge avatar Aug 11 '21 20:08 oriolauge

I had the same error after upgrading from 2.4.2-p1 to 2.4.3, sessions on Redis. Solved with the following queries, as default values are too strict and I couldn't modify them from admin panel, before setting them higher. insert into core_config_data set scope="default", scope_id=0, path="system/security/max_session_size_admin", value=NULL; insert into core_config_data set scope="default", scope_id=0, path="system/security/max_session_size_storefront", value="512000";

Edit: I'm still having the same issue after logging in in admin, without any log recorded, but it disappears while navigating and I'm able to fully use the admin panel.

Thundar avatar Aug 12 '21 07:08 Thundar

@magento give me 2.4-develop instance

TheRealHunzik avatar Aug 12 '21 11:08 TheRealHunzik

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

Hi @TheRealHunzik, here is your Magento Instance: https://ccd28d956a54ce11d872ea27d25f9b05-2-4-develop.instances.magento-community.engineering Admin access: https://ccd28d956a54ce11d872ea27d25f9b05-2-4-develop.instances.magento-community.engineering/admin_615a Login: 68502e5b Password: 94a22f51a977

Hi @engcom-November. 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).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components 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 Aug 13 '21 09:08 m2-assistant[bot]

Verified the issue on Magento 2.4.3 version after upgrading from 2.4.2-p1 to 2.4.3 and the issue is reproducible: Steps to reproduce: Upgrade Magento version from 2.4.2-p1 to 2.4.3 Login to Magento Admin using admin credentials Issue: Invalid security or form key. Please refresh the page. Error message is getting displayed on Admin Dashboard User have to refresh the page to remove the error message Logout and Login again - Issue: Above error message is displayed always after every login Invalid_security

engcom-November avatar Aug 13 '21 10:08 engcom-November

:white_check_mark: Confirmed by @engcom-November Thank you for verifying the issue. Based on the provided information internal tickets MC-43085 were created

Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

magento-engcom-team avatar Aug 13 '21 10:08 magento-engcom-team

Verified the issue on Magento 2.4.3 version after upgrading from 2.4.2-p1 to 2.4.3 and the issue is reproducible: Steps to reproduce: Upgrade Magento version from 2.4.2-p1 to 2.4.3 Login to Magento Admin using admin credentials Issue: Invalid security or form key. Please refresh the page. Error message is getting displayed on Admin Dashboard User have to refresh the page to remove the error message Logout and Login again - Issue: Above error message is displayed always after every login image

Not isolated to upgrading from 2.4.2-p1 to 2.4.3. This has also occured for me when upgrading from 2.3.6 P-1

chrisbadley avatar Aug 16 '21 07:08 chrisbadley

I meet this issues,too. When I upgrade 2.4.2 --> 2.4.3.

This message nerver disappears weather I refresh or no in my env.

JKair avatar Aug 16 '21 08:08 JKair

Same issue. Fresh Installation of 2.4.3

WebHostingAce avatar Aug 17 '21 06:08 WebHostingAce

Not only 2.4.3. I see this issue sometimes after login to admin from version 2.3.3. Got forever loading but after reload page once again seem error messages not visible

mrtuvn avatar Aug 17 '21 09:08 mrtuvn

When we upgraded to 2.4.3 this also happened. Put in a ticket from support they said they couldnt replicate it. Nice to see others are having the same issue

birdman002 avatar Aug 18 '21 20:08 birdman002