craftcms/apple-news

Publish queue becomes blocked when an article is deleted in apple news

seanjermey opened this issue · 1 comments

If you delete an article in new publisher and try to republish from craft an error is thrown and the publish queue becomes blocked.

The only way to resolve this is the remove the article from the craft_applenews_articles table.

2018/10/25 08:50:12 [info] [application] [Forced] Starting task AppleNews_PostQueuedArticles that has a total of 1 steps.
2018/10/25 08:50:12 [info] [application] [Forced] Starting step 1 of 1 total steps.
2018/10/25 08:50:12 [info] [application] [Forced] Posting entry 12691 (***************************/entries/articles/12691-*******************) to Apple News.
2018/10/25 08:50:15 [error] [php] Array
(
    [code] => 404
    [message] => HTTP/1.1 404 Not Found
    [response] => stdClass Object
        (
            [errors] => Array
                (
                    [0] => stdClass Object
                        (
                            [code] => NOT_FOUND
                            [keyPath] => Array
                                (
                                    [0] => articleId
                                )

                            [value] => 0553298d-06f1-4715-bb2b-f83413fa698b
                        )

                )

        )

)
 in /var/www/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php on line 197 (/var/www/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php:289)
Stack trace:
#0 /var/www/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php(197): ChapterThree\AppleNewsAPI\PublisherAPI->triggerError()
#1 /var/www/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Curl.php(104): ChapterThree\AppleNewsAPI\PublisherAPI->onErrorResponse()
#2 /var/www/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Curl.php(88): ChapterThree\AppleNewsAPI\PublisherAPI->response()
#3 /var/www/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Curl.php(242): ChapterThree\AppleNewsAPI\PublisherAPI->request()
#4 /var/www/craft/plugins/applenews/services/AppleNews_ApiService.php(153): ChapterThree\AppleNewsAPI\PublisherAPI->post()
#5 /var/www/craft/plugins/applenews/services/AppleNews_ApiService.php(103): Craft\AppleNews_ApiService->post()
#6 /var/www/craft/plugins/applenews/services/AppleNewsService.php(339): Craft\AppleNews_ApiService->updateArticle()
#7 /var/www/craft/plugins/applenews/tasks/AppleNews_PostQueuedArticlesTask.php(91): Craft\AppleNewsService->postArticle()
#8 /var/www/craft/app/services/TasksService.php(247): Craft\AppleNews_PostQueuedArticlesTask->runStep()
#9 /var/www/craft/app/services/TasksService.php(208): Craft\TasksService->runTask()
#10 /var/www/craft/app/controllers/TasksController.php(63): Craft\TasksService->runPendingTasks()
#11 /var/www/craft/app/framework/web/actions/CInlineAction.php(49): Craft\TasksController->actionRunPendingTasks()
#12 /var/www/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams()
#13 /var/www/craft/app/framework/web/CController.php(286): Craft\TasksController->runAction()
#14 /var/www/craft/app/framework/web/CController.php(265): Craft\TasksController->runActionWithFilters()
#15 /var/www/craft/app/framework/web/CWebApplication.php(282): Craft\TasksController->run()
#16 /var/www/craft/app/etc/web/WebApp.php(836): Craft\WebApp->runController()
#17 /var/www/craft/app/etc/web/WebApp.php(287): Craft\WebApp->_processActionRequest()
#18 /var/www/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest()
#19 /var/www/craft/app/index.php(73): Craft\WebApp->run()
#20 /var/www/public/explore/index.php(50): require_once()
REQUEST_URI=/explore/index.php/7WvDyGnd13/actions/tasks/runPendingTasks
2018/10/25 08:50:15 [error] [application] Encountered an error running task 19 (AppleNews_PostQueuedArticles), step 1 of 1: Array
(
    [code] => 404
    [message] => HTTP/1.1 404 Not Found
    [response] => stdClass Object
        (
            [errors] => Array
                (
                    [0] => stdClass Object
                        (
                            [code] => NOT_FOUND
                            [keyPath] => Array
                                (
                                    [0] => articleId
                                )

                            [value] => 0553298d-06f1-4715-bb2b-f83413fa698b
                        )

                )

        )

)
 in /var/www/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php on line 197 on line 289 of /var/www/craft/plugins/applenews/vendor/chapter-three/apple-news-api/src/PublisherAPI/Base.php

******************************************************************************************************