Project

General

Profile

Bug #21892

Docker - containers log endpoint tries to connect to local /var/run/docker.sock even for external docker resource

Added by Sebastian Gräßl over 2 years ago.

Status:
New
Priority:
Normal
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1479291

Description of problem:
Reading docker container logs does not work over tcp and keeps trying to connect to /var/run/docker.sock on the foreman host instead of using TCP/TLS for reaching the external docker interface.

Steps to Reproduce:
1. have an external host running docker, configured to accept tcp/tls connections
2. add a docker compute resource with tcp:// enabled
3. create a container via web interface
4. try to read the container logs via the web interface

Actual results:
2017-08-01 17:18:26 - nailgun.client - DEBUG - Making HTTP POST request to https://sat6.com/api/v2/compute_resources with options {'verify': False, 'auth': ('admin', 'changeme'), 'headers': {'content-type': 'application/json'}}, no params and data {
"compute_resource": {
"provider": "Docker",
"url": "http://10.8.29.107:2375",
"organization_ids": [55],
"name": "ApReidcCPN"
}
}.
2017-08-01 17:18:26 - nailgun.client - DEBUG - Received HTTP 201 response: {"description":null,"url":"http://10.8.29.107:2375","created_at":"2017-08-01 21:18:26 UTC","updated_at":"2017-08-01 21:18:26 UTC","id":52,"name":"ApReidcCPN","provider":"Docker","provider_friendly_name":"Docker","user":null,"images":[],"compute_attributes":[],"locations":[],"organizations":[{"id":55,"name":"zcBPUXbQHi","title":"zcBPUXbQHi","description":null}]}

2017-08-01 17:18:28 - nailgun.client - DEBUG - Making HTTP POST request to https://sat6.com/docker/api/v2/containers with options {'verify': False, 'auth': ('admin', 'changeme'), 'headers': {'content-type': 'application/json'}}, no params and data

{
"container": {
"repository_name": "busybox",
"compute_resource_id": 52,
"tag": "latest",
"command": "date",
"organization_ids": [55],
"name": "hjRR6uiV1"
}
}.
2017-08-01 17:18:36 - nailgun.client - DEBUG - Received HTTP 201 response
2017-08-01 17:18:36 - nailgun.client - DEBUG - Making HTTP GET request to https://sat6.com/docker/api/v2/containers/9/logs with options {'verify': False, 'auth': ('admin', 'changeme'), 'headers': {'content-type': 'application/json'}}, no params and no data.
2017-08-01 17:18:36 - nailgun.client - WARNING - Received HTTP 500 response: {
"error": {"message":"No such file or directory - connect(2) for /var/run/docker.sock (Errno::ENOENT)"}
}

Expected results:
connection is being made to the appropriate interface and the logs are being fetched

Also available in: Atom PDF