Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

docker_container pull 'Get http://: http: no Host in request URL' #5775

Closed
davegallant opened this issue Nov 30, 2016 · 20 comments
Closed

docker_container pull 'Get http://: http: no Host in request URL' #5775

davegallant opened this issue Nov 30, 2016 · 20 comments

Comments

@davegallant
Copy link

davegallant commented Nov 30, 2016

ISSUE TYPE

  • Bug Report

COMPONENT NAME

  • docker_container

ANSIBLE VERSION

  • 2.2.0.0

OS
Ubuntu 14.04.5 LTS

Summary:
This docker_container module was working up until now and have not changed any code. When I try to pull the image manually in a ssh session, it works.

- name: Kazoo Install
  docker_container:
    name: soa-kazoo
    docker_api_version: "{{ docker_api_version }}"
    image: blah-testing.artifactory.internal/soa-kazoo
    env:
      ZOOKEEPER_PORT: "{{ zookeeper_host }}"
    log_driver: syslog
    command: /bin/bash -c 'export HOME={{ working_dir }}; ./run_api.sh'
    state: started

Error:
fatal: [api]: FAILED! => {"changed": false, "failed": true, "msg": "Error pulling blah-testing.artifactory.internal/soa-kazoo - code: None message: Get http://: http: no Host in request URL"}

@ansibot
Copy link

ansibot commented Nov 30, 2016

@Davey-Dev, we need more information to resolve this issue. For that reason, we put this Issue into the 'needs_info' state.

Here are the required items we could not find in your description:

  • issue type

When you have filled in the missing data, we will notify the module maintainer for further action.
click here for bot help

@clane-axial
Copy link

I'm seeing same problem on Ubuntu 16.04.1.

@kurron
Copy link

kurron commented Nov 30, 2016

I am also experiencing the issue. Like, @Davey-Dev , the same script worked yesterday but fails today. I did have to switch to a different VM so the environment is not identical but very close. Here is the dump I get trying to pull down the RabbitMQ image from Docker Hub with -vvv enabled:

Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/core/cloud/docker/docker_image.py
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1480534399.17-47607955013186 `" && echo ansible-tmp-1480534399.17-47607955013186="` echo $HOME/.ansible/tmp/ansible-tmp-1480534399.17-47607955013186 `" ) && sleep 0'
<localhost> PUT /tmp/tmp5rYCT3 TO /home/vagrant/.ansible/tmp/ansible-tmp-1480534399.17-47607955013186/docker_image.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/vagrant/.ansible/tmp/ansible-tmp-1480534399.17-47607955013186/ /home/vagrant/.ansible/tmp/ansible-tmp-1480534399.17-47607955013186/docker_image.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1480534399.17-47607955013186/docker_image.py; rm -rf "/home/vagrant/.ansible/tmp/ansible-tmp-1480534399.17-47607955013186/" > /dev/null 2>&1 && sleep 0'
failed: [localhost] (item={u'image': u'rabbitmq', u'tag': u'3.6.5-management'}) => {
    "failed": true, 
    "invocation": {
        "module_args": {
            "api_version": null, 
            "archive_path": null, 
            "buildargs": null, 
            "cacert_path": null, 
            "cert_path": null, 
            "container_limits": null, 
            "debug": false, 
            "docker_host": null, 
            "dockerfile": null, 
            "filter_logger": false, 
            "force": false, 
            "http_timeout": 240, 
            "key_path": null, 
            "load_path": null, 
            "name": "rabbitmq", 
            "nocache": "False", 
            "path": null, 
            "pull": true, 
            "push": false, 
            "repository": null, 
            "rm": true, 
            "ssl_version": null, 
            "state": "present", 
            "tag": "3.6.5-management", 
            "timeout": null, 
            "tls": null, 
            "tls_hostname": null, 
            "tls_verify": null, 
            "use_tls": "no"
        }, 
        "module_name": "docker_image"
    }, 
    "item": {
        "image": "rabbitmq", 
        "tag": "3.6.5-management"
    }, 
    "msg": "Error pulling rabbitmq - code: None message: Get http://: http: no Host in request URL"
}

I know the module relies on py-docker and this is what pip tells me:

Name: docker-py
Version: 1.10.6
Summary: Python client for Docker.
Home-page: https://github.com/docker/docker-py/
Author: Joffrey F
Author-email: [email protected]
License: UNKNOWN
Location: /usr/local/lib/python2.7/dist-packages
Requires: backports.ssl-match-hostname, six, websocket-client, ipaddress, docker-pycreds, requests

ansible-playbook reports this:

ansible-playbook 2.2.0.0
  config file = /home/vagrant/Bitbucket/Operations/tlo-sa/installers/rpm/ansible.cfg
  configured module search path = Default w/o overrides

Hopefully, this can assist in tracking down the cause.

@solomongifford
Copy link

Interestingly, this is happening to us as well. I used the ansible playbooks last night (CentOS 6) with success but today it is failing. No yum updates show in the logs on the ansible machine. I'll update with anything I find.

@npetryk
Copy link

npetryk commented Nov 30, 2016

+1

Seeing this issue on new ubuntu 14.04.3 aws instances.

Ansible playbook == 2.2.0.0
Docker-py == 1.10.6
docker-engine == 1.12.3-0~trusty

Also hitting a private docker repository

@solomongifford
Copy link

@matrix10657 ours is a private docker repo as well.

@npetryk
Copy link

npetryk commented Nov 30, 2016

We're specifically using a quay.io repo. I suspect the problem is maybe with the repository considering that we're pinning all of the versions I mentioned, and we do a fresh install of all of them every time we build.

If we're all using quay then that's pretty suspicious.

@solomongifford
Copy link

@matrix10657 not using quay - and our private docker repo is is self hosted and did not have any package updates between the last successful run and the new failed runs.

@gbevan
Copy link

gbevan commented Nov 30, 2016

+1 same here.
Ubuntu 14.04.5 LTS
Kernel: 4.4.0-51
ansible: 2.2.0.0
docker-py: 1.9.0
Docker version 1.12.3, build 6b644ec

like others above, our builds have been working fine - tonight failing with this strange error. This was after ansible reported a successful image build then failed with this error attempting to start the image. docker images command does not show the supposedly newly built image name, instead shows:

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
<none>              <none>              c2b5feecc16d        28 minutes ago      1.978 GB

@davegallant
Copy link
Author

davegallant commented Nov 30, 2016

I think the issue is related to docker-compose. Switching down to 1.8.1 (on the target machine) fixed it:

- name: Install docker-compose
  pip: name=docker-compose version=1.8.1

@kurron
Copy link

kurron commented Nov 30, 2016

I have docker-compose version 1.8.1, build 878cff1 installed on the failing box. Wait, @Davey-Dev , docker-compose is a Go program not a Python one so I don't see how how your fix works. What am I missing?

@rfrench-go
Copy link

I can confirm @Davey-Dev solution worked for me. Ansible playbooks were running just fine yesterday, but failed to start/restart containers today. I did NOT have docker-compose installed. I manually installed docker-compose on the target host:

pip install docker-compose==1.8.1

Immediately reran the playbook and my containers came up just fine.

AWS
Ubuntu 14.04
Ansbile 2.2.0
Docker-py 1.10.6

@davegallant
Copy link
Author

davegallant commented Nov 30, 2016

@kurron I don't know much about Go, other than that Docker is written in Go and the 'http: no Host in request URL' error seems to be a specific to Go.

@MattAlex151
Copy link

MattAlex151 commented Nov 30, 2016

I have the same issue with some writeup posted to SO.

EDIT: I did not previously have a task to install docker-compose, but I added one and installed 1.8.1 and can confirm this fixes the issue.

@kurron
Copy link

kurron commented Nov 30, 2016

Obviously, I don't fully understand what is going on but running sudo pip install docker-compose==1.8.1 also fixed the issue for me. What I should have done was to interrogate pip before I upgraded to see what version of the Python module was installed. Could somebody run pip show docker-compose before upgrading so we can see what the differences in versions are?

@solomongifford
Copy link

@Davey-Dev docker-compose likely downgraded the requests module which is the actual culprit. The requests module came out with an update today (https://pypi.python.org/pypi/requests/2.12.2)

For anyone else, FYI, if your playbook is installing docker-py to the latest, then it is getting the latest version of requests. However, we actually need a lower version of requests.

I'm testing requests versions...

@solomongifford
Copy link

@kurron When I installed docker-compose, the requests module was the only one to update.

@ansibot
Copy link

ansibot commented Nov 30, 2016

@ansible, ping. This issue is waiting on your response.
click here for bot help

@kurron
Copy link

kurron commented Nov 30, 2016

After successfully pulling down images again, I ran sudo pip install --upgrade docker-compose, which installed 1.9.0 onto the box and images seem to be coming down still.

Installing collected packages: requests, docker-compose
  Found existing installation: requests 2.7.0
    Uninstalling requests-2.7.0:
      Successfully uninstalled requests-2.7.0
  Found existing installation: docker-compose 1.8.1
    Uninstalling docker-compose-1.8.1:
      Successfully uninstalled docker-compose-1.8.1
  Running setup.py install for docker-compose ... done
Successfully installed docker-compose-1.9.0 requests-2.11.1

@solomongifford
Copy link

This issue should be closed in favor of the docker-py issue: docker/docker-py#1321

sbesson added a commit to sbesson/infrastructure that referenced this issue Nov 30, 2016
atarkowska pushed a commit to ome/ansible-role-devspace that referenced this issue Jan 31, 2017
atarkowska pushed a commit to atarkowska/ansible-role-ci-devspace that referenced this issue Apr 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants