Closed rinusvandam closed 7 months ago
I have an update on this. The error message always appeared when I tried to open the CP dashboard.
The only reason for this I could find is that my dashboard shows recent drafts. One of them might have been corrupted. I'm not sure why. But other issues are related to corrupted matrix blocks.
I tried running the craft gc
command. And voilà, the error is gone.
Is this a multi-site install, and do you have a section which allows entries to choose which sites they belong to? If so this may be the same issue as #13948, which was fixed in 4.7.0 and can be fixed retroactively by running craft gc
as you did.
Is this a multi-site install, and do you have a section which allows entries to choose which sites they belong to? If so this may be the same issue as #13948, which was fixed in 4.7.0 and can be fixed retroactively by running
craft gc
as you did.
It's a multi-site install. But it doesn't have sections that allow entries to choose which sites they belong to.
CraftCMS Version: 5.1.7 Error: Invalid owner ID
I am encountering this error when enabling the Drafts widget on the CraftCMS dashboard.
@diegocosta-dev I’m not able to reproduce. Have you tried running craft gc
as previously suggested? If that doesn’t help, can you send your database backup and Composer files into support@craftcms.com?
Have you tried running craft gc as previously suggested?
@brandonkelly Thank you for the suggestion! I have resolved the issue by running the craft gc command as you suggested. Everything is working perfectly now.
I ended up running into this myself, and realized it’s still a bug when there were nested Matrix entries that were created and then discarded. Fixed for the next release!
I ended up running into this myself, and realized it’s still a bug when there were nested Matrix entries that were created and then discarded. Fixed for the next release!
That's great, thanks! 😊
Craft 5.1.10 is out now with that fix.
Hi, sorry for the disturb.
I'm continuing to have this error also if i try to use craft gc
@plcdnl Can you specify your Craft version, and post the complete stack trace?
Hi @brandonkelly thank you in advance and sorry for the disturb.
Craft version is Craft Pro 5.2.4.1 and this is the stack trace:
Running garbage collection ...
> purging unsaved drafts that have gone stale ... Exception 'yii\base\InvalidConfigException' with message 'Invalid owner ID: 11184'
in /var/www/html/vendor/craftcms/cms/src/base/NestedElementTrait.php:158
Stack trace:
#0 /var/www/html/vendor/craftcms/cms/src/base/NestedElementTrait.php(203): craft\elements\Entry->getPrimaryOwner()
#1 /var/www/html/vendor/craftcms/cms/src/services/Elements.php(814): craft\elements\Entry->getOwner()
#2 /var/www/html/vendor/craftcms/cms/src/services/Elements.php(2297): craft\services\Elements->invalidateCachesForElement(Object(craft\elements\Entry))
#3 /var/www/html/vendor/craftcms/cms/src/services/Elements.php(1170): craft\services\Elements->craft\services\{closure}()
#4 /var/www/html/vendor/craftcms/cms/src/services/Elements.php(2279): craft\services\Elements->ensureBulkOp(Object(Closure))
#5 /var/www/html/vendor/craftcms/cms/src/services/Drafts.php(455): craft\services\Elements->deleteElement(Object(craft\elements\Entry), true)
#6 /var/www/html/vendor/craftcms/cms/src/services/Gc.php(362): craft\services\Drafts->purgeUnsavedDrafts()
#7 /var/www/html/vendor/craftcms/cms/src/services/Gc.php(101): craft\services\Gc->_purgeUnsavedDrafts()
#8 /var/www/html/vendor/craftcms/cms/src/console/controllers/GcController.php(56): craft\services\Gc->run(true)
#9 [internal function]: craft\console\controllers\GcController->actionRun()
#10 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#11 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#12 /var/www/html/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('', Array)
#13 /var/www/html/vendor/craftcms/cms/src/console/ControllerTrait.php(89): yii\console\Controller->runAction('', Array)
#14 /var/www/html/vendor/craftcms/cms/src/console/Controller.php(216): craft\console\Controller->traitRunAction('', Array)
#15 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): craft\console\Controller->runAction('', Array)
#16 /var/www/html/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('gc', Array)
#17 /var/www/html/vendor/craftcms/cms/src/console/Application.php(91): yii\console\Application->runAction('gc', Array)
#18 /var/www/html/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('gc', Array)
#19 /var/www/html/vendor/craftcms/cms/src/console/Application.php(122): yii\console\Application->handleRequest(Object(craft\console\Request))
#20 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\console\Application->handleRequest(Object(craft\console\Request))
#21 /var/www/html/craft(13): yii\base\Application->run()
#22 {main}
Failed to run craft gc: exit status 1
Hi @brandonkelly thank you in advance and sorry for the disturb.
Craft version is Craft Pro 5.2.4.1 and this is the stack trace:
Running garbage collection ... > purging unsaved drafts that have gone stale ... Exception 'yii\base\InvalidConfigException' with message 'Invalid owner ID: 11184' in /var/www/html/vendor/craftcms/cms/src/base/NestedElementTrait.php:158 Stack trace: #0 /var/www/html/vendor/craftcms/cms/src/base/NestedElementTrait.php(203): craft\elements\Entry->getPrimaryOwner() #1 /var/www/html/vendor/craftcms/cms/src/services/Elements.php(814): craft\elements\Entry->getOwner() #2 /var/www/html/vendor/craftcms/cms/src/services/Elements.php(2297): craft\services\Elements->invalidateCachesForElement(Object(craft\elements\Entry)) #3 /var/www/html/vendor/craftcms/cms/src/services/Elements.php(1170): craft\services\Elements->craft\services\{closure}() #4 /var/www/html/vendor/craftcms/cms/src/services/Elements.php(2279): craft\services\Elements->ensureBulkOp(Object(Closure)) #5 /var/www/html/vendor/craftcms/cms/src/services/Drafts.php(455): craft\services\Elements->deleteElement(Object(craft\elements\Entry), true) #6 /var/www/html/vendor/craftcms/cms/src/services/Gc.php(362): craft\services\Drafts->purgeUnsavedDrafts() #7 /var/www/html/vendor/craftcms/cms/src/services/Gc.php(101): craft\services\Gc->_purgeUnsavedDrafts() #8 /var/www/html/vendor/craftcms/cms/src/console/controllers/GcController.php(56): craft\services\Gc->run(true) #9 [internal function]: craft\console\controllers\GcController->actionRun() #10 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array) #11 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array) #12 /var/www/html/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('', Array) #13 /var/www/html/vendor/craftcms/cms/src/console/ControllerTrait.php(89): yii\console\Controller->runAction('', Array) #14 /var/www/html/vendor/craftcms/cms/src/console/Controller.php(216): craft\console\Controller->traitRunAction('', Array) #15 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): craft\console\Controller->runAction('', Array) #16 /var/www/html/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('gc', Array) #17 /var/www/html/vendor/craftcms/cms/src/console/Application.php(91): yii\console\Application->runAction('gc', Array) #18 /var/www/html/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('gc', Array) #19 /var/www/html/vendor/craftcms/cms/src/console/Application.php(122): yii\console\Application->handleRequest(Object(craft\console\Request)) #20 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\console\Application->handleRequest(Object(craft\console\Request)) #21 /var/www/html/craft(13): yii\base\Application->run() #22 {main} Failed to run craft gc: exit status 1
What helped in my case was using the --delete-all-trashed option. See: https://craftcms.com/docs/5.x/reference/cli.html#gc-run
thank you @rinusvandam. I tried with it but same error 😞
@brandonkelly I see this issue is closed, but running in exact the same situation when running craft gc
➜ go4jobs-site git:(develop) ✗ ddev craft gc
Delete all trashed items? (yes|no) [no]:y
Running garbage collection ...
> purging unsaved drafts that have gone stale ... Exception 'yii\base\InvalidConfigException' with message 'Invalid owner ID: 3133'
in /var/www/html/cms/vendor/craftcms/cms/src/base/NestedElementTrait.php:158
Stack trace:
#0 /var/www/html/cms/vendor/craftcms/cms/src/base/NestedElementTrait.php(203): craft\elements\Entry->getPrimaryOwner()
#1 /var/www/html/cms/vendor/craftcms/cms/src/services/Elements.php(814): craft\elements\Entry->getOwner()
#2 /var/www/html/cms/vendor/craftcms/cms/src/services/Elements.php(2313): craft\services\Elements->invalidateCachesForElement()
#3 /var/www/html/cms/vendor/craftcms/cms/src/services/Elements.php(1170): craft\services\Elements->craft\services\{closure}()
#4 /var/www/html/cms/vendor/craftcms/cms/src/services/Elements.php(2295): craft\services\Elements->ensureBulkOp()
#5 /var/www/html/cms/vendor/craftcms/cms/src/services/Drafts.php(455): craft\services\Elements->deleteElement()
#6 /var/www/html/cms/vendor/craftcms/cms/src/services/Gc.php(362): craft\services\Drafts->purgeUnsavedDrafts()
#7 /var/www/html/cms/vendor/craftcms/cms/src/services/Gc.php(101): craft\services\Gc->_purgeUnsavedDrafts()
#8 /var/www/html/cms/vendor/craftcms/cms/src/console/controllers/GcController.php(56): craft\services\Gc->run()
#9 [internal function]: craft\console\controllers\GcController->actionRun()
#10 /var/www/html/cms/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#11 /var/www/html/cms/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()
#12 /var/www/html/cms/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction()
#13 /var/www/html/cms/vendor/craftcms/cms/src/console/ControllerTrait.php(89): yii\console\Controller->runAction()
#14 /var/www/html/cms/vendor/craftcms/cms/src/console/Controller.php(216): craft\console\Controller->traitRunAction()
#15 /var/www/html/cms/vendor/yiisoft/yii2/base/Module.php(552): craft\console\Controller->runAction()
#16 /var/www/html/cms/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction()
#17 /var/www/html/cms/vendor/craftcms/cms/src/console/Application.php(91): yii\console\Application->runAction()
#18 /var/www/html/cms/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction()
#19 /var/www/html/cms/vendor/craftcms/cms/src/console/Application.php(122): yii\console\Application->handleRequest()
#20 /var/www/html/cms/vendor/yiisoft/yii2/base/Application.php(384): craft\console\Application->handleRequest()
#21 /var/www/html/cms/craft(13): yii\base\Application->run()
#22 {main}
also in this case, it's not a multi-site
Craft version is 5.2.8 (I can deliver a DB if necessary)
Also for me, not a multi-site
Hi Guys,
In my case, the
ddev craft gc
command worked, so maybe this could help. The error "Invalid owner ID errors" only occurred when I was on the main dashboard page (https://site.ddev.site/admin/dashboard). I was able to access other backend pages normally, such as https://site.ddev.site/admin/users/all.So, I created a new administrator account and was able to log into the dashboard without any problems. I believe this issue is related to the widget's user configuration on the dashboard.
Note: This worked for me. It might be different for you.
I think this is unrelated and might be another issue. I don't have any issues personally going around in the CP, creating, editing ... content, everything works as normal. Just the gc/run
command throwing errors.
@michtio Can you send your database backup and Composer files into support@craftcms.com?
I had the same issue, what helped for me was looking up the owner ID in the entries
table, and open the entrytypes
row linked by typeId
. Lookup that entry type in the entry config in the admin, and resave it. For me, it would re-add the title field to the config file.
https://github.com/user-attachments/assets/287e19c2-e755-4e8b-881b-fe4c3c48380d
What happened?
Description
I've updated a Craft site to version 5. I'm getting “Invalid owner ID” errors.
Steps to reproduce
It appears to happen at random moments. Can't find a way to reproduce it. I've seen more issues related to this.
Stack trace
Craft CMS version
Craft Pro 5.0.0
PHP version
8.2.15
Operating system and version
MacOS 14.4 (23E214)
Database type and version
MySQL 8.0.33
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.11-60)
Installed plugins and versions