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

[4.x]: GC corrupts content/structures #12925

Closed
ccchapman opened this issue Mar 17, 2023 · 7 comments
Closed

[4.x]: GC corrupts content/structures #12925

ccchapman opened this issue Mar 17, 2023 · 7 comments

Comments

@ccchapman
Copy link
Contributor

ccchapman commented Mar 17, 2023

What happened?

Description

Garbage collection (GC) is causing structures to be flattened and Neo blocks to disappear.

Steps to reproduce

  1. Site contains a structure
  2. Structure is populated with nested entries
  3. Entry type has Neo field with Neo blocks
  4. Run craft gc/run (I say no to trashed)
  5. Run craft gc/run again (Say no to trashed again)

Expected behavior

Content is impacted

Actual behavior

  • Structure hiearchy is flattened
  • Neo blocks disappear
  • Navigation (plugin) is flattened/broken

Reproduced on multiple attempts and multiple projects.

Could not reproduce on a fresh install of Craft.

Craft CMS version

4.4.3

PHP version

8.1

Operating system and version

No response

Database type and version

PostgreSQL 14.3, PostgreSQL 14.5

Image driver and version

No response

Installed plugins and versions

Composer info from project 1
craftcms/aws-s3                            2.0.1            Amazon S3 integration for Craft CMS
craftcms/cms                               4.4.1            Craft CMS
craftcms/feed-me                           5.0.5            Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.
craftcms/redactor                          3.0.3            Edit rich text content in Craft CMS using Redactor by Imperavi.
hybridinteractive/craft-position-fieldtype v4.x-dev e0c05bb Brings back the Position fieldtype from Craft 2
korcontrol/craft-classy                    2.0.0            Twig helpers inspired by https://github.com/JedWatson/classnames
mutation/translate                         3.0.1            Translate messages in the control panel
nystudio107/craft-closure                  1.0.0            Allows you to use arrow function closures in Twig
nystudio107/craft-retour                   4.1.11           Retour allows you to intelligently redirect legacy URLs, so that you don't lose SEO value when rebuilding & restructuring a website
nystudio107/craft-seomatic                 4.0.20           SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
nystudio107/craft-vite                     4.0.5            Allows the use of the Vite.js next generation frontend tooling with Craft CMS
putyourlightson/craft-blitz                4.4.3            Intelligent static page caching for creating lightning-fast sites.
sebastianlenz/linkfield                    2.1.5            A Craft field type for selecting links
spacecatninja/imager-x                     4.1.11           Ninja powered image transforms.
spicyweb/craft-embedded-assets             3.1.1            Manage YouTube videos, Instagram photos, Twitter posts and more as first class assets
spicyweb/craft-neo                         3.7.0            A Matrix-like field type that uses existing fields
topshelfcraft/environment-label            4.0.2            ...so you don't forget where you are.
topshelfcraft/wordsmith                    4.2.0            ...because you have the best words.
verbb/navigation                           2.0.16           Create navigation menus for your site.
vlucas/phpdotenv                           v5.5.0           Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
yiisoft/yii2-redis                         2.0.18           Redis Cache, Session and ActiveRecord for the Yii framework
yiisoft/yii2-shell                         2.0.5            The interactive shell extension for Yii framework
Composer info from project 2
algolia/algoliasearch-client-php 3.3.2  Algolia Search API Client for PHP
craftcms/aws-s3                  2.0.3  Amazon S3 integration for Craft CMS
craftcms/cms                     4.4.3  Craft CMS
craftcms/feed-me                 5.1.0  Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.
craftcms/redactor                3.0.4  Edit rich text content in Craft CMS using Redactor by Imperavi.
diginov/craft-sentry-logger      4.1.1  Pushes Craft CMS logs to Sentry through a real Yii 2 log target
doublesecretagency/craft-cpcss   2.6.0  Add custom CSS to your Control Panel.
ether/simplemap                  v4.0.3 A beautifully simple Map field type for Craft CMS
nystudio107/craft-retour         4.1.11 Retour allows you to intelligently redirect legacy URLs, so that you don't lose SEO value when rebuilding & restructuring a website
nystudio107/craft-seomatic       4.0.22 SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 4. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
sebastianlenz/linkfield          2.1.5  A Craft field type for selecting links
spacecatninja/imager-x           4.1.11 Ninja powered image transforms.
spicyweb/craft-batch-actions     1.3.0  A Craft CMS plugin for performing batch actions on Matrix and Neo blocks
spicyweb/craft-embedded-assets   3.1.1  Manage YouTube videos, Instagram photos, Twitter posts and more as first class assets
spicyweb/craft-neo               3.4.1  A Matrix-like field type that uses existing fields
studioespresso/craft-scout       3.1.0  Craft Scout provides a simple solution for adding full-text search to your entries. Scout will automatically keep your search indexes in sync with your entries.
verbb/formie                     2.0.24 The most user-friendly forms plugin for Craft.
verbb/navigation                 2.0.16 Create navigation menus for your site.
verbb/workflow                   2.0.4  Create a workflow for publishing entries.
vlucas/phpdotenv                 v5.5.0 Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
yiisoft/yii2-redis               2.0.18 Redis Cache, Session and ActiveRecord for the Yii framework
yiisoft/yii2-shell               2.0.5  The interactive shell extension for Yii framework
@ccchapman ccchapman changed the title [4.x]: GC causes corrupt owners [4.x]: GC corrupts structures/relations Mar 17, 2023
@brandonkelly
Copy link
Member

Could not reproduce on a fresh install of Craft.

When you attempted on a fresh install, were you testing with the same Neo/Navigation setup?

@ccchapman
Copy link
Contributor Author

ccchapman commented Mar 18, 2023

Could not reproduce on a fresh install of Craft.

When you attempted on a fresh install, were you testing with the same Neo/Navigation setup?

I installed the same plugins however I did not populate any Neo fields or Navigation. I simply created two entries, parent/child, in a structure.

Happy to give it a test with populated Neo and Navigation.

@ccchapman ccchapman changed the title [4.x]: GC corrupts structures/relations [4.x]: GC corrupts content/structures Mar 18, 2023
@Mosnar
Copy link
Contributor

Mosnar commented Mar 18, 2023

I wanted to share that I tried to reproduce this on a site with basically the same setup (Neo, Navigation, PHP 8.1, Craft 4.4.3) and didn't have any problems. The biggest difference is that the site I tried it on is MySQL-backed, not Postgres; so perhaps that's related.

@brandonkelly
Copy link
Member

@ccchapman Can you send your database backup and Composer files into support@craftcms.com? We can try to look into it further from there.

@ccchapman
Copy link
Contributor Author

@ccchapman Can you send your database backup and Composer files into support@craftcms.com? We can try to look into it further from there.

Done @brandonkelly. Thanks!

@ccchapman
Copy link
Contributor Author

I am closing this issue in favour of spicywebau/craft-neo#725 as it does appear Neo specific.

@brandonkelly
Copy link
Member

We received reports of this occuring outside of Neo as well, and tracked it down to a PostgreSQL + garbage collection bug introduced in Craft 3.8 and 4.4.

Craft 3.8.4 and 4.4.4 have just been released with a fix.

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

No branches or pull requests

3 participants