{"record":{"id":"b61485ecb12df2c5","repo":"alibaba/arthas","slug":"arthas-server-did-not-start-after-attach-no-liste","errorCode":null,"errorMessage":"Arthas server did not start after attach (no listener on {ip}:{telnetPort}), see errors above and the target's arthas.log","messagePattern":"Arthas server did not start after attach \\(no listener on (.+?):(.+?)\\), see errors above and the target's arthas\\.log","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"core/src/main/java/com/taobao/arthas/core/Arthas.java","lineNumber":477,"sourceCode":"                try {\n                    Thread.sleep(300);\n                } catch (InterruptedException ie) {\n                    Thread.currentThread().interrupt();\n                    break;\n                }\n            }\n        }\n\n        // 失败：大声报错，并给出可操作的排查路径\n        String copiedHome = \"/proc/\" + targetPid + \"/root\" + detectTargetTmpDir(targetPid) + \"/arthas-\" + targetPid;\n        AnsiLog.error(\"Arthas server did NOT start on {}:{} after attach. The attach handshake succeeded, but the \"\n                + \"in-target server failed to bind.\", ip, telnetPort);\n        AnsiLog.error(\"Common cause under cross mount-namespace: incomplete resources copied into the target, or a \"\n                + \"bind failure inside the target JVM.\");\n        AnsiLog.error(\"Copied arthas home in target: {}\", copiedHome);\n        AnsiLog.error(\"Check the target's arthas.log for the real cause, e.g.: find /proc/{}/root -name arthas.log\",\n                targetPid);\n        throw new IllegalStateException(\"Arthas server did not start after attach (no listener on \" + ip + \":\"\n                + telnetPort + \"), see errors above and the target's arthas.log\");\n    }\n\n    private static String encodeArg(String arg) {\n        try {\n            return URLEncoder.encode(arg, \"utf-8\");\n        } catch (UnsupportedEncodingException e) {\n            return arg;\n        }\n    }\n\n    public static void main(String[] args) {\n        try {\n            new Arthas(args);\n        } catch (Throwable t) {\n            AnsiLog.error(\"Start arthas failed, exception stack trace: \");\n            t.printStackTrace();\n            System.exit(-1);","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/core/src/main/java/com/taobao/arthas/core/Arthas.java#L459-L495","documentation":"Thrown by Arthas.main attach path: the attach handshake to the target JVM succeeded, but the in-target Arthas server never opened a listener on the expected ip:telnetPort (probe failed). The message is a deliberately loud, actionable failure for the cross mount-namespace attach scenario where resources copied into the target (/proc/<pid>/root/.../arthas-<pid>) may be incomplete or the server bind failed inside the target.","triggerScenarios":"Cross-mount-namespace attach (e.g. arthas running in a sidecar/host attaching to a target JVM in a container) where the attach succeeds but the telnet/http server does not bind; incomplete copy of the Arthas home into the target's mount namespace; a bind failure (port conflict, permission) inside the target JVM after attach.","commonSituations":"Attaching arthas from outside a container to a JVM inside it; targeting a process in a different PID/mount namespace; stale arthas home in the target blocking re-copy; the requested ip/telnetPort cannot be bound in the target namespace.","solutions":["Read the target's arthas.log: find /proc/<pid>/root -name arthas.log — the real cause (class not found, bind refused, missing jar) is logged there.","Verify the copied home in the target is complete: ls -la /proc/<pid>/root<tmp>/arthas-<pid>.","Run arthas from inside the target's namespace (exec into the container, or use -h/--target-ip pointing at the right interface).","Ensure the target's telnetPort is free inside that namespace and reachable from where you connect.","Clean a stale in-target arthas dir and re-attach."],"exampleFix":"// before\njava -jar arthas-boot.jar <pid>  // from host, target in container\n\n// after\n# exec into the target container and attach from inside\nkubectl exec -it <pod> -- sh -c 'cd /tmp && java -jar arthas-boot.jar 1'","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    arthasAttach(pid, ip, telnetPort);\n} catch (IllegalStateException e) {\n    // read /proc/<pid>/root/.../arthas.log, clean stale home, then attach from inside the target namespace\n}","preventionTips":["For cross-namespace targets, prefer attaching from inside the container.","Verify the copied arthas home under /proc/<pid>/root is complete before relying on it.","Ensure the telnetPort is free and reachable in the target namespace.","Always check the target's arthas.log for the true root cause."],"tags":["attach","mount-namespace","network","container","diagnostic"],"backgroundTag":null,"analyzedSha":"21cf2e9ba52b305290be7223b980ff504bb9cb5b","analyzedAt":"2026-08-14T00:57:07.243Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}