I think the problem is that there may be a time gap where docker inspect will return that a container is running, but the port is still not resolved. So, the solution may be to use a waitUntil to fetch the host port.
Wing Version
No response
Node.js Version
No response
Platform(s)
No response
Community Notes
Please vote by adding a 👍 reaction to the issue to help us prioritize.
If you are interested to work on this issue, please leave a comment.
I tried this:
It doesn't always happen, just from time to time. Run
wing it main.w
:This happened:
I get a blue screen of death with
Container does not listen to port 3000
, even though is what docker inspect returns:Full response:
```json { "Id": "b5c8aff24d8adfedede2340d038ede3a06d6b0145b3fa9ce6eaa53a6ce7c09d4", "Created": "2024-04-29T07:49:26.8773895Z", "Path": "/tigerbeetle", "Args": [ "start", "--cache-grid=256MiB", "--addresses=0.0.0.0:3000", "/data/d815626e.tigerbeetle" ], "State": { "Status": "running", "Running": true, "Paused": false, "Restarting": false, "OOMKilled": false, "Dead": false, "Pid": 637, "ExitCode": 0, "Error": "", "StartedAt": "2024-04-29T07:49:27.04407325Z", "FinishedAt": "0001-01-01T00:00:00Z" }, "Image": "sha256:d002799a6573fae4c2d65b3d03f546d370f0634d60b7c9c9b3be52467c26d87d", "ResolvConfPath": "/var/lib/docker/containers/b5c8aff24d8adfedede2340d038ede3a06d6b0145b3fa9ce6eaa53a6ce7c09d4/resolv.conf", "HostnamePath": "/var/lib/docker/containers/b5c8aff24d8adfedede2340d038ede3a06d6b0145b3fa9ce6eaa53a6ce7c09d4/hostname", "HostsPath": "/var/lib/docker/containers/b5c8aff24d8adfedede2340d038ede3a06d6b0145b3fa9ce6eaa53a6ce7c09d4/hosts", "LogPath": "/var/lib/docker/containers/b5c8aff24d8adfedede2340d038ede3a06d6b0145b3fa9ce6eaa53a6ce7c09d4/b5c8aff24d8adfedede2340d038ede3a06d6b0145b3fa9ce6eaa53a6ce7c09d4-json.log", "Name": "/wing-container-01HWMD8Z2YDXMVYVTQ8R52Q6FC", "RestartCount": 0, "Driver": "overlay2", "Platform": "linux", "MountLabel": "", "ProcessLabel": "", "AppArmorProfile": "", "ExecIDs": [ "d4845b81efea329bf4d0dcfc8556a9884e7b6a0ec9c54978ef9a204fc3af3db1" ], "HostConfig": { "Binds": [ "/Users/cristian/Code/tigerbeetle-wing/data:/data" ], "ContainerIDFile": "", "LogConfig": { "Type": "json-file", "Config": {} }, "NetworkMode": "default", "PortBindings": { "3000/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "0" } ] }, "RestartPolicy": { "Name": "no", "MaximumRetryCount": 0 }, "AutoRemove": true, "VolumeDriver": "", "VolumesFrom": null, "ConsoleSize": [ 0, 0 ], "CapAdd": null, "CapDrop": null, "CgroupnsMode": "private", "Dns": [], "DnsOptions": [], "DnsSearch": [], "ExtraHosts": null, "GroupAdd": null, "IpcMode": "private", "Cgroup": "", "Links": null, "OomScoreAdj": 0, "PidMode": "", "Privileged": false, "PublishAllPorts": false, "ReadonlyRootfs": false, "SecurityOpt": null, "UTSMode": "", "UsernsMode": "", "ShmSize": 67108864, "Runtime": "runc", "Isolation": "", "CpuShares": 0, "Memory": 0, "NanoCpus": 0, "CgroupParent": "", "BlkioWeight": 0, "BlkioWeightDevice": [], "BlkioDeviceReadBps": [], "BlkioDeviceWriteBps": [], "BlkioDeviceReadIOps": [], "BlkioDeviceWriteIOps": [], "CpuPeriod": 0, "CpuQuota": 0, "CpuRealtimePeriod": 0, "CpuRealtimeRuntime": 0, "CpusetCpus": "", "CpusetMems": "", "Devices": [], "DeviceCgroupRules": null, "DeviceRequests": null, "MemoryReservation": 0, "MemorySwap": 0, "MemorySwappiness": null, "OomKillDisable": null, "PidsLimit": null, "Ulimits": [], "CpuCount": 0, "CpuPercent": 0, "IOMaximumIOps": 0, "IOMaximumBandwidth": 0, "MaskedPaths": [ "/proc/asound", "/proc/acpi", "/proc/kcore", "/proc/keys", "/proc/latency_stats", "/proc/timer_list", "/proc/timer_stats", "/proc/sched_debug", "/proc/scsi", "/sys/firmware", "/sys/devices/virtual/powercap" ], "ReadonlyPaths": [ "/proc/bus", "/proc/fs", "/proc/irq", "/proc/sys", "/proc/sysrq-trigger" ] }, "GraphDriver": { "Data": { "LowerDir": "/var/lib/docker/overlay2/885e5349994932811beef77ad12f605fe43919986f0d8690cc83f06a32c1e7cf-init/diff:/var/lib/docker/overlay2/b579d52c8d31ad799154342ba611388b06a444f69798b59775c61a8852d2bc22/diff:/var/lib/docker/overlay2/ba41d3f59446a73035a3b44b2acd3e12ecd1c514a33b847df172bc46d496500f/diff", "MergedDir": "/var/lib/docker/overlay2/885e5349994932811beef77ad12f605fe43919986f0d8690cc83f06a32c1e7cf/merged", "UpperDir": "/var/lib/docker/overlay2/885e5349994932811beef77ad12f605fe43919986f0d8690cc83f06a32c1e7cf/diff", "WorkDir": "/var/lib/docker/overlay2/885e5349994932811beef77ad12f605fe43919986f0d8690cc83f06a32c1e7cf/work" }, "Name": "overlay2" }, "Mounts": [ { "Type": "bind", "Source": "/Users/cristian/Code/tigerbeetle-wing/data", "Destination": "/data", "Mode": "", "RW": true, "Propagation": "rprivate" } ], "Config": { "Hostname": "b5c8aff24d8a", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "ExposedPorts": { "3000/tcp": {} }, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ], "Cmd": [ "start", "--cache-grid=256MiB", "--addresses=0.0.0.0:3000", "/data/d815626e.tigerbeetle" ], "Image": "ghcr.io/tigerbeetle/tigerbeetle", "Volumes": null, "WorkingDir": "", "Entrypoint": [ "/tigerbeetle" ], "OnBuild": null, "Labels": {} }, "NetworkSettings": { "Bridge": "", "SandboxID": "d918167b9d627f6b61551391635ccc8f847609ab24b2090f3b78c9eb4a6bcd40", "SandboxKey": "/var/run/docker/netns/d918167b9d62", "Ports": { "3000/tcp": [ { "HostIp": "0.0.0.0", "HostPort": "53823" } ] }, "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "4edaced4fb2a1ee57303565d38247645f4e90b893a9c498e316f3c488d5d3fb1", "Gateway": "172.17.0.1", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "172.17.0.2", "IPPrefixLen": 16, "IPv6Gateway": "", "MacAddress": "02:42:ac:11:00:02", "Networks": { "bridge": { "IPAMConfig": null, "Links": null, "Aliases": null, "MacAddress": "02:42:ac:11:00:02", "NetworkID": "c3b0a812ea37db75382b1e1642a8ffb72da60a8dc57a5671120d5da94e5da0b9", "EndpointID": "4edaced4fb2a1ee57303565d38247645f4e90b893a9c498e316f3c488d5d3fb1", "Gateway": "172.17.0.1", "IPAddress": "172.17.0.2", "IPPrefixLen": 16, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "DriverOpts": null, "DNSNames": null } } } } ```I expected this:
No response
Is there a workaround?
No response
Anything else?
I think the problem is that there may be a time gap where
docker inspect
will return that a container is running, but the port is still not resolved. So, the solution may be to use awaitUntil
to fetch the host port.Wing Version
No response
Node.js Version
No response
Platform(s)
No response
Community Notes