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

[5.x]: Forced logout after creating and deleting a section in a fresh 5.5.3 installation. Unable to log in again #16230

Open
ardaayyurek opened this issue Nov 28, 2024 · 3 comments
Assignees
Labels

Comments

@ardaayyurek
Copy link

What happened?

Description

After performing a fresh Craft CMS 5.5.3 installation or upgrade from prior versions, after creating a new section and delete it, the system forces the user to log out. Once logged out, the user is unable to log in again, and running the craft users/list-admins command in the CLI shows zero admin users, even though the user still exists in the database.

Issue also happens when you create many sections and entry types and entries. When you delete a section, it forces log out. After creating a new admin user and logging in, entries, assets, and global sets disappear, and while entries can be recovered from the trash, global sets and their data cannot be recovered. Matrix field data and assets are also not recoverable.

I couldn't reproduce the issue with fresh 5.4.3 and 5.5.0 installations. It happens only with 5.5.2 and 5.5.3 installations or when upgrading from prior versions to 5.5.2 or 5.5.3.

Steps to reproduce

  1. Install Craft CMS 5.5.3
  2. Create a section, name it home. Create an entry type name it homepage. Save
  3. Delete the "home" section (Single).
  4. Click any navigation link on the side bar.
  5. The system forces you to log out. Attempt to log back in, but you are unable to log in.
  6. Run the command craft users/list-admins in the CLI, and it shows zero admin users, even though the user exists in the database.

Expected behavior

System should allow users to delete sections.

Actual behavior

  • Deleting the section forces the user to log out.
  • Unable to log back in after being logged out.
  • Running craft users/list-admins shows zero admin users, despite the user being present in the database.
  • Entries can be recovered from trash, but global sets and their data cannot be recovered.
  • Matrix relations and assets are missing and cannot be restored.
  • No other sections or entry types are affected.

Craft CMS version

5.5.3

PHP version

8.3

Operating system and version

MacOS Monterey 12.5.1

Database type and version

PostgreSQL 16.4 and 16.2

Image driver and version

No response

Installed plugins and versions

Fresh installation with no plugins

@i-just
Copy link
Contributor

i-just commented Nov 28, 2024

Hi, thanks for reporting! I raised a PR for this.

@adameli22
Copy link

adameli22 commented Nov 29, 2024

I ran into the same thing. But I thought this was some strange thing on my machine because my coworker could not reproduce the bug with a full clone of my project.

For some reason when deleting the section the user gets deleted as well. I was able to recover the user by manually updating the user in the database like this.

-- check deleted user element
select "dateDeleted" from elements where id = 1;
-- undelete user element
update elements set "dateDeleted" = null where id = 1;

tho I was not aware that you could recover the entries from trash

@stephenmatthews
Copy link

Same thing has happened to me while deleting a section. Lost everything within the craft site when the only admin was deleted. @brandonkelly are you able to look into this please? This is a major issue

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

No branches or pull requests

4 participants