Skip to content

Failure in Scan of .deb file in docker #693

Description

@pombredanne

This failure occurred while running a docker image scan

ERROR: for scanner: package_data: ERROR: Unknown error: Traceback (most recent call last): 
File "/usr/local/lib/python3.11/site-packages/scancode/interrupt.py", line 91, in interruptible return NO_ERROR, func(*(args or ()), **(kwargs or {})) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
File "/usr/local/lib/python3.11/site-packages/scancode/api.py", line 357, in get_package_data return dict(package_data=[pd.to_dict() for pd in package_datas]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
File "/usr/local/lib/python3.11/site-packages/scancode/api.py", line 357, in <listcomp> return dict(package_data=[pd.to_dict() for pd in package_datas]) ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/packagedcode/models.py", line 680, in to_dict mapping = super().to_dict(with_details=with_details, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
File "/usr/local/lib/python3.11/site-packages/packagedcode/models.py", line 314, in to_dict mapping['purl'] = self.purl ^^^^^^^^^ 
File "/usr/local/lib/python3.11/site-packages/packagedcode/models.py", line 287, in purl return PackageURL( ^^^^^^^^^^^ 
File "/usr/local/lib/python3.11/site-packages/packageurl/__init__.py", line 388, in __new__ raise ValueError(f"Invalid purl: {key} argument must be a string: {repr(value)}.") ValueError: Invalid purl: version argument must be a string: Version(epoch=0, upstream='1.6', revision='2'). 

I recreated a minimal example this way:

wget http://ftp.us.debian.org/debian/pool/main/b/bridge-utils/bridge-utils_1.6-2_amd64.deb
mkdir -p img/usr/local/archives/
mv bridge-utils_1.6-2_amd64.deb img/usr/local/archives/
tar -cf initial.tar -C img/ .
cat initial.tar | docker import -m "initial import" - sample:1.0 
docker save sample:1.0 > sample-image.tar

This image tarball attached as sample-image.zip that you need to unzip first (this is zipped here so that GitHub accepts it as an attachment)
sample-image.zip

Ignore the "no distro" error in this test archive
Note also that there is a timeout on license detection ERROR: for scanner: licenses: ERROR: Processing interrupted: timeout after 120 seconds. but I cannot see which is the culprit file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions