Infinite loop on synchronizing Brid.TV media due to client error in BridApiConsumer::doGet()

Created on 3 October 2023, 9 months ago

Problem/Motivation

Infinite loop on synchronizing Brid.TV media (under /admin/config/bridtv) due to client error in BridApiConsumer::doGet() due to not existing video. Also bridtv cron seems to get stuck on the batch with failing sync.

Requesting the video with id 1241282 i.e. with Postman I get the following response:

{
    "code": 400,
    "url": "/apiv3/video/view/1241282.json",
    "exception": "ApiException",
    "message": "Video with id:1241282 does not exist."
}

The same we get in doGet(), but without logging. doGet() returns NULL and BridSyncWorker::processEntities() throws the RequeueException (exception to release the item allowing it to be processed again). So the item gets processed again and (manual) sync get stuck in infinite loop.

Steps to reproduce

Currently I do not have demo content on bridtv to play with to reproduce the issue. I hope that the following will work:

Having multiple birdtv media entities and delete the video for one of them in bridtv backend. Then the response for https://api.brid.tv/apiv3/videos/view/{deleted-id}.json should be as indicated above.

As we have enabled the option "During synchronization, automatically delete media entities for deleted videos" maybe the video does not exist does not show up immediately. At least we get the error now, as our bridtv sync got stuck for a while due to πŸ› TypeError: Argument 1 passed to BridEntityResolver::getFieldItemList() must implement interface FieldableEntityInterface, null given Needs review .

Proposed resolution

1. Log client errors … could we log the error in BridApiConsumer::doGet()? Otherwise we may throw an error there and catch later.
2. Do not trow RequeueException

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany osopolar πŸ‡©πŸ‡ͺ GER 🌐

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024