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

Unable to run garbage collection #5820

Closed
nathancope opened this issue Mar 20, 2020 · 5 comments
Closed

Unable to run garbage collection #5820

nathancope opened this issue Mar 20, 2020 · 5 comments

Comments

@nathancope
Copy link

nathancope commented Mar 20, 2020

Description

When running the garbage collection via the CLI i'm getting the below error:

Running garbage collection ... Exception 'yii\base\InvalidConfigException' with message 'Invalid section ID: 13'

in /home/site/vendor/craftcms/cms/src/elements/Entry.php:836

Stack trace:
#0 /home/site/vendor/craftcms/cms/src/elements/Entry.php(867): craft\elements\Entry->getSection()
#1 /home/site/vendor/craftcms/cms/src/elements/Entry.php(812): craft\elements\Entry->getType()
#2 /home/site/vendor/craftcms/cms/src/base/Element.php(2748): craft\elements\Entry->getFieldLayout()
#3 /home/site/vendor/craftcms/cms/src/base/Element.php(2572): craft\base\Element->fieldLayoutFields()
#4 /home/site/vendor/craftcms/cms/src/elements/Entry.php(1287): craft\base\Element->beforeDelete()
#5 /home/site/vendor/craftcms/cms/src/services/Elements.php(1217): craft\elements\Entry->beforeDelete()
#6 /home/site/vendor/craftcms/cms/src/services/Drafts.php(474): craft\services\Elements->deleteElement(Object(craft\elements\Entry), true)
#7 /home/site/vendor/craftcms/cms/src/services/Gc.php(57): craft\services\Drafts->purgeUnsavedDrafts()
#8 /home/site/vendor/craftcms/cms/src/console/controllers/GcController.php(56): craft\services\Gc->run(true)
#9 [internal function]: craft\console\controllers\GcController->actionRun()
#10 /home/site/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#11 /home/site/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#12 /home/site/vendor/yiisoft/yii2/console/Controller.php(164): yii\base\Controller->runAction('run', Array)
#13 /home/site/vendor/craftcms/cms/src/console/Controller.php(187): yii\console\Controller->runAction('run', Array)
#14 /home/site/vendor/yiisoft/yii2/base/Module.php(528): craft\console\Controller->runAction('run', Array)
#15 /home/site/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('gc/run', Array)
#16 /home/site/vendor/craftcms/cms/src/console/Application.php(87): yii\console\Application->runAction('gc/run', Array)
#17 /home/site/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('gc/run', Array)
#18 /home/site/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
#19 /home/site/craft(22): yii\base\Application->run()
#20 {main}

Steps to reproduce

  1. Run ./craft gc/run via the CLI

Additional info

  • Craft version: Craft Pro 3.4.10.1
  • PHP version: 7.1.33
  • Database driver & version: MySQL 5.6.36
  • Plugins & versions: N/A
@brandonkelly
Copy link
Member

I’m not able to reproduce this. Please send your composer.json and composer.lock files, plus a database backup, into [email protected] and reference this issue.

@benface
Copy link
Contributor

benface commented Mar 20, 2020

Hey @brandonkelly please see request 3057 on Zendesk, I had the same issue a few weeks back.

@brandonkelly
Copy link
Member

brandonkelly commented Mar 20, 2020

Ah, thanks @benface! I was able to reproduce the issue with the files you had sent in, and got this fixed for the next release. Culprit ended up being that you had an unsaved entry draft that was due to be purged, but its entry type had been deleted beforehand.

To get the fix early, change your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "dev-develop#9353043765ae93fba56f9236c214dfa7f54297a0",
  "...": "..."
}

Then run composer update.

@benface
Copy link
Contributor

benface commented Mar 20, 2020

Glad I could help haha. :)

@brandonkelly
Copy link
Member

Craft 3.4.11 is out now with the fix for this.

@ghost ghost mentioned this issue Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants