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]: Running craft gc/run wipes the usertable #14891

Open
BAM-Dennis opened this issue Apr 29, 2024 · 4 comments
Open

[5.x]: Running craft gc/run wipes the usertable #14891

BAM-Dennis opened this issue Apr 29, 2024 · 4 comments
Labels

Comments

@BAM-Dennis
Copy link

What happened?

Description

Topic

Steps to reproduce

  1. run craft gc/run

Expected behavior

Clean trashed item

Actual behavior

Cleans all of the stuff

Craft CMS version

5.0.5

PHP version

8.2

Operating system and version

No response

Database type and version

pgsql

Image driver and version

No response

Installed plugins and versions

"craftcms/ckeditor": "4.0.4",
"craftcms/cms": "5.0.5",
"craftpulse/craft-colour-swatches": "5.0.0",
"nystudio107/craft-imageoptimize": "5.0.0",
"nystudio107/craft-seomatic": "5.0.2",
"nystudio107/craft-vite": "5.0.0",
"putyourlightson/craft-blitz": "5.1.4",
"vaersaagod/dospaces": "3.0.0-beta.1",
"vlucas/phpdotenv": "^5.4.0",
"yiisoft/yii2-redis": "~2.0.0"

@BAM-Dennis BAM-Dennis added the bug label Apr 29, 2024
@brandonkelly
Copy link
Member

It’s expected that the gc command will clear out several things in the database, which shouldn’t be needed anymore, including:

  • User data which exists in the elements table, whose corresponding users table rows have already been deleted.
  • Stale user data, per the purgePendingUsersDuration config setting.

Just tested locally and both of those are working as expected (and nothing more, as far as users go).

Can you elaborate on what you’re seeing?

@BAM-Dennis
Copy link
Author

hey @brandonkelly

so what i did is, add a homepage entry, add some matrix fields add those to the homepage entry.

After playing around with the new amazing features, i changed some search indexes and used the cli command to resave all entries craft resave/entries --update-search-index i got some errors about some elements with invalid owner ids, so i ran craft gc/run to clean those.

After this i wasn't able to log in anymore, so i checked the cli. No entries anymore. The entry for the homepage section was deleted. My Admin user was deleted, basically everything was deleted, that was ion any relation to the before mentioned invalied elements.

@brandonkelly
Copy link
Member

Do you happen to have a database backup from before running gc?

@BAM-Dennis
Copy link
Author

Unfortunately not, as I only did a little testing I did not create a backup.

i also tried to reproduce it somehow but i think it could occur if there are entries whose ownerid no longer exists

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

2 participants