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

The :host parameter should not be set for unix:// connections. #583

Open
fcecagno opened this issue May 4, 2023 · 1 comment
Open

The :host parameter should not be set for unix:// connections. #583

fcecagno opened this issue May 4, 2023 · 1 comment

Comments

@fcecagno
Copy link

fcecagno commented May 4, 2023

Hi, having a weird issue using a very simple code with docker gem:

$ DOCKER_URL=unix:///var/run/docker.sock irb
irb(main):001:0> require 'docker'
=> true
irb(main):002:0> Docker::Container.all(:all => true)
Traceback (most recent call last):
       11: from /usr/bin/irb:23:in `<main>'
       10: from /usr/bin/irb:23:in `load'
        9: from /usr/lib/ruby/gems/2.7.0/gems/irb-1.2.1/exe/irb:11:in `<top (required)>'
        8: from (irb):2
        7: from /var/lib/gems/2.7.0/gems/docker-api-2.2.0/lib/docker/container.rb:343:in `all'
        6: from /var/lib/gems/2.7.0/gems/docker-api-2.2.0/lib/docker/connection.rb:109:in `block (2 levels) in <class:Connection>'
        5: from /var/lib/gems/2.7.0/gems/docker-api-2.2.0/lib/docker/connection.rb:45:in `request'
        4: from /var/lib/gems/2.7.0/gems/docker-api-2.2.0/lib/docker/connection.rb:35:in `resource'
        3: from /var/lib/gems/2.7.0/gems/excon-0.92.4/lib/excon.rb:142:in `new'
        2: from /var/lib/gems/2.7.0/gems/excon-0.92.4/lib/excon.rb:142:in `new'
        1: from /var/lib/gems/2.7.0/gems/excon-0.92.4/lib/excon/connection.rb:93:in `initialize'
ArgumentError (The `:host` parameter should not be set for `unix://` connections.)
When supplying a `unix://` URI, it should start with `unix:/` or `unix:///`.

I'm most certainly it's not an issue in the library itself because it used to work for a long time.
Do you have any idea why I'd hit this?

@fcecagno
Copy link
Author

fcecagno commented May 4, 2023

Related to excon/excon#805
Update dependency excon gem from 0.92.4 to 0.99.0 seems to fix the issue, although it doesn't explain why this issue appeared from nowhere without any changes in the deployment.
I hope it helps others to track down the same issue.

chvp added a commit to dodona-edu/dodona that referenced this issue Jul 4, 2023
Because of upserve/docker-api#583, running a docker
container could fail depending on the URI gem bundled with the user's ruby. This
is fixed in later excon versions
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