scancode aborts when encountering a broken RPM archive
Maintainers usually reply within 2 days
@Ashutosh-Panda2004 is already working on this.
Since Nov 4, 2026.
- #5417 by @Ashutosh-Panda2004 — open
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
Research direction
The traceback points to src/packagedcode/rpm.py, where get_rpm_tags (around line 87) builds RPM(rpmf) and parse (around line 293) calls it, and to src/packagedcode/pyrpm.py, where read_lead (around line 425) raises RPMError on a wrong magic number. Start by reproducing the crash on the suspected tests/data/archive.rpm from fuse-archive. Done means the scan no longer aborts or hangs on a non-RPM file, the error is handled or skipped, and the worker pool keeps going.
Written by the indexing model from the issue text.
Description
While scanning the fuse-archive 1.22 source directory in a yocto build, scancode crashes and hangs forever:
Process ForkPoolWorker-15:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/local/lib/python3.12/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.12/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
^^^^^^^^^^^^^^^^^^^
File "/scancode-toolkit/src/scancode/cli.py", line 1456, in scan_resource
error, values_mapping = interruptor(runner, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scancode-toolkit/src/scancode/interrupt.py", line 91, in interruptible
return NO_ERROR, func(*(args or ()), **(kwargs or {}))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scancode-toolkit/src/scancode/api.py", line 327, in get_package_data
package_datas = _get_package_data(
^^^^^^^^^^^^^^^^^^
File "/scancode-toolkit/src/scancode/api.py", line 276, in _get_package_data
return recognize_package_data(
^^^^^^^^^^^^^^^^^^^^^^^
File "/scancode-toolkit/src/packagedcode/recognize.py", line 62, in recognize_package_data
return list(_parse(
^^^^^^^^^^^^
File "/scancode-toolkit/src/packagedcode/recognize.py", line 136, in _parse
for parsed in handler.parse(location=location, package_only=package_only):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scancode-toolkit/src/packagedcode/rpm.py", line 293, in parse
rpm_tags = get_rpm_tags(location, include_desc=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scancode-toolkit/src/packagedcode/rpm.py", line 87, in get_rpm_tags
rpm = RPM(rpmf)
^^^^^^^^^
File "/scancode-toolkit/src/packagedcode/pyrpm.py", line 399, in __init__
self.read_lead()
File "/scancode-toolkit/src/packagedcode/pyrpm.py", line 425, in read_lead
raise RPMError('Wrong magic number: this is not a RPM file')
packagedcode.pyrpm.RPMError: Wrong magic number: this is not a RPM file
The offending file might be https://github.com/google/fuse-archive/blob/main/tests/data/archive.rpm.
- Dominant language
- Python
- Stars
- 2.7k
- Forks
- 871
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 3
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 aboutcode-org/scancode-toolkit
-
yarn.lock v1 with a scoped alias of an unscoped package yields no packages and no errorPossibly taken @Shubham-dev-stack claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
aboutcode-org/scancode-toolkit#5466 ·
Maintainers usually reply within 2 days
-
package-lock.json dependencies report file_references as a list inside a listPossibly taken @Anbarasu2410 claimed this 9 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
aboutcode-org/scancode-toolkit#5449 · 4 comments ·
Maintainers usually reply within 2 days
-
Four silent bugs: IsRequiredPhrase.license_expression returns None, find_in_path ignores later PATH changes, duplicate dict keys override license mappingsPossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 Half a day Newbie friendliness 65/100
aboutcode-org/scancode-toolkit#5405 · 1 comment ·
Maintainers usually reply within 2 days
-
parse_maintainer_name_email returns empty name and wrong email when string has "@" but no angle bracketsPossibly taken @RohitSutar1823 claimed this 14 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
aboutcode-org/scancode-toolkit#5402 ·
Maintainers usually reply within 2 days
-
bug: Unreachable JSON extension and format validation in validate_input_pathPossibly taken @0Cymantek0 claimed this 38 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
aboutcode-org/scancode-toolkit#5351 · 1 comment ·
Maintainers usually reply within 2 days
All issues in aboutcode-org/scancode-toolkit
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