app:url:download crashes with MissingIdentifierField after the download process stops
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 69/100
Research direction
Start with ProcessStoppedListener.php, especially onCliProcessStopEvent() and the find($event->downloadJob->getId()) call described in the issue. Trace how UrlDownloadCommand creates its DownloadJob and check existing listener tests. Verify that running the command exits successfully and that a test covers an unpersisted job.
Written by the indexing model from the issue text.
Description
Problem
bin/console app:url:download <url> crashes after the first yt-dlp run. Found while testing #46 / #52:
[Doctrine\ORM\Exception\MissingIdentifierField]
The identifier id is missing for a query of App\Entity\DownloadJob
at ProcessStoppedListener.php:38 ($this->downloadJobRepository->find($event->downloadJob->getId()))
... AbstractCliDownloader->runDownloadProcess()
... UrlDownloadCommand->execute()
UrlDownloadCommand creates a DownloadJob that is never persisted (id is null). ProcessStoppedListener::onCliProcessStopEvent() calls find(null) on it, which throws. The download itself happens, but the command exits with an error, and since #52 the retry without the download archive never runs from this command.
Proposed fix
Either:
- Guard the listener: skip the database work in
ProcessStoppedListenerwhen the job has no id (null === $event->downloadJob->getId()). The command stays a "download only, don't record" tool. - Persist the job in the command: save the job (with downloader and state) before downloading, so CLI downloads behave like API downloads and get events and linked files.
The guard is the smaller fix. Persisting may be preferable if CLI downloads should show up in the admin panel.
Verification
bin/console app:url:download --downloader yt-dlp-cli <url> exits with 0, and a test covering the listener with an unpersisted job.
- Dominant language
- PHP
- Stars
- 1
- Forks
- 0
- Avg merge
- 3d 50m
- Merged PRs (30d)
- 9
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from FetchDock/fetchdock-server
-
bug dependencies
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
FetchDock/fetchdock-server#53 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 24/100
FetchDock/fetchdock-server#55 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
FetchDock/fetchdock-server#23 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
FetchDock/fetchdock-server#22 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 38/100
FetchDock/fetchdock-server#21 ·
Maintainers usually reply within 1 day
All issues in FetchDock/fetchdock-server
Similar issues
-
AI effort: [XS] priority: medium severity: minor type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Exclude module `require-dev` and `autoload-dev` from the generated `composer.json`Possibly taken @keiserjb claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
uiowa/uiowa#10310 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mailcow/mailcow-dockerized#7677 · 1 comment ·
Maintainers usually reply within 1 day