Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure in Scan of .deb file in docker #693

Closed
pombredanne opened this issue Apr 25, 2023 · 1 comment · Fixed by #694
Closed

Failure in Scan of .deb file in docker #693

pombredanne opened this issue Apr 25, 2023 · 1 comment · Fixed by #694

Comments

@pombredanne
Copy link
Member

pombredanne commented Apr 25, 2023

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.

@pombredanne pombredanne changed the title Failure in Scan Failure in Scan of .deb file in docker Apr 25, 2023
pombredanne added a commit to aboutcode-org/scancode-toolkit that referenced this issue Apr 25, 2023
Reported-by: @sisao Stefan Lorenz
Reference: aboutcode-org/scancode.io#693
Reference: #3259
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@pombredanne
Copy link
Member Author

pombredanne added a commit that referenced this issue Apr 25, 2023
Reference: #693
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
tdruez pushed a commit that referenced this issue Apr 25, 2023
Reference: #693

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant