Session Corruption Detected

Hello!

I just moved my Grav page to a different (shared) host (called easyname). They run PHP 8.2

I did this by restoring a zipped backup file from my development host.

The website looks good, but in the admin interface I get red warnings like

“Session corruption detected, restarting session…”

It might be just related to the Grav premium banners, because this message currently only appears on the dashboard page.

I didn’t find a way yet to find or solve the issue that causes these messages.

What can I do to make sessions reliably and secure again?

@speendo, If you think the issue might be related to any Premium product, then you are entitled to receive support from the developers themselves… GitHub - getgrav/grav-premium-issues: Official Grav Premium Issues repository to report problems or ask questions regarding the Premium products offered.

I read this to indicate the undismissable “get Premium” promotional banner that has been in recent versions of Admin, but I can understand your interpretation, @pamtbaau. Could you please clarify, @speendo?

Thank you for your answers @pamtbaau and @hughbris!

In fact, I don’t have any premium products in this installation - the website is for an (almost) charity organisation and I didn’t receive any money for making it.

So, yes, @hughbris, your interpretation of my posting is correct - the error message might be related to the promotional banner. Sorry for not articulating this more clear.

… however, I just checked the backend again and received the error message on the “Pages” page - without the promotional banner
grafik

How can I find the root of this issue?

@speendo, Searching the entire Grav site, there are two areas where the error is thrown:

  • One in the InitializeProcessor.php of Grav, which is a very early call when starting Grav
  • The other is in admin.php of the Admin plugin and is also called very early in the starup of Admin.

The one thrown by InitializeProcessor will bubble up to Admin and also into the pages on the website. Since you’re not seeing any errors at the front-end, I presume the error is thrown by Admin itself.

Looking at the CHANGELOGS of both Grav and Admin they both mention on 04/11/2019:

  • Cleanly handle session corruption due to changing Flex object types

<entering guessing mode>

  • When running a site, Grav will use the parsed pages (the cached HTML pages) and doesn’t need Flex.

  • You mentioned:

    I did this by restoring a zipped backup file from my development host.

    I presume you mean a zip of the entire site, which also copies any cached page files which will be shown by the site without a problem.

  • When starting Admin, it will use Flex.

  • There might be an issue with file /user/data/flex/pages.json

  • Suggestion: Remove file /user/data/flex/pages.json. It will be rebuild by Admin.

2 Likes

Thank you, @pamtbaau!

On my instance there was no /user/data/flex/pages.json, so instead I removed /user/data/flex/indexes/pages.json.

You were right that the file was recreated, however, I still receive the error messages in the backend. The frontend seems alright, though…

Is there anything else I can try?

Btw. to clarify what I mean with “restoring a zipped backup file”:
In the admin interface of my development server I went to Tools // Backups and generated a new backup. Then I downloaded this backup as a zip file and unzipped it on the production server.

Now I tried to analyse the network traffic with my browser.

What I can say is that all the requests from my browser were replied with Status 200 (OK), except for one for /admin/config/system that received a 303 and another one to Gravatar.com, that received a 304 response.

But on first sight I don’t see any particularly alarming signals here - however, I also don’t know what to lookout for…

@speendo,

/admin/config/system

I’m not aware of a file or folder with that name. String can also not be found in entire Grav+Admin site.

Last suggestions:

  • Remove any of the following admin.yaml files:
    Don’t forget to run $ bin/grav cache and logout/login Admin
    • user/config/plugins/admin.yaml
    • user/<yourdomain>/config/plugins/admin.yaml
    • user/env/<yourdomain>/config/plugins/admin.yaml
  • Reset Admin:
    • Remove folder /user/plugins/admin
    • Install Admin using $ bin/gpm install admin

If that doesn’t help, please create an issue at Issues · getgrav/grav-plugin-admin · GitHub

2 Likes

Thank you for your suggestion. I will try that tomorrow!