Skip to content

Getting ValueError: scheme unix is invalid #7

Closed

Description

@aronasorman

Getting this error when running docker v0.7.2. Here's the corresponding traceback:

Traceback (most recent call last):
  File "/usr/local/bin/fig", line 9, in <module>
    load_entry_point('fig==0.0.2', 'console_scripts', 'fig')()
  File "/usr/local/lib/python2.7/dist-packages/fig/cli/main.py", line 37, in main
    command.sys_dispatch()
  File "/usr/local/lib/python2.7/dist-packages/fig/cli/docopt_command.py", line 19, in sys_dispatch
    self.dispatch(sys.argv[1:], None)
  File "/usr/local/lib/python2.7/dist-packages/fig/cli/docopt_command.py", line 22, in dispatch
    self.perform_command(*self.parse(argv, global_options))
  File "/usr/local/lib/python2.7/dist-packages/fig/cli/docopt_command.py", line 25, in perform_command
    handler(command_options)
  File "/usr/local/lib/python2.7/dist-packages/fig/cli/main.py", line 226, in up
    log_printer = LogPrinter(containers)
  File "/usr/local/lib/python2.7/dist-packages/fig/cli/log_printer.py", line 13, in __init__
    self.generators = self._make_log_generators()
  File "/usr/local/lib/python2.7/dist-packages/fig/cli/log_printer.py", line 26, in _make_log_generators
    generators.append(self._make_log_generator(container, color_fn))
  File "/usr/local/lib/python2.7/dist-packages/fig/cli/log_printer.py", line 32, in _make_log_generator
    websocket = self._attach(container)
  File "/usr/local/lib/python2.7/dist-packages/fig/cli/log_printer.py", line 45, in _attach
    return container.attach_socket(params=params, ws=True)
  File "/usr/local/lib/python2.7/dist-packages/fig/container.py", line 131, in attach_socket
    return self.client.attach_socket(self.id, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 251, in attach_socket
    return self._attach_websocket(container, params)
  File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 217, in _attach_websocket
    return self._create_websocket_connection(full_url)
  File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 220, in _create_websocket_connection
    return websocket.create_connection(url)
  File "/usr/local/lib/python2.7/dist-packages/websocket.py", line 178, in create_connection
    websock.connect(url, **options)
  File "/usr/local/lib/python2.7/dist-packages/websocket.py", line 419, in connect
    hostname, port, resource, is_secure = _parse_url(url)
  File "/usr/local/lib/python2.7/dist-packages/websocket.py", line 141, in _parse_url
    raise ValueError("scheme %s is invalid" % scheme)
ValueError: scheme unix is invalid

Activity

  1. aronasorman commented on Jan 8, 2014

    @aronasorman
    Author

    Seems like it's for an old version of docker and expecting a tcp socket, while newer ones mount on /var/run/docker.sock.

  2. tekknolagi commented on Jan 9, 2014

    @tekknolagi

    @aronasorman Shouldn't be the case. I get this on 0.7.4. Unless you mean that fig expects older versions?

  3. frankscholten commented on Jan 11, 2014

    @frankscholten

    I am having the same issue with Docker 0.7.5

  4. dazzag24 commented on Jan 13, 2014

    @dazzag24

    I am seeing the same issue with docker 0.7.5:
    Client version: 0.7.5
    Go version (client): go1.2
    Git commit (client): c348c04
    Server version: 0.7.5
    Git commit (server): c348c04
    Go version (server): go1.2
    Last stable version: 0.7.5

  5. aanand commented on Jan 13, 2014

    @aanand

    Right, I'm pretty sure this is because we're using a websocket to attach, and the websockets library doesn't support unix:// URLs. Not entirely surprising.

    We needn't really be using websockets at all, except that I'm seeing some odd extra bytes in the output when using a raw socket.

    While I'm investigating, a temporary fix is to run the Docker daemon on a TCP socket instead of the standard Unix one:

    docker -H 127.0.0.1:4243 -d
    

    Fig will automatically connect to 127.0.0.1:4243 if it's open, so that should be all you need.

  6. tekknolagi commented on Jan 13, 2014

    @tekknolagi

    I changed the DOCKER_OPS in /etc/init.d/docker, but nothing appears to have
    changed.

    On Mon, Jan 13, 2014 at 8:52 AM, Aanand Prasad [email protected]:

    Right, I'm pretty sure this is because we're using a websocket to attach,
    and the websockets library doesn't support unix:// URLs. Not entirely
    surprising.

    We needn't really be using websockets at all, except that I'm seeing some
    odd extra bytes in the output when using a raw socket.

    While I'm investigating, a temporary fix is to run the Docker daemon on a
    TCP socket instead of the standard Unix one:

    docker -H 127.0.0.1:4243 -d

    Fig will automatically connect to 127.0.0.1:4243 if it's open, so that
    should be all you need.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-32187479
    .

  7. bfirsh commented on Jan 13, 2014

    @bfirsh

    If you're using the standard Docker Ubuntu package, try putting this in /etc/default/docker:

    export DOCKER_OPTS="-H unix:///var/run/docker.sock -H tcp://0.0.0.0:4243"
    
  8. tekknolagi commented on Jan 13, 2014

    @tekknolagi

    I still get the error.

    On Mon, Jan 13, 2014 at 9:23 AM, Ben Firshman [email protected]:

    If you're using the standard Docker package, try putting this in
    /etc/default/docker:

    export DOCKER_OPTS="-H unix:///var/run/docker.sock -H tcp://0.0.0.0:$DOCKER_PORT"

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-32190480
    .

  9. added a commit that references this issue on Jan 14, 2014
    60810bf
  10. aanand commented on Jan 14, 2014

    @aanand

    Fixed in a branch, but we're waiting on a fix to docker-py to be accepted/released; if you're feeling brave, you can follow the instructions in #10 to install patched versions of both docker-py and fig.

    @tekknolagi: sorry to hear it's still not working. Could you try removing the Unix socket from the config, i.e. just putting export DOCKER_OPTS="-H tcp://0.0.0.0:4243" in /etc/default/docker?

  11. tekknolagi commented on Jan 14, 2014

    @tekknolagi

    Well, now I get this.
    screen shot 2014-01-14 at 8 14 45 am

  12. aanand commented on Jan 14, 2014

    @aanand

    Oh dear. Right, last thing to try: run export DOCKER_URL=http://127.0.0.1:4243 in your shell before running fig.

  13. bfirsh commented on Jan 14, 2014

    @bfirsh

    Can you curl localhost:4243/version?

  14. bfirsh commented on Jan 14, 2014

    @bfirsh

    Actually let's try and debug this step by step. After setting /etc/default/docker to:

    export DOCKER_OPTS="-H unix:///var/run/docker.sock -H tcp://0.0.0.0:4243"

    Run restart docker. Check ps ax | grep docker to see if Docker is running. If it isn't, it'll say why in /var/log/upstart/docker.log. If it is, try curl localhost:4243/version to see if it's listening on HTTP.

  15. frankscholten commented on Jan 14, 2014

    @frankscholten

    I got it working after I added DOCKER_OPTS="-H 127.0.0.1:4243" in /etc/default/docker

    Fig is a great tool btw! I was looking for a Vagrant-like workflow for Docker and this fits the bill :-)

  16. 1 remaining item

  17. tekknolagi commented on Jan 14, 2014

    @tekknolagi

    I just have to export that before running the fig client.

    On Tue, Jan 14, 2014 at 12:24 PM, Maxwell Bernstein
    [email protected]:

    Running that command fixed it, yes.

    On Tue, Jan 14, 2014 at 11:05 AM, Frank Scholten <[email protected]

    wrote:

    I got it working after I changed added DOCKER_OPTS="-H 127.0.0.1:4243"
    in /etc/default/docker

    This is a great tool btw! I was looking for a Vagrant-like workflow for
    Docker and this fits the bill :-)

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-32295807
    .

  18. tekknolagi commented on Jan 14, 2014

    @tekknolagi

    How come I can't use the docker util if I don't change the environment variable again? Is there no way for dockerd to listen on both the socket and IP?

  19. added 2 commits that reference this issue on Jan 16, 2014
    4c22d93
    9eb00ed
  20. dz0ny commented on Jan 16, 2014

    @dz0ny

    I see. What about check?

  21. added 2 commits that reference this issue on Jan 16, 2014
    8303e5c
    feafea2
  22. tekknolagi commented on Jan 16, 2014

    @tekknolagi

    Check?

    On Thu, Jan 16, 2014 at 5:43 AM, Janez Troha [email protected]:

    I see. What about check?

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-32469258
    .

  23. aanand commented on Jan 16, 2014

    @aanand

    We've released a new version that fixes this. Thanks for your help and patience, folks!

    $ sudo pip install --upgrade fig
    

    You should now be able to run docker -d without specifying a host, as Fig works just fine against the Unix socket.

    Note: if you are running it on a TCP port, Fig now looks for the DOCKER_HOST environment variable (not DOCKER_URL) to maintain consistency with the official Docker client, so be sure to use that.

  24. tekknolagi commented on Jan 16, 2014

    @tekknolagi

    Wonderful! Thanks.

    On Thu, Jan 16, 2014 at 10:39 AM, Aanand Prasad [email protected]:

    We've released a new version that fixes this. Thanks for your help and
    patience, folks!

    $ sudo pip install --upgrade fig

    You should now be able to run docker -d without specifying a host, as Fig
    works just fine against the Unix socket.

    Note: if you are running it on a TCP port, Fig now looks for the
    DOCKER_HOST environment variable (not DOCKER_URL) to maintain consistency
    with the official Docker client, so be sure to use that.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-32503556
    .

  25. added a commit that references this issue on Feb 6, 2015
  26. added a commit that references this issue on Apr 10, 2015
    7f618a8
  27. added a commit that references this issue on Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions