Interface does not have an IPv4 address
Hi,
i'm trying to use clairctl but a problem is blocking me. When I try clairctl pull --local imagename it works fine but the next step generates this output clairctl --log-level debug --config $HOME/clairctl.yml push --local imagename:
2017-06-27 10:39:05.479391 D | config: Using config file: /Users/domenico/clairctl.yml
2017-06-27 10:39:05.479553 I | config: retrieving interface for local IP
2017-06-27 10:39:05.479561 D | config: no interface provided, looking for docker0
2017-06-27 10:39:05.479685 D | config: docker0 not found, looking for first connected broadcast interface
client quit unexpectedly
2017-06-27 10:39:05.479822 C | cmd: retrieving internal server IP: retrieving interface ip: Interface does not have an IPv4 address
I'm running the clairctl from my host (MacOS)
Hello, what is the content of your clairctl.yml config file ?
This was the content
port: 6060
healthPort: 6061
uri: http://localhost
report:
path: ./reports
format: html
docker:
insecure-registries:
- "localhost:5000"
Then I added
clairctl:
ip: 0.0.0.0
And it looks like this problem is gone. I think it is due to the fact that on MacOS there is no docker0 so clairctl cannot find it.
Unfortunately I encounter now another problem:
sudo clairctl --log-level debug --config $HOME/clairctl.yml analyze --local updatescenter_update_runner:
2017-06-27 13:16:06.549928 D | config: Using config file: /Users/domenico.caruso/clairctl.yml
2017-06-27 13:16:06.550236 D | dockercli: docker image to save: updatescenter_update_runner:latest
2017-06-27 13:16:06.550246 D | dockercli: saving in: /tmp/clairctl/updatescenter_update_runner/blobs
2017-06-27 13:16:15.538674 D | server: Update local server port from "0" to ""
2017-06-27 13:16:15.538706 I | server: Starting Server on [::]:49542
2017-06-27 13:16:15.544437 I | clair: using http://0.0.0.0:/local as local url
2017-06-27 13:16:15.544482 I | clair: Pushing Layer 1/9 [9ef38489fa05]
2017-06-27 13:16:15.544649 D | clair: Saving 9ef38489fa0510d23eb7618c32bb2f79c02990bd29b7a4bd09cc87bcfc4b210a[https:///v2]
2017-06-27 13:16:15.549602 I | clair: adding layer 1/9 [9ef38489fa05]: receiving http error: 400
client quit unexpectedly
2017-06-27 13:16:15.549657 C | cmd: pushing image "updatescenter_update_runner:latest": receiving http error: 400
Do you know what I'm doing wrong?
By using the --local, Clair server will try to download layers from your machine.
By changing the interface, probably your Clair container cannot interact with your machine anymore.
Could you show us your ifconfig?
You can also try to use clairctl in a container on the same network as clair
Le mar. 27 juin 2017 13:18, Domenico [email protected] a écrit :
This was the content
port: 6060 healthPort: 6061 uri: http://localhost report: path: ./reports format: html docker: insecure-registries: - "localhost:5000"
Then I added
clairctl: ip: 0.0.0.0
And it looks like this problem is gone. I think it is due to the fact that on MacOS there is no docker0 so clairctl cannot find it.
Unfortunately I encounter now another problem: sudo clairctl --log-level debug --config $HOME/clairctl.yml analyze --local updatescenter_update_runner:
2017-06-27 13:16:06.549928 D | config: Using config file: /Users/domenico.caruso/clairctl.yml 2017-06-27 13:16:06.550236 D | dockercli: docker image to save: updatescenter_update_runner:latest 2017-06-27 13:16:06.550246 D | dockercli: saving in: /tmp/clairctl/updatescenter_update_runner/blobs 2017-06-27 13:16:15.538674 D | server: Update local server port from "0" to "" 2017-06-27 13:16:15.538706 I | server: Starting Server on [::]:49542 2017-06-27 13:16:15.544437 I | clair: using http://0.0.0.0:/local as local url 2017-06-27 13:16:15.544482 I | clair: Pushing Layer 1/9 [9ef38489fa05] 2017-06-27 13:16:15.544649 D | clair: Saving 9ef38489fa0510d23eb7618c32bb2f79c02990bd29b7a4bd09cc87bcfc4b210a[https:///v2] 2017-06-27 13:16:15.549602 I | clair: adding layer 1/9 [9ef38489fa05]: receiving http error: 400 client quit unexpectedly 2017-06-27 13:16:15.549657 C | cmd: pushing image "updatescenter_update_runner:latest": receiving http error: 400
Do you know what I'm doing wrong? ps: shall I close this Issue and open another one or it is ok to continue here?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jgsqware/clairctl/issues/57#issuecomment-311328634, or mute the thread https://github.com/notifications/unsubscribe-auth/ADJrqxa5MhGokYCtorF4N9Sp8-PUsOgiks5sIOTvgaJpZM4OGUQn .
ifconfig:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8823<UP,BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 1500
ether 78:4f:43:63:b9:b8
nd6 options=201<PERFORMNUD,DAD>
media: autoselect (<unknown type>)
status: inactive
en1: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 12:00:0c:62:aa:00
media: autoselect <full-duplex>
status: inactive
en3: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 12:00:0c:62:aa:01
media: autoselect <full-duplex>
status: inactive
en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 12:00:0c:62:aa:04
media: autoselect <full-duplex>
status: inactive
en4: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 12:00:0c:62:aa:05
media: autoselect <full-duplex>
status: inactive
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether 12:00:0c:62:aa:00
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en1 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 7 priority 0 path cost 0
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 9 priority 0 path cost 0
member: en3 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 8 priority 0 path cost 0
member: en4 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 10 priority 0 path cost 0
nd6 options=201<PERFORMNUD,DAD>
media: <unknown type>
status: inactive
p2p0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 2304
ether 0a:4f:43:63:b9:b8
media: autoselect
status: inactive
awdl0: flags=8902<BROADCAST,PROMISC,SIMPLEX,MULTICAST> mtu 1484
ether 52:bd:95:2c:7b:8d
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: inactive
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
inet6 fe80::ce86:62b8:a745:6dfa%utun0 prefixlen 64 scopeid 0xe
nd6 options=201<PERFORMNUD,DAD>
en5: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether ac:de:48:00:11:22
inet6 fe80::aede:48ff:fe00:1122%en5 prefixlen 64 scopeid 0x5
nd6 options=281<PERFORMNUD,INSECURE,DAD>
media: autoselect
status: active
en7: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=4<VLAN_MTU>
ether 00:e0:4c:68:18:05
inet6 fe80::81b:d488:e697:4eb4%en7 prefixlen 64 secured scopeid 0x4
inet6 2a00:1798::8:46a:61b:dd45:f185 prefixlen 64 autoconf secured
inet6 2a00:1798::8:4531:ca4d:7c6:7e20 prefixlen 64 autoconf temporary
inet 192.168.0.121 netmask 0xfffffc00 broadcast 192.168.3.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect (1000baseT <full-duplex>)
status: active
I tried to run clairctl in a container but also there there was a problem with the docker.socket that had a permission denied
@jdel could you provide some help on how to use docker image?
Le mar. 27 juin 2017 15:31, Domenico [email protected] a écrit :
ifconfig:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP> inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 nd6 options=201<PERFORMNUD,DAD> gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280 stf0: flags=0<> mtu 1280 en0: flags=8823<UP,BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 1500 ether 78:4f:43:63:b9:b8 nd6 options=201<PERFORMNUD,DAD> media: autoselect (
) status: inactive en1: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500 options=60<TSO4,TSO6> ether 12:00:0c:62:aa:00 media: autoselect status: inactive en3: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500 options=60<TSO4,TSO6> ether 12:00:0c:62:aa:01 media: autoselect status: inactive en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500 options=60<TSO4,TSO6> ether 12:00:0c:62:aa:04 media: autoselect status: inactive en4: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500 options=60<TSO4,TSO6> ether 12:00:0c:62:aa:05 media: autoselect status: inactive bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=63<RXCSUM,TXCSUM,TSO4,TSO6> ether 12:00:0c:62:aa:00 Configuration: id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0 maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200 root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0 ipfilter disabled flags 0x2 member: en1 flags=3<LEARNING,DISCOVER> ifmaxaddr 0 port 7 priority 0 path cost 0 member: en2 flags=3<LEARNING,DISCOVER> ifmaxaddr 0 port 9 priority 0 path cost 0 member: en3 flags=3<LEARNING,DISCOVER> ifmaxaddr 0 port 8 priority 0 path cost 0 member: en4 flags=3<LEARNING,DISCOVER> ifmaxaddr 0 port 10 priority 0 path cost 0 nd6 options=201<PERFORMNUD,DAD> media: status: inactive p2p0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 2304 ether 0a:4f:43:63:b9:b8 media: autoselect status: inactive awdl0: flags=8902<BROADCAST,PROMISC,SIMPLEX,MULTICAST> mtu 1484 ether 52:bd:95:2c:7b:8d nd6 options=201<PERFORMNUD,DAD> media: autoselect status: inactive utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000 inet6 fe80::ce86:62b8:a745:6dfa%utun0 prefixlen 64 scopeid 0xe nd6 options=201<PERFORMNUD,DAD> en5: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 ether ac:de:48:00:11:22 inet6 fe80::aede:48ff:fe00:1122%en5 prefixlen 64 scopeid 0x5 nd6 options=281<PERFORMNUD,INSECURE,DAD> media: autoselect status: active en7: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=4<VLAN_MTU> ether 00:e0:4c:68:18:05 inet6 fe80::81b:d488:e697:4eb4%en7 prefixlen 64 secured scopeid 0x4 inet6 2a00:1798::8:46a:61b:dd45:f185 prefixlen 64 autoconf secured inet6 2a00:1798::8:4531:ca4d:7c6:7e20 prefixlen 64 autoconf temporary inet 192.168.0.121 netmask 0xfffffc00 broadcast 192.168.3.255 nd6 options=201<PERFORMNUD,DAD> media: autoselect (1000baseT ) status: active I tried to run clairctl in a container but also there there was a problem with the docker.socket that had a permission denied
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/jgsqware/clairctl/issues/57#issuecomment-311358587, or mute the thread https://github.com/notifications/unsubscribe-auth/ADJrqxAnh_B516-zF6BXxU_p5fK--VlTks5sIQQTgaJpZM4OGUQn .
Maybe the log from clair can help you figure out the problem:
{"Event":"failed to extract data from path","Level":"error","Location":"worker.go:122","Time":"2017-06-28 06:31:29.373256","error":"could not find layer","layer":"9ef38489fa0510d23eb7618c32bb2f79c02990bd29b7a4bd09cc87bcfc4b210a","path":"http://0.0.0.0:44480//local/updatescenter_update_runner/blobs/9ef38489fa0510d23eb7618c32bb2f79c02990bd29b7a4bd09cc87bcfc4b210a/layer.tar"}
{"Event":"Handled HTTP request","Level":"info","Location":"router.go:57","Time":"2017-06-28 06:31:29.373833","elapsed time":41830019,"method":"POST","remote addr":"172.25.0.1:58554","request uri":"/v1/layers","status":"400"}
@domcar @jgsqware : I need to document the usage of the container. If you're using docker for mac, you can add --group-add 50 to your docker run and that should be fine. You should be able to run the docker-compose out of the box on a mac. That's what I do on mine for testing purpose.