Pipeline run pages return 500 for a schedule whose pipeline is not registered
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
Start with PipelineSchedule.pipeline_class in vulnerabilities/models.py, then trace its use in PipelineRunListView and PipelineRunDetailView and in PipelineRun.pipeline_url. Run the new PipelineRunViewsUnregisteredPipelineTestCase in vulnerabilities/tests/test_view.py; done means both run pages return 200 for an unregistered pipeline and show its id as the page name.
Written by the indexing model from the issue text.
Description
Problem
PipelineSchedule rows persist in the database. When a pipeline is removed or renamed (for example the open "Remove v1 code" work), every stale schedule's run pages crash:
GET /pipelines/<pipeline_id>/runs/→ 500GET /pipelines/<pipeline_id>/run/<uuid>/→ 500
Evidence
PipelineSchedule.pipeline_class (vulnerabilities/models.py) does a bare dict lookup, pipeline_registry[self.pipeline_id], which raises KeyError for an id that is no longer registered. Both PipelineRunListView.get_context_data and PipelineRunDetailView.get_context_data dereference it (pipeline_class.__name__), and the run detail template also reaches it through PipelineRun.pipeline_url when the run has a commit recorded.
Reproduced locally on PostgreSQL 16 with a schedule and a run using pipeline_id="hunt_probe_no_such_pipeline": both pages 500 with KeyError: 'hunt_probe_no_such_pipeline'. The dashboard list page is not affected — its template never calls pipeline_class.
Fix
pipeline_classreturnsNonefor an unregistered id (.get()instead of[]);descriptionalready guards on a falsy class.- Both views fall back to the raw
pipeline_idas the page name when the class is unknown. pipeline_urlreturnsNonewhen the class is unknown, so the detail template's commit link degrades cleanly.
Tests
New PipelineRunViewsUnregisteredPipelineTestCase in vulnerabilities/tests/test_view.py: both pages return 200 with the pipeline id as the name for an unregistered pipeline. Both tests fail on unmodified main and pass with the fix. Full test_view.py: 14 passed (1 pre-existing flaky timing failure in test_aggregate_fixed_and_affected_packages, fails on main too); pipeline model tests 10 passed.
- Dominant language
- Python
- Stars
- 719
- Forks
- 359
- Avg merge
- 11h 59m
- Merged PRs (30d)
- 2
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No 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 aboutcode-org/vulnerablecode
-
Affected-by-advisories v2 page returns 500 for a purl with no matching packagePossibly taken @sanchit955 claimed this 2 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
aboutcode-org/vulnerablecode#2501 ·
Maintainers usually reply within 1 day
-
OSV v3 parser shares introduced/fixed commit patches across affected packagesPossibly taken @Celestial-0 claimed this 15 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
aboutcode-org/vulnerablecode#2489 ·
Maintainers usually reply within 1 day
-
OSV parser drops all crates.io affected entries because the ecosystem mapping uses cargoPossibly taken @Ashutosh-Panda2004 claimed this 22 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
aboutcode-org/vulnerablecode#2485 · 1 comment ·
Maintainers usually reply within 1 day
-
Docker Compose setup fails on wait-for-it host web:8000 and missing runtime .envPossibly taken @Anurag-S1ngh claimed this 25 days ago. Open
Difficulty 2/5 Half a day Newbie friendliness 77/100
aboutcode-org/vulnerablecode#2477 · 1 comment ·
Maintainers usually reply within 1 day
-
OVAL parser corrupts version bounds when the epoch is 10, 20 or the version contains "0:"Possibly taken @Ashutosh-Panda2004 claimed this 23 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
aboutcode-org/vulnerablecode#2474 · 1 comment ·
Maintainers usually reply within 1 day
All issues in aboutcode-org/vulnerablecode
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mohanraj00/entelos#200 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
sweep
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
bketelsen/truenas-mcp#77 ·
Maintainers usually reply within 1 day
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskOpen
Difficulty 1/5 Under an hour Newbie friendliness 86/100
sandbox-quantum/switch#2163 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
openedx/xblock-lti-consumer#765 ·
Maintainers usually reply within 1 day