craftcms / feed-me

Craft CMS plugin for importing entry data from XML, RSS or ATOM feeds—routine task or on-demand.
Other
289 stars 139 forks source link

Trying to get property of non-object #754

Closed cookie10codes closed 4 years ago

cookie10codes commented 4 years ago

Description

Getting this error when trying to run each feed-me in CLI. Looked it up and these doesn't have any assets set.

Steps to reproduce

1 docker-compose exec php ./craft feed-me/feeds/run 1 in CLI

  1. error:

`Feed processing started for Feed ID feeds PHP Notice 'yii\base\ErrorException' with message 'Trying to get property 'name' of non-object'

in /var/www/project/cms/vendor/craftcms/feed-me/src/queue/jobs/FeedImport.php:99

Stack trace:

0 /var/www/project/cms/vendor/craftcms/feed-me/src/queue/jobs/FeedImport.php(99): yii\console\ErrorHandler->handleError()

1 /var/www/project/cms/vendor/craftcms/cms/src/queue/BaseJob.php(51): craft\feedme\queue\jobs\FeedImport->defaultDescription()

2 /var/www/project/cms/vendor/craftcms/cms/src/queue/Queue.php(169): craft\feedme\queue\jobs\FeedImport->getDescription()

3 /var/www/project/cms/vendor/craftcms/feed-me/src/console/controllers/FeedsController.php(43): craft\queue\Queue->push()

4 /var/www/project/cms/vendor/yiisoft/yii2/base/InlineAction.php(57): craft\feedme\console\controllers\FeedsController->actionRun()

5 /var/www/project/cms/vendor/yiisoft/yii2/base/InlineAction.php(57): ::call_user_func_array:{/var/www/project/cms/vendor/yiisoft/yii2/base/InlineAction.php:57}()

6 /var/www/project/cms/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams()

7 /var/www/project/cms/vendor/yiisoft/yii2/console/Controller.php(179): craft\feedme\console\controllers\FeedsController->runAction()

8 /var/www/project/cms/vendor/yiisoft/yii2/base/Module.php(528): craft\feedme\console\controllers\FeedsController->runAction()

9 /var/www/project/cms/vendor/yiisoft/yii2/console/Application.php(180): craft\console\Application->runAction()

10 /var/www/project/cms/vendor/craftcms/cms/src/console/Application.php(88): craft\console\Application->runAction()

11 /var/www/project/cms/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction()

12 /var/www/project/cms/vendor/yiisoft/yii2/base/Application.php(386): craft\console\Application->handleRequest()

13 /var/www/project/cms/craft(22): craft\console\Application->run()

14 {main}`

Additional info

cgooderham94 commented 4 years ago

I've also had similar issues. Have you tried updating asset indexes?

cookie10codes commented 4 years ago

I found a way to go past this. If I check the help for the feeds

`php ./craft help feed-me/feeds/run

USAGE

craft feed-me/feeds/run [...options...]

OPTIONS --appconfig: string custom application configuration file path. If not set, default application configuration is used. --id: (defaults to 'feeds') --limit --offset`

I noticed the --id option. So from now on I use php ./craft feed-me/feeds/run --id=2 and this doesn't throw any error

brandonkelly commented 4 years ago

We just released Feed Me 4.3.0 with a bit of a fix for this. We have removed the feed-me/feeds/run command entirely, with a new feed-me/feeds/queue command, which handles missing IDs better.

> php craft feed-me/feeds/queue
Error: Missing required arguments: feedId

Note that feed ID(s) should be specified directly after the .../queue now, rather than via an --id option. That seemed to make more sense considering that it’s not actually optional.

> php craft feed-me/feeds/queue 1,2,3

Note that the new queue command does not attempt to actually run the queue. You must run the queue/run command afterward to actually run the queue.