{"record":{"id":"88c80b72157c9c2c","repo":"jenkinsci/jenkins","slug":"there-s-no-jenkins-running-at","errorCode":null,"errorMessage":"There's no Jenkins running at {}","messagePattern":"There's no Jenkins running at (.+?)","errorType":"exception","errorClass":"NotTalkingToJenkinsException","httpStatus":null,"severity":"critical","filePath":"cli/src/main/java/hudson/cli/CLI.java","lineNumber":88,"sourceCode":"\n/**\n * CLI entry point to Jenkins.\n */\n@SuppressFBWarnings(value = \"CRLF_INJECTION_LOGS\", justification = \"We don't care about this behavior\")\npublic class CLI {\n\n    private CLI() {}\n\n    /**\n     * Make sure the connection is open against Jenkins server.\n     *\n     * @param c The open connection.\n     * @throws IOException in case of communication problem.\n     * @throws NotTalkingToJenkinsException when connection is not made to Jenkins service.\n     */\n    /*package*/ static void verifyJenkinsConnection(URLConnection c) throws IOException {\n        if (c.getHeaderField(\"X-Hudson\") == null && c.getHeaderField(\"X-Jenkins\") == null)\n            throw new NotTalkingToJenkinsException(c);\n    }\n\n    /*package*/ static final class NotTalkingToJenkinsException extends IOException {\n        NotTalkingToJenkinsException(String s) {\n            super(s);\n        }\n\n        NotTalkingToJenkinsException(URLConnection c) {\n            super(\"There's no Jenkins running at \" + c.getURL().toString());\n        }\n    }\n\n    public static void main(final String[] _args) throws Exception {\n        try {\n            System.exit(_main(_args));\n        } catch (NotTalkingToJenkinsException ex) {\n            System.err.println(ex.getMessage());\n            System.exit(3);","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/jenkinsci/jenkins/blob/2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc/cli/src/main/java/hudson/cli/CLI.java#L70-L106","documentation":"CLI.NotTalkingToJenkinsException is thrown by CLI.verifyJenkinsConnection when an HTTP response carries neither the 'X-Hudson' nor the 'X-Jenkins' header. Those headers are set by every Jenkins controller, so their absence means the URL does not point at a live Jenkins instance. main() catches it specially and exits with status 3.","triggerScenarios":"Running any 'jenkins-cli' command with a -s URL that resolves to a non-Jenkins HTTP server, a reverse proxy that strips response headers, a server that is down (returning an error page from a load balancer), or a plain 404/HTML page.","commonSituations":"Wrong -s URL (typo, missing port, http vs https); pointing the CLI at a reverse proxy/ingress that drops X-Jenkins; pointing at an artifact repository or static site instead of the controller; Jenkins still starting up and not yet serving requests.","solutions":["Verify the URL opens in a browser and shows the Jenkins UI; confirm the -s value matches it exactly including scheme and context path.","Check that any reverse proxy in front of Jenkins passes through the X-Jenkins / X-Hudson response headers (avoid proxy_buffering or header-stripping directives).","If Jenkins is still booting, wait for it to be fully 'READY' (check the actuator/health endpoint) before running the CLI."],"exampleFix":"# before\njava -jar jenkins-cli.jar -s http://example.com help\n# after\njava -jar jenkins-cli.jar -s http://example.com/jenkins/ help","handlingStrategy":"try-catch","validationCode":"// Reachability pre-check: confirm the X-Jenkins header is present\nURL url = new URL(baseUrl);\nHttpURLConnection c = (HttpURLConnection) url.openConnection();\nc.setRequestMethod(\"GET\");\nc.connect();\nboolean isJenkins = c.getHeaderField(\"X-Jenkins\") != null;\nif (!isJenkins) {\n    throw new IllegalStateException(baseUrl + \" is not a Jenkins controller\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    CLI._main(args);\n} catch (CLI.NotTalkingToJenkinsException ex) {\n    // surface a clear message: URL is not a Jenkins instance\n    System.err.println(\"Jenkins not reachable at \" + jenkinsUrl + \": \" + ex.getMessage());\n    System.exit(3);\n}","preventionTips":["Always derive the -s URL by copying it from the running Jenkins UI.","Confirm the reverse proxy forwards X-Jenkins/X-Hudson response headers.","Fetch the CLI jar from the target controller's /jnlpJars/ to keep versions aligned."],"tags":["jenkins-cli","network","connection","http-headers"],"backgroundTag":null,"analyzedSha":"2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc","analyzedAt":"2026-08-14T07:07:15.274Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}