Answers.Body: <p>This will be fixed in Craft 3.4.11, per <a href="https://github.com/craftcms/cms/issues/5820" rel="nofollow noreferrer">craftcms/cms#5820</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-20T23:18:57.033Z
Answers.LastActivityDate: 2020-03-20T23:18:57.033Z
Answers.UserDisplayName: Brandon Kelly
Body: <p>When I run ./craft gc I get the following error:</p>
  
  <pre><code>Running garbage collection ... Exception 'yii\base\InvalidConfigException' with message 'Invalid section ID: 30'
  </code></pre>
  
  <p>The Section ID of 30 that it's referencing is one of the deleted </p>
  
  <p>EDIT: Adding Stack Trace (Craft Pro 3.4.9):</p>
  
  <pre><code>Delete all trashed items? (yes|no) [no]:yes
  Running garbage collection ... Exception 'yii\base\InvalidConfigException' with message 'Invalid section ID: 30'
  
  in /srv/www/website.com/vendor/craftcms/cms/src/elements/Entry.php:836
  
  Stack trace:
  #0 /srv/www/website.com/vendor/craftcms/cms/src/elements/Entry.php(867): craft\elements\Entry-&gt;getSection()
  #1 /srv/www/website.com/vendor/craftcms/cms/src/elements/Entry.php(812): craft\elements\Entry-&gt;getType()
  #2 /srv/www/website.com/vendor/craftcms/cms/src/base/Element.php(2740): craft\elements\Entry-&gt;getFieldLayout()
  #3 /srv/www/website.com/vendor/craftcms/cms/src/base/Element.php(2564): craft\base\Element-&gt;fieldLayoutFields()
  #4 /srv/www/website.com/vendor/craftcms/cms/src/elements/Entry.php(1287): craft\base\Element-&gt;beforeDelete()
  #5 /srv/www/website.com/vendor/craftcms/cms/src/services/Elements.php(1213): craft\elements\Entry-&gt;beforeDelete()
  #6 /srv/www/website.com/vendor/craftcms/cms/src/services/Drafts.php(474): craft\services\Elements-&gt;deleteElement(Object(craft\elements\Entry), true)
  #7 /srv/www/website.com/vendor/craftcms/cms/src/services/Gc.php(57): craft\services\Drafts-&gt;purgeUnsavedDrafts()
  #8 /srv/www/website.com/vendor/craftcms/cms/src/console/controllers/GcController.php(56): craft\services\Gc-&gt;run(true)
  #9 [internal function]: craft\console\controllers\GcController-&gt;actionRun()
  #10 /srv/www/website.com/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
  #11 /srv/www/website.com/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction-&gt;runWithParams(Array)
  #12 /srv/www/website.com/vendor/yiisoft/yii2/console/Controller.php(164): yii\base\Controller-&gt;runAction('', Array)
  #13 /srv/www/website.com/vendor/craftcms/cms/src/console/Controller.php(187): yii\console\Controller-&gt;runAction('', Array)
  #14 /srv/www/website.com/vendor/yiisoft/yii2/base/Module.php(528): craft\console\Controller-&gt;runAction('', Array)
  #15 /srv/www/website.com/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module-&gt;runAction('gc', Array)
  #16 /srv/www/website.com/vendor/craftcms/cms/src/console/Application.php(87): yii\console\Application-&gt;runAction('gc', Array)
  #17 /srv/www/website.com/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application-&gt;runAction('gc', Array)
  #18 /srv/www/website.com/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application-&gt;handleRequest(Object(craft\console\Request))
  #19 /srv/www/website.com/craft(22): yii\base\Application-&gt;run()
  #20 {main}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-29T16:40:10.563Z
Comments.Text: Added the stack trace — hopefully that helps.
Comments.UserDisplayName: Adrian
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-15T22:37:43.630Z
Comments.Text: Can you share the full stack trace leading up to the error?
Comments.UserDisplayName: Brad Bell
Tags: <craft3>
Title: Exception Running garbage collection
ThreadText: # Exception Running garbage collection
  
  (Asked by: username_0 on 2019-11-14)
  
  When I run ./craft gc I get the following error:
  
  ```
  Running garbage collection ... Exception 'yii\base\InvalidConfigException' with message 'Invalid section ID: 30'
  
  ```
  
  The Section ID of 30 that it's referencing is one of the deleted
  
  EDIT: Adding Stack Trace (Craft Pro 3.4.9):
  
  ```
  Delete all trashed items? (yes|no) [no]:yes
  Running garbage collection ... Exception 'yii\base\InvalidConfigException' with message 'Invalid section ID: 30'
  
  in /srv/www/website.com/vendor/craftcms/cms/src/elements/Entry.php:836
  
  Stack trace:
  #0 /srv/www/website.com/vendor/craftcms/cms/src/elements/Entry.php(867): craft\elements\Entry->getSection()
  #1 /srv/www/website.com/vendor/craftcms/cms/src/elements/Entry.php(812): craft\elements\Entry->getType()
  #2 /srv/www/website.com/vendor/craftcms/cms/src/base/Element.php(2740): craft\elements\Entry->getFieldLayout()
  #3 /srv/www/website.com/vendor/craftcms/cms/src/base/Element.php(2564): craft\base\Element->fieldLayoutFields()
  #4 /srv/www/website.com/vendor/craftcms/cms/src/elements/Entry.php(1287): craft\base\Element->beforeDelete()
  #5 /srv/www/website.com/vendor/craftcms/cms/src/services/Elements.php(1213): craft\elements\Entry->beforeDelete()
  #6 /srv/www/website.com/vendor/craftcms/cms/src/services/Drafts.php(474): craft\services\Elements->deleteElement(Object(craft\elements\Entry), true)
  #7 /srv/www/website.com/vendor/craftcms/cms/src/services/Gc.php(57): craft\services\Drafts->purgeUnsavedDrafts()
  #8 /srv/www/website.com/vendor/craftcms/cms/src/console/controllers/GcController.php(56): craft\services\Gc->run(true)
  #9 [internal function]: craft\console\controllers\GcController->actionRun()
  #10 /srv/www/website.com/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
  #11 /srv/www/website.com/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
  #12 /srv/www/website.com/vendor/yiisoft/yii2/console/Controller.php(164): yii\base\Controller->runAction('', Array)
  #13 /srv/www/website.com/vendor/craftcms/cms/src/console/Controller.php(187): yii\console\Controller->runAction('', Array)
  #14 /srv/www/website.com/vendor/yiisoft/yii2/base/Module.php(528): craft\console\Controller->runAction('', Array)
  #15 /srv/www/website.com/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('gc', Array)
  #16 /srv/www/website.com/vendor/craftcms/cms/src/console/Application.php(87): yii\console\Application->runAction('gc', Array)
  #17 /srv/www/website.com/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('gc', Array)
  #18 /srv/www/website.com/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
  #19 /srv/www/website.com/craft(22): yii\base\Application->run()
  #20 {main}
  
  ```
  
  **Tags:** craft3
  
  > **Comments:**
  > **username_1**: Can you share the full stack trace leading up to the error?  
  > **username_0**: Added the stack trace — hopefully that helps.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-03-20. Score: 1 | Accepted answer
  
  This will be fixed in Craft 3.4.11, per [craftcms/cms#5820](https://github.com/craftcms/cms/issues/5820).
  
  
  ---
  
  