Before submitting
What happened?
On a Linux host where IPv6 is disabled (RHEL 9 with no IPv6), launching an OpenVSCode IDE workspace via DevPod fails to forward any ports. The DevPod agent log shows a repeating error:
Error watching ports: open /proc/net/tcp6: no such file or directory
Tracing this through the code: pkg/netstat/watcher.go:findPorts() unconditionally calls TCP6Socks(), which propagates the resulting os.Open error from doNetstat → osTCP6Socks → TCP6Socks → findPorts → runOnce. Because findPorts returns nil, err on IPv6 failure, the IPv4 sockets it already successfully collected are discarded and no ports are forwarded at all.
Relevant code:
pkg/netstat/netstat_util.go:249-261 — doNetstat opens the proc file and returns any error verbatim, with no IsNotExist check
pkg/netstat/watcher.go:86-91 — findPorts aborts on the TCP6Socks error instead of falling back to the already-collected IPv4 results
The net effect is that the OpenVSCode server port (default 10800) never gets forwarded, and the IDE is unreachable from the client.
What did you expect to happen instead?
TCP6Socks (and UDP6Socks) should treat a missing /proc/net/tcp6 / /proc/net/udp6 as "no IPv6 sockets" and return an empty slice with a nil error. Port forwarding should continue to work for IPv4 sockets on IPv6-disabled hosts, and OpenVSCode should be reachable.
Suggested fix: in doNetstat (or in osTCP6Socks / osUDP6Socks), check errors.Is(err, fs.ErrNotExist) on the os.Open result and return nil, nil in that case.
Steps to reproduce
Real-world trigger (what I hit):
- Provision a RHEL 9 host with IPv6 disabled (so
/proc/net/tcp6 does not exist)
- Configure DevPod with the Docker provider on that host
devpod up <workspace> --ide openvscode
- Observe that the OpenVSCode server never becomes reachable and the agent log contains repeating
Error watching ports: open /proc/net/tcp6: no such file or directory entries
Minimal standalone reproducer (runs on any macOS host or any Linux host with IPv6 disabled — both lack /proc/net/tcp6 and exercise the exact same code path; the pkg/netstat package has no //go:build linux constraint so it compiles on macOS as well):
git clone https://github.com/skevetter/devpod
cd devpod
cat > /tmp/devpod_ipv6_repro.go <<'REPRO'
package main
import (
"fmt"
"os"
"github.com/skevetter/devpod/pkg/netstat"
)
func main() {
if _, err := netstat.TCP6Socks(netstat.NoopFilter); err != nil {
fmt.Fprintf(os.Stderr, "BUG REPRODUCED: TCP6Socks failed: %v\n", err)
os.Exit(1)
}
fmt.Println("OK")
}
REPRO
go run /tmp/devpod_ipv6_repro.go
Output with the bug present:
BUG REPRODUCED: TCP6Socks failed: open /proc/net/tcp6: no such file or directory
exit status 1
Output after the fix:
Note: on a Linux host that has IPv6 enabled, the reproducer will print OK because /proc/net/tcp6 exists. To observe the failure, run it on macOS or on an IPv6-disabled Linux host.
devcontainer.json
Not applicable — the bug is in the port watcher and is independent of devcontainer config.
Error output / logs
Error watching ports: open /proc/net/tcp6: no such file or directory
Error watching ports: open /proc/net/tcp6: no such file or directory
Error watching ports: open /proc/net/tcp6: no such file or directory
# ... repeats every 3 seconds, no ports ever forwarded
How often does this happen?
Every time
Operating system
Linux
Linux distribution
RHEL 9
Architecture
AMD64
Desktop app or CLI?
CLI only
DevPod version
v0.19.0
DevPod provider
Docker
Provider version
latest
Anything else?
The bug also affects UDP6Socks, though it is not currently called from findPorts. The fix should cover both to prevent future regressions.
Before submitting
What happened?
On a Linux host where IPv6 is disabled (RHEL 9 with no IPv6), launching an OpenVSCode IDE workspace via DevPod fails to forward any ports. The DevPod agent log shows a repeating error:
Tracing this through the code:
pkg/netstat/watcher.go:findPorts()unconditionally callsTCP6Socks(), which propagates the resultingos.Openerror fromdoNetstat→osTCP6Socks→TCP6Socks→findPorts→runOnce. BecausefindPortsreturnsnil, erron IPv6 failure, the IPv4 sockets it already successfully collected are discarded and no ports are forwarded at all.Relevant code:
pkg/netstat/netstat_util.go:249-261—doNetstatopens the proc file and returns any error verbatim, with noIsNotExistcheckpkg/netstat/watcher.go:86-91—findPortsaborts on theTCP6Sockserror instead of falling back to the already-collected IPv4 resultsThe net effect is that the OpenVSCode server port (default
10800) never gets forwarded, and the IDE is unreachable from the client.What did you expect to happen instead?
TCP6Socks(andUDP6Socks) should treat a missing/proc/net/tcp6//proc/net/udp6as "no IPv6 sockets" and return an empty slice with a nil error. Port forwarding should continue to work for IPv4 sockets on IPv6-disabled hosts, and OpenVSCode should be reachable.Suggested fix: in
doNetstat(or inosTCP6Socks/osUDP6Socks), checkerrors.Is(err, fs.ErrNotExist)on theos.Openresult and returnnil, nilin that case.Steps to reproduce
Real-world trigger (what I hit):
/proc/net/tcp6does not exist)devpod up <workspace> --ide openvscodeError watching ports: open /proc/net/tcp6: no such file or directoryentriesMinimal standalone reproducer (runs on any macOS host or any Linux host with IPv6 disabled — both lack
/proc/net/tcp6and exercise the exact same code path; thepkg/netstatpackage has no//go:build linuxconstraint so it compiles on macOS as well):Output with the bug present:
Output after the fix:
devcontainer.json
Not applicable — the bug is in the port watcher and is independent of devcontainer config.
Error output / logs
How often does this happen?
Every time
Operating system
Linux
Linux distribution
RHEL 9
Architecture
AMD64
Desktop app or CLI?
CLI only
DevPod version
v0.19.0
DevPod provider
Docker
Provider version
latest
Anything else?
The bug also affects
UDP6Socks, though it is not currently called fromfindPorts. The fix should cover both to prevent future regressions.