Bug 1393405 - connection to unix docker compute resource fails with 400 Bad Request: malformed Host header
Summary: connection to unix docker compute resource fails with 400 Bad Request: malfor...
Keywords:
Status: CLOSED DUPLICATE of bug 1366573
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Container Management
Version: 6.2.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-09 13:13 UTC by Lukas Pramuk
Modified: 2016-11-11 13:26 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-11 13:26:40 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Lukas Pramuk 2016-11-09 13:13:34 UTC
Description of problem:
Cannot use unix socket docker resource. Upon Test connection or getting list of containers  I get "400 Bad Request: malformed Host header"

Version-Release number of selected component (if applicable):
satellite-6.2.4-1.0.el7sat.noarch
docker-1.10.3-46.el7.14.x86_64
tfm-rubygem-foreman_docker-2.0.1.11-1.el7sat.noarch

How reproducible:
100%

Steps to Reproduce:
1. create docker compute resource with URL unix:///var/run/docker.sock
2. test connection to this resource

Actual results:
unable to use unix socket docker CR as connection fails with
(x) Unable to save
400 Bad Request: malformed Host header

Expected results:
connection is successful

Additional info:
2016-11-09 08:00:24 [app] [I] Started PUT "/compute_resources/test_connection" for <CLIENT_IP> at 2016-11-09 08:00:24 -0500
2016-11-09 08:00:24 [app] [I] Processing by ComputeResourcesController#test_connection as */*
2016-11-09 08:00:24 [app] [I]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"vx45s0fkmLzi8vx8LM8F65RFkW4xYjO97ZnTZxVgzlg=", "compute_resource"=>{"name"=>"wXXvVQxtbN", "description"=>"", "url"=>"unix:///var/run/docker.sock", "user"=>"", "password"=>"[FILTERED]", "email"=>"", "location_ids"=>[""], "organization_ids"=>["", "6"]}, "fakepassword"=>"[FILTERED]", "cr_id"=>"1"}
2016-11-09 08:00:24 [app] [I] CR_ID IS 1
2016-11-09 08:00:24 [app] [I]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_docker-2.0.1.11/app/views/compute_resources/form/_docker.html.erb (13.3ms)
2016-11-09 08:00:24 [app] [I]   Rendered taxonomies/_loc_org_tabs.html.erb (55.5ms)
2016-11-09 08:00:24 [app] [I]   Rendered compute_resources/_form.html.erb (82.0ms)
2016-11-09 08:00:24 [app] [I] Completed 200 OK in 164ms (Views: 77.4ms | ActiveRecord: 19.8ms)

Comment 1 Lukas Pramuk 2016-11-09 13:22:03 UTC
Docker is configured to listen both on unix socket and tcp

/etc/sysconfig/docker:
OPTIONS='--selinux-enabled=true --host tcp://0.0.0.0:2375 --host unix:///var/run/docker.sock -G docker'

Connection to unix:///var/run/docker.sock fails while connection to tcp://localhost:2375 succeeds.

SElinux doesn't play a role here as it is set to Permissive.

Comment 3 Lukas Pramuk 2016-11-11 13:26:40 UTC

*** This bug has been marked as a duplicate of bug 1366573 ***


Note You need to log in before you can comment on or make changes to this bug.