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

Resources from system packages are not being associated with that package #407

Closed
JonoYang opened this issue Mar 2, 2022 · 10 comments
Closed

Comments

@JonoYang
Copy link
Member

JonoYang commented Mar 2, 2022

I am running the docker pipeline on a docker image that uses Ubuntu 20.04 as the base image. The pipeline is able to report the installed system packages but does not correctly associate the package Resources to the package.

I've done some digging and found that the issue is with how the debian package info files are named.

By default, the files from /var/lib/dpkg/info/ that Debian based distros use to list the install location of package files has the format of
<package name>:<arch>.<ending> e.g. guile-2.0-libs:amd64.md5sums

When we extract the Docker image layer using extractcode, the colon in these filenames turns into an underscore: guile-2.0-libs_amd64.md5sums. This causes DebianPackage.get_list_of_installed_files() (https://github.com/nexB/scancode-toolkit/blob/develop/src/packagedcode/debian.py#L60) to not find the md5sum or list file for the package, and the package resources are not associated with it.

@pombredanne
Copy link
Member

Shrikes... so I think the best course of action may be to improve extractcode with an option to normalize names for windows or not. The ":" in a filename is illegal on Windows and extractcode is running on all OSes.
These issues are related too may be:

JonoYang added a commit that referenced this issue Jun 15, 2022
    * extract_tar uses the built in tar command, which does not do filename sanitization

Signed-off-by: Jono Yang <[email protected]>
JonoYang added a commit that referenced this issue Jun 16, 2022
@JonoYang
Copy link
Member Author

We are now using extract_tar from container-inspector to extract the Docker images and layers, but we're failing the test scanpipe.tests.test_pipes_docker.ScanPipeDockerPipesTest.test_pipes_docker_get_image_data_contains_layers_with_relative_paths:

======================================================================
ERROR: test_pipes_docker_get_image_data_contains_layers_with_relative_paths (scanpipe.tests.test_pipes_docker.ScanPipeDockerPipesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jono/nexb/src/scancode.io/scanpipe/tests/test_pipes_docker.py", line 68, in test_pipes_docker_get_image_data_contains_layers_with_relative_paths
    errors = docker.extract_layers_from_images_to_base_path(
  File "/home/jono/nexb/src/scancode.io/scanpipe/pipes/docker.py", line 108, in extract_layers_from_images_to_base_path
    extract_errors = extract_tar(
  File "/home/jono/nexb/src/scancode.io/lib/python3.10/site-packages/container_inspector/utils.py", line 97, in extract_tar
    with tarfile.open(location, 'r') as tarball:
  File "/home/jono/.pyenv/versions/3.10.4/lib/python3.10/tarfile.py", line 1629, in open
    raise ReadError(f"file could not be opened successfully:\n{error_msgs_summary}")
tarfile.ReadError: file could not be opened successfully:
- method gz: ReadError('not a gzip file')
- method bz2: ReadError('not a bzip2 file')
- method xz: ReadError('not an lzma file')
- method tar: ReadError('truncated header')

----------------------------------------------------------------------

JonoYang added a commit that referenced this issue Jun 16, 2022
    * Update expected test results

Signed-off-by: Jono Yang <[email protected]>
JonoYang added a commit that referenced this issue Jun 16, 2022
    * Update expected test results

Signed-off-by: Jono Yang <[email protected]>
tdruez pushed a commit that referenced this issue Jun 17, 2022
* Use extract_tar to extract images and layers #407

    * extract_tar uses the built in tar command, which does not do filename sanitization

Signed-off-by: Jono Yang <[email protected]>

* Update expected test results #407

Signed-off-by: Jono Yang <[email protected]>

* Recreate docker-images.tar.gz with valid tars #407

    * Update expected test results

Signed-off-by: Jono Yang <[email protected]>
@tdruez
Copy link
Contributor

tdruez commented Jun 21, 2022

@JonoYang we're having new kind of issue following the recent extraction changes.
For example https://staging.scancode.io/project/89a56139-c1da-414c-859c-770838f5c196/errors/
Could you have a look?

[_extract_tar: skipping link with missing target: <TarInfo 'etc/alternatives/awk' at 0x7f663b761940>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'etc/alternatives//usr/bin/mawk' not found" _extract_tar: skipping link with missing target: <TarInfo 'etc/alternatives/nawk' at 0x7f663b761ac0>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'etc/alternatives//usr/bin/mawk' not found" _extract_tar: skipping link with missing target: <TarInfo 'etc/alternatives/pager' at 0x7f663b761b80>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'etc/alternatives//bin/more' not found" _extract_tar: skipping link with missing target: <TarInfo 'etc/alternatives/rmt' at 0x7f663b761d00>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'etc/alternatives//usr/sbin/rmt-tar' not found" _extract_tar: skipping link with missing target: <TarInfo 'etc/alternatives/w' at 0x7f663b761dc0>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'etc/alternatives//usr/bin/w.procps' not found" _extract_tar: skipping link with missing target: <TarInfo 'etc/rmt' at 0x7f663af17040>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'etc//usr/sbin/rmt' not found" _extract_tar: skipping link with missing target: <TarInfo 'etc/systemd/system/default.target.wants/e2scrub_reap.service' at 0x7f663af15d00>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'etc/systemd/system/default.target.wants//lib/systemd/system/e2scrub_reap.service' not found" _extract_tar: skipping link with missing target: <TarInfo 'etc/systemd/system/timers.target.wants/apt-daily-upgrade.timer' at 0x7f663af15e80>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'etc/systemd/system/timers.target.wants//lib/systemd/system/apt-daily-upgrade.timer' not found" _extract_tar: skipping link with missing target: <TarInfo 'etc/systemd/system/timers.target.wants/apt-daily.timer' at 0x7f663af15f40>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'etc/systemd/system/timers.target.wants//lib/systemd/system/apt-daily.timer' not found" _extract_tar: skipping link with missing target: <TarInfo 'etc/systemd/system/timers.target.wants/e2scrub_all.timer' at 0x7f663af0f040>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'etc/systemd/system/timers.target.wants//lib/systemd/system/e2scrub_all.timer' not found" _extract_tar: skipping link with missing target: <TarInfo 'etc/systemd/system/timers.target.wants/fstrim.timer' at 0x7f663af0f100>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'etc/systemd/system/timers.target.wants//lib/systemd/system/fstrim.timer' not found" _extract_tar: skipping link with missing target: <TarInfo 'etc/systemd/system/timers.target.wants/motd-news.timer' at 0x7f663af0f1c0>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'etc/systemd/system/timers.target.wants//lib/systemd/system/motd-news.timer' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/bin/awk' at 0x7f663af46280>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/bin//etc/alternatives/awk' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/bin/nawk' at 0x7f663aed3700>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/bin//etc/alternatives/nawk' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/bin/pager' at 0x7f663aed3e80>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/bin//etc/alternatives/pager' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/bin/pidof' at 0x7f663aed54c0>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/bin//sbin/killall5' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/bin/w' at 0x7f663aedddc0>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/bin//etc/alternatives/w' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/lib64/ld-linux-x86-64.so.2' at 0x7f663ae76e80>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/lib64//lib/x86_64-linux-gnu/ld-2.31.so' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/sbin/rmt' at 0x7f663ae84400>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/sbin//etc/alternatives/rmt' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/share/doc/apt/NEWS.Debian.gz' at 0x7f663ae16c40>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/share/doc/apt/../libapt-pkg6.0/NEWS.Debian.gz' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/share/doc/apt/changelog.gz' at 0x7f663ae16d00>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/share/doc/apt/../libapt-pkg6.0/changelog.gz' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/share/doc/base-files/FAQ' at 0x7f663ae18040>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/share/doc/base-files/README' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/share/doc/libpam-modules/NEWS.Debian.gz' at 0x7f663ae25a00>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/share/doc/libpam-modules/../libpam0g/NEWS.Debian.gz' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/share/doc/libpam-modules-bin/NEWS.Debian.gz' at 0x7f663ae25dc0>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/share/doc/libpam-modules-bin/../libpam0g/NEWS.Debian.gz' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/share/doc/libpam-runtime/NEWS.Debian.gz' at 0x7f663ae27100>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/share/doc/libpam-runtime/../libpam0g/NEWS.Debian.gz' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/share/doc/mount/examples/fstab' at 0x7f663ae2e940>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/share/doc/mount/examples/../../util-linux/examples/fstab' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/share/doc/mount/mount.txt' at 0x7f663ae2ea00>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/share/doc/mount/../util-linux/mount.txt' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/share/doc/procps/NEWS.Debian.gz' at 0x7f663ae30640>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/share/doc/procps/../libprocps8/NEWS.Debian.gz' not found" _extract_tar: skipping link with missing target: <TarInfo 'var/lock' at 0x7f663ad8fe80>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'var//run/lock' not found" _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/gosu/.wh..wh..opq' at 0x7f663b761880> with relative path _extract_tar: skipping unsupported <TarInfo 'etc/systemd/user/.wh..wh..opq' at 0x7f663b7617c0> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/local/etc/ssl/.wh..wh..opq' at 0x7f663ae95b80> with relative path _extract_tar: skipping link with missing target: <TarInfo 'usr/local/etc/ssl/certs' at 0x7f663ae95c40>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/local/etc/ssl//etc/ssl/certs' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/local/etc/ssl/private' at 0x7f663ad92280>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/local/etc/ssl//etc/ssl/private' not found" _extract_tar: skipping unsupported <TarInfo 'usr/local/include/openssl/.wh..wh..opq' at 0x7f663ad924c0> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/local/lib/erlang/.wh..wh..opq' at 0x7f663ad8f880> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/local/lib/x86_64-linux-gnu/.wh..wh..opq' at 0x7f663aeef640> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/gcc-9-base/.wh..wh..opq' at 0x7f663aef1700> with relative path _extract_tar: skipping unsupported <TarInfo 'var/lib/apt/lists/auxfiles/.wh..wh..opq' at 0x7f663aef6040> with relative path _extract_tar: skipping unsupported <TarInfo 'var/lib/systemd/deb-systemd-user-helper-masked/.wh..wh..opq' at 0x7f663aef6c40> with relative path _extract_tar: skipping unsupported <TarInfo 'etc/rabbitmq/.wh..wh..opq' at 0x7f663b761ac0> with relative path _extract_tar: skipping link with missing target: <TarInfo 'root/.erlang.cookie' at 0x7f663b761f40>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'root//var/lib/rabbitmq/.erlang.cookie' not found" _extract_tar: skipping unsupported <TarInfo 'tmp/rabbitmq-ssl/.wh..wh..opq' at 0x7f663ae95340> with relative path _extract_tar: skipping unsupported <TarInfo 'var/lib/rabbitmq/.wh..wh..opq' at 0x7f663ae95640> with relative path _extract_tar: skipping unsupported <TarInfo 'var/log/rabbitmq/.wh..wh..opq' at 0x7f663ae957c0> with relative path _extract_tar: skipping unsupported <TarInfo 'opt/rabbitmq/.wh..wh..opq' at 0x7f663b761880> with relative path _extract_tar: skipping unsupported <TarInfo 'var/lib/apt/lists/auxfiles/.wh..wh..opq' at 0x7f663ae06100> with relative path _extract_tar: skipping link with missing target: <TarInfo 'plugins' at 0x7f663b761400>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname '/opt/rabbitmq/plugins' not found" _extract_tar: skipping unsupported <TarInfo 'etc/python3/.wh..wh..opq' at 0x7f663b761880> with relative path _extract_tar: skipping unsupported <TarInfo 'etc/python3.8/.wh..wh..opq' at 0x7f663b761b80> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/lib/python3/.wh..wh..opq' at 0x7f663ad92400> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/lib/python3.8/.wh..wh..opq' at 0x7f663ad92640> with relative path _extract_tar: skipping link with missing target: <TarInfo 'usr/lib/python3.8/sitecustomize.py' at 0x7f663aec5340>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/lib/python3.8//etc/python3.8/sitecustomize.py' not found" _extract_tar: skipping unsupported <TarInfo 'usr/lib/valgrind/.wh..wh..opq' at 0x7f663aede4c0> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/lib/x86_64-linux-gnu/engines-1.1/.wh..wh..opq' at 0x7f663aede7c0> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/local/lib/python3.8/.wh..wh..opq' at 0x7f663aedf940> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/applications/.wh..wh..opq' at 0x7f663aedfdc0> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/binfmts/.wh..wh..opq' at 0x7f663aee1040> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/bug/mime-support/.wh..wh..opq' at 0x7f663aee1340> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/libexpat1/.wh..wh..opq' at 0x7f663aee1640> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/libmpdec2/.wh..wh..opq' at 0x7f663aee1940> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/libpython3-stdlib/.wh..wh..opq' at 0x7f663aee1c40> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/libpython3.8-minimal/.wh..wh..opq' at 0x7f663aee1f40> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/libreadline8/.wh..wh..opq' at 0x7f663aee3340> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/libsqlite3-0/.wh..wh..opq' at 0x7f663aee3700> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/libssl1.1/.wh..wh..opq' at 0x7f663aee3a00> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/mime-support/.wh..wh..opq' at 0x7f663aee3d00> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/python3/.wh..wh..opq' at 0x7f663aee3f40> with relative path _extract_tar: skipping link with missing target: <TarInfo 'usr/share/doc/python3/README.Debian' at 0x7f663aee6040>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/share/doc/python3/../libpython3-stdlib/README.Debian' not found" _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/python3-minimal/.wh..wh..opq' at 0x7f663aee6400> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/python3.8/.wh..wh..opq' at 0x7f663aee6700> with relative path _extract_tar: skipping link with missing target: <TarInfo 'usr/share/doc/python3.8/changelog.gz' at 0x7f663aee6880>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/share/doc/python3.8/NEWS.gz' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/share/doc/python3.8/python-policy.dbk.gz' at 0x7f663aee6a00>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/share/doc/python3.8/../python3/python-policy.dbk.gz' not found" _extract_tar: skipping link with missing target: <TarInfo 'usr/share/doc/python3.8/python-policy.txt.gz' at 0x7f663aee6b80>: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/container_inspector/utils.py", line 120, in extract_tar target = tarball._find_link_target(tarinfo) File "/usr/local/lib/python3.9/tarfile.py", line 2418, in _find_link_target raise KeyError("linkname %r not found" % linkname) KeyError: "linkname 'usr/share/doc/python3.8/../python3/python-policy.txt.gz' not found" _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/python3.8-minimal/.wh..wh..opq' at 0x7f663aee6d00> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/doc/readline-common/.wh..wh..opq' at 0x7f663aee8040> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/python3/.wh..wh..opq' at 0x7f663aee8d00> with relative path _extract_tar: skipping unsupported <TarInfo 'usr/share/readline/.wh..wh..opq' at 0x7f663aeecdc0> with relative path _extract_tar: skipping unsupported <TarInfo 'var/lib/python/.wh..wh..opq' at 0x7f663aefcac0> with relative path](https://staging.scancode.io/project/89a56139-c1da-414c-859c-770838f5c196/errors/?message=_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27etc/alternatives/awk%27%20at%200x7f663b761940%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27etc/alternatives//usr/bin/mawk%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27etc/alternatives/nawk%27%20at%200x7f663b761ac0%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27etc/alternatives//usr/bin/mawk%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27etc/alternatives/pager%27%20at%200x7f663b761b80%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27etc/alternatives//bin/more%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27etc/alternatives/rmt%27%20at%200x7f663b761d00%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27etc/alternatives//usr/sbin/rmt-tar%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27etc/alternatives/w%27%20at%200x7f663b761dc0%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27etc/alternatives//usr/bin/w.procps%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27etc/rmt%27%20at%200x7f663af17040%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27etc//usr/sbin/rmt%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27etc/systemd/system/default.target.wants/e2scrub_reap.service%27%20at%200x7f663af15d00%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27etc/systemd/system/default.target.wants//lib/systemd/system/e2scrub_reap.service%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27etc/systemd/system/timers.target.wants/apt-daily-upgrade.timer%27%20at%200x7f663af15e80%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27etc/systemd/system/timers.target.wants//lib/systemd/system/apt-daily-upgrade.timer%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27etc/systemd/system/timers.target.wants/apt-daily.timer%27%20at%200x7f663af15f40%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27etc/systemd/system/timers.target.wants//lib/systemd/system/apt-daily.timer%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27etc/systemd/system/timers.target.wants/e2scrub_all.timer%27%20at%200x7f663af0f040%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27etc/systemd/system/timers.target.wants//lib/systemd/system/e2scrub_all.timer%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27etc/systemd/system/timers.target.wants/fstrim.timer%27%20at%200x7f663af0f100%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27etc/systemd/system/timers.target.wants//lib/systemd/system/fstrim.timer%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27etc/systemd/system/timers.target.wants/motd-news.timer%27%20at%200x7f663af0f1c0%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27etc/systemd/system/timers.target.wants//lib/systemd/system/motd-news.timer%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/bin/awk%27%20at%200x7f663af46280%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/bin//etc/alternatives/awk%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/bin/nawk%27%20at%200x7f663aed3700%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/bin//etc/alternatives/nawk%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/bin/pager%27%20at%200x7f663aed3e80%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/bin//etc/alternatives/pager%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/bin/pidof%27%20at%200x7f663aed54c0%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/bin//sbin/killall5%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/bin/w%27%20at%200x7f663aedddc0%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/bin//etc/alternatives/w%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/lib64/ld-linux-x86-64.so.2%27%20at%200x7f663ae76e80%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/lib64//lib/x86_64-linux-gnu/ld-2.31.so%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/sbin/rmt%27%20at%200x7f663ae84400%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/sbin//etc/alternatives/rmt%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/share/doc/apt/NEWS.Debian.gz%27%20at%200x7f663ae16c40%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/share/doc/apt/../libapt-pkg6.0/NEWS.Debian.gz%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/share/doc/apt/changelog.gz%27%20at%200x7f663ae16d00%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/share/doc/apt/../libapt-pkg6.0/changelog.gz%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/share/doc/base-files/FAQ%27%20at%200x7f663ae18040%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/share/doc/base-files/README%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/share/doc/libpam-modules/NEWS.Debian.gz%27%20at%200x7f663ae25a00%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/share/doc/libpam-modules/../libpam0g/NEWS.Debian.gz%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/share/doc/libpam-modules-bin/NEWS.Debian.gz%27%20at%200x7f663ae25dc0%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/share/doc/libpam-modules-bin/../libpam0g/NEWS.Debian.gz%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/share/doc/libpam-runtime/NEWS.Debian.gz%27%20at%200x7f663ae27100%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/share/doc/libpam-runtime/../libpam0g/NEWS.Debian.gz%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/share/doc/mount/examples/fstab%27%20at%200x7f663ae2e940%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/share/doc/mount/examples/../../util-linux/examples/fstab%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/share/doc/mount/mount.txt%27%20at%200x7f663ae2ea00%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/share/doc/mount/../util-linux/mount.txt%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/share/doc/procps/NEWS.Debian.gz%27%20at%200x7f663ae30640%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/share/doc/procps/../libprocps8/NEWS.Debian.gz%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27var/lock%27%20at%200x7f663ad8fe80%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27var//run/lock%27%20not%20found%22_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/gosu/.wh..wh..opq%27%20at%200x7f663b761880%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27etc/systemd/user/.wh..wh..opq%27%20at%200x7f663b7617c0%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/local/etc/ssl/.wh..wh..opq%27%20at%200x7f663ae95b80%3E%20with%20relative%20path_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/local/etc/ssl/certs%27%20at%200x7f663ae95c40%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/local/etc/ssl//etc/ssl/certs%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/local/etc/ssl/private%27%20at%200x7f663ad92280%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/local/etc/ssl//etc/ssl/private%27%20not%20found%22_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/local/include/openssl/.wh..wh..opq%27%20at%200x7f663ad924c0%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/local/lib/erlang/.wh..wh..opq%27%20at%200x7f663ad8f880%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/local/lib/x86_64-linux-gnu/.wh..wh..opq%27%20at%200x7f663aeef640%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/gcc-9-base/.wh..wh..opq%27%20at%200x7f663aef1700%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27var/lib/apt/lists/auxfiles/.wh..wh..opq%27%20at%200x7f663aef6040%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27var/lib/systemd/deb-systemd-user-helper-masked/.wh..wh..opq%27%20at%200x7f663aef6c40%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27etc/rabbitmq/.wh..wh..opq%27%20at%200x7f663b761ac0%3E%20with%20relative%20path_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27root/.erlang.cookie%27%20at%200x7f663b761f40%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27root//var/lib/rabbitmq/.erlang.cookie%27%20not%20found%22_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27tmp/rabbitmq-ssl/.wh..wh..opq%27%20at%200x7f663ae95340%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27var/lib/rabbitmq/.wh..wh..opq%27%20at%200x7f663ae95640%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27var/log/rabbitmq/.wh..wh..opq%27%20at%200x7f663ae957c0%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27opt/rabbitmq/.wh..wh..opq%27%20at%200x7f663b761880%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27var/lib/apt/lists/auxfiles/.wh..wh..opq%27%20at%200x7f663ae06100%3E%20with%20relative%20path_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27plugins%27%20at%200x7f663b761400%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27/opt/rabbitmq/plugins%27%20not%20found%22_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27etc/python3/.wh..wh..opq%27%20at%200x7f663b761880%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27etc/python3.8/.wh..wh..opq%27%20at%200x7f663b761b80%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/lib/python3/.wh..wh..opq%27%20at%200x7f663ad92400%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/lib/python3.8/.wh..wh..opq%27%20at%200x7f663ad92640%3E%20with%20relative%20path_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/lib/python3.8/sitecustomize.py%27%20at%200x7f663aec5340%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/lib/python3.8//etc/python3.8/sitecustomize.py%27%20not%20found%22_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/lib/valgrind/.wh..wh..opq%27%20at%200x7f663aede4c0%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/lib/x86_64-linux-gnu/engines-1.1/.wh..wh..opq%27%20at%200x7f663aede7c0%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/local/lib/python3.8/.wh..wh..opq%27%20at%200x7f663aedf940%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/applications/.wh..wh..opq%27%20at%200x7f663aedfdc0%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/binfmts/.wh..wh..opq%27%20at%200x7f663aee1040%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/bug/mime-support/.wh..wh..opq%27%20at%200x7f663aee1340%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/libexpat1/.wh..wh..opq%27%20at%200x7f663aee1640%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/libmpdec2/.wh..wh..opq%27%20at%200x7f663aee1940%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/libpython3-stdlib/.wh..wh..opq%27%20at%200x7f663aee1c40%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/libpython3.8-minimal/.wh..wh..opq%27%20at%200x7f663aee1f40%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/libreadline8/.wh..wh..opq%27%20at%200x7f663aee3340%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/libsqlite3-0/.wh..wh..opq%27%20at%200x7f663aee3700%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/libssl1.1/.wh..wh..opq%27%20at%200x7f663aee3a00%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/mime-support/.wh..wh..opq%27%20at%200x7f663aee3d00%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/python3/.wh..wh..opq%27%20at%200x7f663aee3f40%3E%20with%20relative%20path_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/share/doc/python3/README.Debian%27%20at%200x7f663aee6040%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/share/doc/python3/../libpython3-stdlib/README.Debian%27%20not%20found%22_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/python3-minimal/.wh..wh..opq%27%20at%200x7f663aee6400%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/python3.8/.wh..wh..opq%27%20at%200x7f663aee6700%3E%20with%20relative%20path_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/share/doc/python3.8/changelog.gz%27%20at%200x7f663aee6880%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/share/doc/python3.8/NEWS.gz%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/share/doc/python3.8/python-policy.dbk.gz%27%20at%200x7f663aee6a00%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/share/doc/python3.8/../python3/python-policy.dbk.gz%27%20not%20found%22_extract_tar:%20skipping%20link%20with%20missing%20target:%20%3CTarInfo%20%27usr/share/doc/python3.8/python-policy.txt.gz%27%20at%200x7f663aee6b80%3E:%20Traceback%20(most%20recent%20call%20last):%20%20File%20%22/usr/local/lib/python3.9/site-packages/container_inspector/utils.py%22,%20line%20120,%20in%20extract_tar%20%20%20%20target%20=%20tarball._find_link_target(tarinfo)%20%20File%20%22/usr/local/lib/python3.9/tarfile.py%22,%20line%202418,%20in%20_find_link_target%20%20%20%20raise%20KeyError(%22linkname%20%r%20not%20found%22%20%%20linkname)KeyError:%20%22linkname%20%27usr/share/doc/python3.8/../python3/python-policy.txt.gz%27%20not%20found%22_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/python3.8-minimal/.wh..wh..opq%27%20at%200x7f663aee6d00%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/doc/readline-common/.wh..wh..opq%27%20at%200x7f663aee8040%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/python3/.wh..wh..opq%27%20at%200x7f663aee8d00%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27usr/share/readline/.wh..wh..opq%27%20at%200x7f663aeecdc0%3E%20with%20relative%20path_extract_tar:%20skipping%20unsupported%20%3CTarInfo%20%27var/lib/python/.wh..wh..opq%27%20at%200x7f663aefcac0%3E%20with%20relative%20path)

@JonoYang
Copy link
Member Author

@tdruez

I run the Docker pipeline on docker://rabbitmq:3.9.13-management and got the same errors. I also tried running extract_tar directly through the shell on the Docker image and got the same problem also. I took a look at the layers that have symlinks, specifically 867d0767a47c392f80acb51572851923d6d3e55289828b0cd84a96ba342660c7.tar. I was able to extract the layer using file roller with no problems.

I then took a closer look at the symlinks. In 867d0767a47c392f80acb51572851923d6d3e55289828b0cd84a96ba342660c7.tar, /etc/alternatives/ contains symlinks to binaries in /usr/bin/. The file 867d0767a47c392f80acb51572851923d6d3e55289828b0cd84a96ba342660c7.tar/etc/alternatives/awk is a symlink to /usr/bin/mawk. When I extracted 867d0767a47c392f80acb51572851923d6d3e55289828b0cd84a96ba342660c7.tar using file roller, the symlink 867d0767a47c392f80acb51572851923d6d3e55289828b0cd84a96ba342660c7.tar/etc/alternatives/awk points to /usr/bin/mawk of my system rather than 867d0767a47c392f80acb51572851923d6d3e55289828b0cd84a96ba342660c7.tar/usr/bin/mawk.

I also noticed that the skip_symlinks argument of extract_tar does not do anything and that we still try to handle extracting links. I'll create a PR to fix that, but this raises a question for me. Should we be skipping symlinks, as we did before with extractcode?

@tdruez
Copy link
Contributor

tdruez commented Jun 22, 2022

Should we be skipping symlinks, as we did before with extractcode?

Since we exclude the symlinks form the results, it's probably not an issue to skip them early during extraction.
Unless you think it adds any value in the review process.

@JonoYang
Copy link
Member Author

@tdruez I updated the code in extract_tar to properly skip symlinks and I tried the docker pipeline on docker://rabbitmq:3.9.13-management again. I got one error this time, which are the warning messages returned by extract_tar()

[_extract_tar: skipping unsupported <TarInfo 'usr/share/doc/gosu/.wh..wh..opq' at 0x7f9990504580> with relative path
_extract_tar: skipping unsupported <TarInfo 'etc/systemd/user/.wh..wh..opq' at 0x7f9990504400> with relative path
_extract_tar: skipping unsupported <TarInfo 'usr/local/etc/ssl/.wh..wh..opq' at 0x7f99905056c0> with relative path
...

Should messages like these be returned as error messages by extract_tar() or should they only be displayed to the terminal when tracing is on? (https://github.com/nexB/container-inspector/blob/extract_tar-skip-symlinks/src/container_inspector/utils.py#L112)

@tdruez
Copy link
Contributor

tdruez commented Jun 24, 2022

@JonoYang I'm not sure about the value of logging those as ProjectError.
@pombredanne what's your take on this?

@pombredanne
Copy link
Member

@tdruez this is since we now use plain tar over extractcode. we will need to either revert or add capabilities to extract links. The later seems better

pombredanne added a commit that referenced this issue Jul 30, 2022
Use the latest container-inspector to fix symlinks extraction.
In particular broken synlinks are not treated as an error anymore
and symlinks are extracted correctly.

Reference: #471
Reference: #407
Signed-off-by: Philippe Ombredanne <[email protected]>
pombredanne added a commit that referenced this issue Jul 30, 2022
Use the latest container-inspector to fix symlinks extraction.
In particular broken synlinks are not treated as an error anymore
and symlinks are extracted correctly.

Reference: #471
Reference: #407
Signed-off-by: Philippe Ombredanne <[email protected]>
pombredanne added a commit that referenced this issue Jul 31, 2022
Use the latest container-inspector to fix symlinks extraction.
In particular broken synlinks are not treated as an error anymore
and symlinks are extracted correctly.

Reference: #471
Reference: #407
Signed-off-by: Philippe Ombredanne <[email protected]>
pombredanne added a commit that referenced this issue Jul 31, 2022
Use the latest container-inspector to fix symlinks extraction.
In particular broken synlinks are not treated as an error anymore
and symlinks are extracted correctly.

Reference: #471
Reference: #407
Signed-off-by: Philippe Ombredanne <[email protected]>
tdruez added a commit that referenced this issue Aug 1, 2022
tdruez added a commit that referenced this issue Aug 1, 2022
* Correctly extract symlinks #407 #471

Use the latest container-inspector to fix symlinks extraction.
In particular broken synlinks are not treated as an error anymore
and symlinks are extracted correctly.

Reference: #471
Reference: #407
Signed-off-by: Philippe Ombredanne <[email protected]>

* Update container_inspector to 32.0.1 version #407 #471

Co-authored-by: Philippe Ombredanne <[email protected]>

Co-authored-by: tdruez <[email protected]>
@tdruez
Copy link
Contributor

tdruez commented Aug 1, 2022

@JonoYang what's the status on this one following the merge of #479 ?

@JonoYang
Copy link
Member Author

JonoYang commented Aug 2, 2022

@tdruez

I've merged in the latest changes from main into the package-scanning-update branch and I've run the docker pipeline on docker://rabbitmq:3.9.13-management. It looks like the Debian installed package detection code is accounting for the files with a colon in their names and is properly associating the files listed in them the Package.

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

No branches or pull requests

3 participants