Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incompatible with DOCKER_HOST using ssh protocol #90

Open
ssbarnea opened this issue Apr 13, 2019 · 0 comments
Open

incompatible with DOCKER_HOST using ssh protocol #90

ssbarnea opened this issue Apr 13, 2019 · 0 comments

Comments

@ssbarnea
Copy link

Last year docker enabled use of ssh transport protocol for talking with docker, effectively enabling safe remoting. The python docker library works perfectly with that and its users do not need to be updated but somehow seaworthy seems to choke when dockerhost is using ssh.

You should be able to reasily reproduce the issue by defining DOCKER_HOST=ssh://root@localhost or something similar.

test/test_install.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../.pyenv/versions/3.6.7/lib/python3.6/site-packages/seaworthy/definitions.py:265: in setup
    self.run(**run_kwargs)
../../.pyenv/versions/3.6.7/lib/python3.6/site-packages/seaworthy/definitions.py:318: in run
    self.create(fetch_image=fetch_image, **kwargs)
../../.pyenv/versions/3.6.7/lib/python3.6/site-packages/seaworthy/definitions.py:67: in create
    self.name, *self._create_args, **kwargs)
../../.pyenv/versions/3.6.7/lib/python3.6/site-packages/seaworthy/helpers.py:194: in create
    network = self._network_for_container(network, kwargs)
../../.pyenv/versions/3.6.7/lib/python3.6/site-packages/seaworthy/helpers.py:227: in _network_for_container
    return self._network_helper.get_default()
../../.pyenv/versions/3.6.7/lib/python3.6/site-packages/seaworthy/helpers.py:336: in get_default
    self._default_network = self.create('default', driver='bridge')
../../.pyenv/versions/3.6.7/lib/python3.6/site-packages/seaworthy/helpers.py:356: in create
    return super().create(name, check_duplicate=check_duplicate, **kwargs)
../../.pyenv/versions/3.6.7/lib/python3.6/site-packages/seaworthy/helpers.py:109: in create
    resource = self.collection.create(*args, name=resource_name, **kwargs)
../../.pyenv/versions/3.6.7/lib/python3.6/site-packages/docker/models/networks.py:154: in create
    resp = self.client.api.create_network(name, *args, **kwargs)
../../.pyenv/versions/3.6.7/lib/python3.6/site-packages/docker/api/network.py:152: in create_network
    return self._result(res, json=True)
../../.pyenv/versions/3.6.7/lib/python3.6/site-packages/docker/api/client.py:262: in _result
    self._raise_for_status(response)
../../.pyenv/versions/3.6.7/lib/python3.6/site-packages/docker/api/client.py:258: in _raise_for_status
    raise create_api_error_from_http_exception(e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

e = HTTPError('409 Client Error: Conflict for url: http+docker://ssh/v1.35/networks/create',)

    def create_api_error_from_http_exception(e):
        """
        Create a suitable APIError from requests.exceptions.HTTPError.
        """
        response = e.response
        try:
            explanation = response.json()['message']
        except ValueError:
            explanation = (response.content or '').strip()
        cls = APIError
        if response.status_code == 404:
            if explanation and ('No such image' in str(explanation) or
                                'not found: does not exist or no pull access'
                                in str(explanation) or
                                'repository does not exist' in str(explanation)):
                cls = ImageNotFound
            else:
                cls = NotFound
>       raise cls(e, response=response, explanation=explanation)
E       docker.errors.APIError: 409 Client Error: Conflict ("network with name test_default already exists")

../../.pyenv/versions/3.6.7/lib/python3.6/site-packages/docker/errors.py:31: APIError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant