Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1568047

Summary: Insights-client fails during analyzing of docker image
Product: Red Hat Hybrid Cloud Console (console.redhat.com) Reporter: Eduard <esakaiev>
Component: ClientAssignee: jcrafts
Status: CLOSED CURRENTRELEASE QA Contact: Jeff Needle <jneedle>
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: ecerqueira, jcrafts, jnewton, klape, lphiri, robwilli
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-14 18:25:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Report archive
none
output.json none

Description Eduard 2018-04-16 16:26:07 UTC
Description of problem:
Insights client fails during analyzing of docker image


Version-Release number of selected component (if applicable): 3.0.3-9
http://download.eng.bos.redhat.com/brewroot/packages/insights-client/3.0.3/9.el7_5/noarch/insights-client-3.0.3-9.el7_5.noarch.rpm

How reproducible:100%, 
reproduced under rhel7.5 and rhel7.4


Steps to Reproduce:
1. --install docker
sudo subscription-manager repos --enable=rhel-7-server-rpms
sudo subscription-manager repos --enable=rhel-7-server-extras-rpms
sudo subscription-manager repos --enable=rhel-7-server-optional-rpms
sudo yum install -y docker device-mapper-libs device-mapper-event-libs python-docker-py
sudo systemctl start docker.service
sudo systemctl enable docker.service

2. --pull docker image for test
sudo docker pull eduardomcerqueira/paws:0.3.8.1-centos-latest


3.--run get image id and analyze-image
sudo insights-client --analyze-image-id ddb20f8825f0


Actual results:
[root@virtrhel74 virtrhel74]# sudo insights-client --analyze-image-id ddb20f8825f0
Fatal error
Traceback (most recent call last):
  File "/etc/insights-client/rpm.egg/insights/client/phase/v1.py", line 29, in _f
    func()
  File "/etc/insights-client/rpm.egg/insights/client/phase/v1.py", line 170, in collect_and_output
    analyze_mountpoint=config["analyze_mountpoint"])
  File "/etc/insights-client/rpm.egg/insights/client/__init__.py", line 333, in collect
    tar_file = client.collect()
  File "/etc/insights-client/rpm.egg/insights/client/client.py", line 345, in collect
    container_connection = open_image(t['name'])
  File "/etc/insights-client/rpm.egg/insights/client/containers.py", line 251, in open_image
    mount_point, cid = DockerMount(mount_point).mount(image_id)
  File "/etc/insights-client/rpm.egg/insights/client/mount.py", line 281, in mount
    cid = driver_mount_fn(identifier)
  File "/etc/insights-client/rpm.egg/insights/client/mount.py", line 289, in _unsupported_backend
    ''.format(self.client.info()['Driver']))
MountError: Insights cannot be used with the overlay2 docker storage backend.



Expected results:
Should successfully executed


Additional info:

Comment 1 jcrafts 2018-04-16 17:33:43 UTC
Hi Jeff,

Can you post the Docker version? Thanks.

Comment 2 Eduard 2018-04-17 08:25:04 UTC
[root@virtrhel74 virtrhel74]# docker --version
Docker version 1.13.1, build 87f2fab/1.13.1

Comment 3 jcrafts 2018-04-17 13:54:25 UTC
See this changelog: https://github.com/moby/moby/releases/tag/v1.13.1

It looks like Docker 1.13.1 now uses the overlay2/overlay as the default storage driver instead of devicemapper. We don't support that, so this traceback is valid. Since this is now a known condition, we ought to make it fail more gracefully and inform the user that they should edit their docker configuration to use devicemapper.

Comment 4 Kyle Lape 2018-04-25 20:29:20 UTC
I think the most correct solution here is to add support for overlay2.  Asking customers to change the storage driver to devicemapper seems unreasonable, though we can at least document that solution for the time being.

Comment 5 Eduardo 2018-05-11 14:32:44 UTC
Any update on this? 

I tested now on:

(venv) [root@ecerquei-rhel75 insights-tests]# insights-client --version
Client: 3.0.3-9
Core: 3.0.4-3

and I am still seeing the same error:

MountError: Insights cannot be used with the overlay2 docker storage backend.

Comment 6 jcrafts 2018-05-14 14:13:45 UTC
No updates yet. There's still dev work that needs to be done on this.

Comment 7 Eduard 2018-06-13 12:58:29 UTC
Created attachment 1450903 [details]
Report archive

Comment 8 Eduard 2018-06-13 13:08:50 UTC
Hi all,

I have executed insights-client with another option for validating containers:
insights-client --analyze-container --keep-archive

the report (Report Archive) has been successfully uploaded to the server, 
output log has been attached( output.json).

Comment 9 Eduard 2018-06-13 13:09:30 UTC
Created attachment 1450904 [details]
output.json

Comment 10 Eduard 2018-06-13 14:21:05 UTC
Why could we use insights-client --analyze-container, but still can't use --analyze-image-id <id>?

Comment 11 jcrafts 2018-06-13 15:21:09 UTC
The difference is that --analyze-container treats the system running it as a container, and will upload to the images endpoint instead of the normal uploads endpoint. Docker is not used in this case.

For --analyze-image-id, however, we need to interface with the Docker daemon to actually mount an image.

Comment 12 Ivan Kanivets 2018-08-30 13:04:10 UTC
after recent egg update this is what happens
[root@ibm-p8-kvm-03-guest-02 ~]# insights-client --analyze-image-id ddb20f8825f0
WARNING: Excluding data from files
Fatal error
Traceback (most recent call last):
  File "/root/insights-core/rpm.egg/insights/client/phase/v1.py", line 34, in _f
    func(client, config)
  File "/root/insights-core/rpm.egg/insights/client/phase/v1.py", line 163, in collect_and_output
    tar_file = client.collect()
  File "/root/insights-core/rpm.egg/insights/client/__init__.py", line 51, in _init_connection
    return func(self, *args, **kwargs)
  File "/root/insights-core/rpm.egg/insights/client/__init__.py", line 307, in collect
    tar_file = client.collect(self.config, self.connection)
  File "/root/insights-core/rpm.egg/insights/client/client.py", line 316, in collect
    container_connection = open_image(target['name'])
  File "/root/insights-core/rpm.egg/insights/client/containers.py", line 207, in open_image
    mount_point, cid = DockerMount(mount_point).mount(image_id)
  File "/root/insights-core/rpm.egg/insights/client/mount.py", line 172, in __init__
    self.client = docker.Client(**kwargs_from_env())
AttributeError: 'module' object has no attribute 'Client'

Comment 14 jcrafts 2019-06-14 18:25:11 UTC
Docker analysis has been removed.