{"record":{"id":"e4043ee5196a55ff","repo":"ipfs/kubo","slug":"support-for-ipfs-reuseport-was-removed-use-libp2p","errorCode":null,"errorMessage":"support for IPFS_REUSEPORT was removed. Use LIBP2P_TCP_REUSEPORT instead","messagePattern":"support for IPFS_REUSEPORT was removed\\. Use LIBP2P_TCP_REUSEPORT instead","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/ipfs/kubo/daemon.go","lineNumber":995,"sourceCode":"\t\treturn errors.New(\"Provide.Strategy='flat' is no longer supported. Use 'all' instead. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#providestrategy\")\n\t}\n\tif cfg.Experimental.StrategicProviding {\n\t\treturn errors.New(\"Experimental.StrategicProviding was removed. Remove it from your config. Documentation: https://github.com/ipfs/kubo/blob/master/docs/experimental-features.md#strategic-providing\")\n\t}\n\tif cfg.Provide.DHT.SweepEnabled.WithDefault(config.DefaultProvideDHTSweepEnabled) &&\n\t\tcfg.Provide.DHT.MaxWorkers.WithDefault(config.DefaultProvideDHTMaxWorkers) == 0 {\n\t\treturn errors.New(\"invalid configuration: Provide.DHT.MaxWorkers cannot be 0 when Provide.DHT.SweepEnabled=true. Set Provide.DHT.MaxWorkers to a positive value (e.g., 16) to control resource usage. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#providedhtmaxworkers\")\n\t}\n\tif routingOption == routingOptionDelegatedKwd && cfg.Provide.Enabled.WithDefault(config.DefaultProvideEnabled) {\n\t\treturn errors.New(\"Routing.Type=delegated does not support content providing. Set Provide.Enabled=false in your config\")\n\t}\n\n\treturn nil\n}\n\nfunc validateDaemonEnvironment() error {\n\tif flag := os.Getenv(\"IPFS_REUSEPORT\"); flag != \"\" {\n\t\treturn errors.New(\"support for IPFS_REUSEPORT was removed. Use LIBP2P_TCP_REUSEPORT instead\")\n\t}\n\treturn nil\n}\n\n// printLibp2pPorts prints which ports are opened to facilitate swarm connectivity.\nfunc printLibp2pPorts(node *core.IpfsNode) {\n\tif !node.IsOnline {\n\t\tfmt.Println(\"Swarm not listening, running in offline mode.\")\n\t\treturn\n\t}\n\n\tif node.PeerHost == nil {\n\t\tlog.Error(\"PeerHost is nil - this should not happen and likely indicates an FX dependency injection issue or race condition\")\n\t\tfmt.Println(\"Swarm not properly initialized - node PeerHost is nil.\")\n\t\treturn\n\t}\n\n\tifaceAddrs, err := node.PeerHost.Network().InterfaceListenAddresses()","sourceCodeStart":977,"sourceCodeEnd":1013,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/cmd/ipfs/kubo/daemon.go#L977-L1013","documentation":"The IPFS_REUSEPORT environment variable was removed from Kubo; validateDaemonEnvironment fails daemon startup when it is set, directing users to the replacement LIBP2P_TCP_REUSEPORT. It exists so stale env settings fail loudly instead of being silently ignored and changing network behavior.","triggerScenarios":"`ipfs daemon` run with IPFS_REUSEPORT present in the environment — set in shell profiles, systemd units, Dockerfiles, or compose files from older Kubo versions.","commonSituations":"Container images inheriting env vars from legacy base images; operators upgrading Kubo while keeping old systemd/docker environment blocks.","solutions":["Rename the variable to LIBP2P_TCP_REUSEPORT in the environment (systemd unit, Dockerfile ENV, compose environment)","Unset it for the current shell: `unset IPFS_REUSEPORT` before starting the daemon","Search deployment configs for IPFS_REUSEPORT and remove all occurrences","See docs/environment-variables.md for the supported variable set"],"exampleFix":"// before (systemd unit)\nEnvironment=IPFS_REUSEPORT=false\n\n// after\nEnvironment=LIBP2P_TCP_REUSEPORT=false","handlingStrategy":"validation","validationCode":"// fail before daemon start if removed env var is set\n[ -n \"${IPFS_REUSEPORT:-}\" ] && echo \"IPFS_REUSEPORT removed; use LIBP2P_TCP_REUSEPORT\" && exit 1","typeGuard":null,"tryCatchPattern":"if err := daemonFunc(...); err != nil {\n    if strings.Contains(err.Error(), \"IPFS_REUSEPORT was removed\") {\n        log.Fatalf(\"rename env var: %v\", err)\n    }\n}","preventionTips":["Grep Dockerfiles/systemd/compose for IPFS_REUSEPORT during upgrades","Use LIBP2P_TCP_REUSEPORT for TCP reuseport control","Consult docs/environment-variables.md for the current supported set","Keep environment blocks versioned alongside the Kubo version they target"],"tags":["environment-variables","deprecation","daemon","reuseport"],"backgroundTag":"removed-environment-variable","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}