You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Specifying socketPath but Dockerode is using HTTP. (bun.js) #747
Could not get container information. ConnectionRefused: Unable to connect. Is the computer able to access the url?
path: "http://localhost/containers/b81d1747b4d9/json"
/tmp/dockerode · sudo bun run index.ts
Error: ConnectionRefused: Unable to connect. Is the computer able to access the url?
path: "http://localhost/containers/json?all=true"
changed the title [-]Specifying socketPath but Dockerode is using HTTP.[/-][+]Specifying socketPath but Dockerode is using HTTP. (bun.js)[/+]on Oct 30, 2023
I think it's related due to the fact that it's the same issue as what bun had, and other deno users will be able to find this and not waste time debugging why it's happening
Same issue with Deno 1.43.6, dockerode 4.0.2, with:
import Docker from 'npm:dockerode'
const docker = new Docker({socketPath: '/var/run/docker.sock'})
const images = await docker.listImages()
console.log( images )
Got:
error: Uncaught (in promise) TypeError: error sending request for url (http://localhost/images/json): error trying to connect: tcp connect error: Connection refused (os error 111)
at async node:http:397:21
Running this code on Deno 2.2.1 and dockerode 4.0.4 results for me in:
error: Uncaught (in promise) BadResource: Bad resource ID
at node:http:327:27
at ClientRequest._writeHeader (node:http:440:7)
at ClientRequest._flushHeaders (node:_http_outgoing:382:12)
at Socket.onConnect (node:http:486:16)
at Socket.emit (ext:deno_node/_events.mjs:405:35)
at PipeConnectWrap._afterConnect [as oncomplete] (node:net:159:12)
at Pipe.afterConnect (ext:deno_node/internal_binding/connection_wrap.ts:43:11)
at ext:deno_node/internal_binding/pipe_wrap.ts:123:14
at eventLoopTick (ext:core/01_core.js:177:7)
Make sure to stop both the container and the proxy properly. Don’t just call arangoDbContainer.stop() — use the stop handler to first stop the container and then the proxy, ensuring all listeners are closed.
I'm on macOS. I don't know if this will work on windows systems.
This is still happening for me with the newest version of bun (1.3.11) and dockerode (4.0.10) on linux.
Since the bun PR was merged, I don't really understand how this can still be an issue?
error: Was there a typo in the url or port?
path: "http://localhost/containers/json",
errno: 0,
code: "FailedToOpenSocket"
Activity
ptrxyz commentedon Oct 23, 2023
An into the same problem ... not sure how that would happen. Maybe a permission thing?
ptrxyz commentedon Oct 23, 2023
Maybe it matters: my Docker daemon version is 1.24, this is my test code:
The error:
Debug info:
apocas commentedon Oct 23, 2023
Investigating
apocas commentedon Oct 23, 2023
I can't reproduce that :(
Tried exactly the same scenario bun and nodejs.
hazelnutcloud commentedon Oct 24, 2023
running into same problem. using bun v1.0.7 on mac
hazelnutcloud commentedon Oct 24, 2023
This seems to be a problem with bun. See oven-sh/bun#6055
apocas commentedon Oct 24, 2023
Now I can reproduce it using bun (forgot mocha was evoking node) :)
Indeed is seems something related with bun, not much we can do right now.
[-]Specifying socketPath but Dockerode is using HTTP.[/-][+]Specifying socketPath but Dockerode is using HTTP. (bun.js)[/+]recanman commentedon Feb 24, 2024
Temporary solution I'm using:
Run this command:
Use it like this:
Anprotaku commentedon Mar 6, 2024
Hello, is there any fix for this issue to get linux socket to work?
recanman commentedon Mar 7, 2024
There is a pull request, but no response yet.
Anprotaku commentedon Mar 7, 2024
@recanman it looks like they merged another pull request that should fix it
oven-sh/bun#9284
Should be safe to close this issue
recanman commentedon Mar 8, 2024
Great, thank you!
Mentioning author: @Fumaz
dionjwa commentedon May 21, 2024
I am using
dockerode@4.0.2via deno, and I am still getting this issue.devingfx commentedon Oct 10, 2024
Same issue with Deno 1.43.6, dockerode 4.0.2, with:
Got:
error: Uncaught (in promise) TypeError: error sending request for url (http://localhost/images/json): error trying to connect: tcp connect error: Connection refused (os error 111) at async node:http:397:21Karrq commentedon Oct 11, 2024
I'm also getting the same issue with Deno 2.
I think it's related due to the fact that it's the same issue as what bun had, and other deno users will be able to find this and not waste time debugging why it's happening
crackedbeefcake commentedon Oct 29, 2024
same issue with deno 2. is there an issue yet? couldnt find it if there is
adamazad commentedon Dec 18, 2024
Same issue with Deno v2.1.4.
DanielSharkov commentedon Feb 23, 2025
Running this code on Deno 2.2.1 and dockerode 4.0.4 results for me in:
But fortunately, I found a great workaround for Deno here: denoland/deno#20255 (comment)
Still, I had to tweak it slightly. The original
Promise.allimplementation didn't make sense and didn't work for me. Here's my improved version:Then I'm just using it like:
Make sure to stop both the container and the proxy properly. Don’t just call
arangoDbContainer.stop()— use the stop handler to first stop the container and then the proxy, ensuring all listeners are closed.I'm on macOS. I don't know if this will work on windows systems.
marcus-sa commentedon Mar 28, 2025
I don't have any issues with Bun version 1.2.5
recanman commentedon Mar 28, 2025
@marcus-sa
I suggest you read the thread before responding.
kravetsone commentedon May 26, 2025
it is broken for me 1.2.13
kravetsone commentedon May 26, 2025
oven-sh/bun#18653
looks like now it windows specific
PssbleTrngle commentedon Mar 23, 2026
This is still happening for me with the newest version of bun (1.3.11) and dockerode (4.0.10) on linux.
Since the bun PR was merged, I don't really understand how this can still be an issue?