{"record":{"id":"0afd8ecd5be5f55a","repo":"hashicorp/packer","slug":"jenkins-url-environment-variable-not-found","errorCode":null,"errorMessage":"JENKINS_URL environment variable not found","messagePattern":"JENKINS_URL environment variable not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/hcp/registry/metadata/cicd.go","lineNumber":137,"sourceCode":"\tfor _, key := range keys {\n\t\tif value, ok := os.LookupEnv(key); ok {\n\t\t\tenv[key] = value\n\t\t}\n\t}\n\n\treturn env\n}\n\nfunc (b *BitbucketPipelines) Type() string {\n\treturn \"bitbucket\"\n}\n\ntype JenkinsCI struct{}\n\nfunc (g *JenkinsCI) Detect() error {\n\t_, ok := os.LookupEnv(\"JENKINS_URL\")\n\tif !ok {\n\t\treturn fmt.Errorf(\"JENKINS_URL environment variable not found\")\n\t}\n\treturn nil\n}\n\nfunc (g *JenkinsCI) Details() map[string]interface{} {\n\tenv := make(map[string]interface{})\n\tkeys := []string{\n\t\t\"JENKINS_URL\",\n\t\t\"BUILD_URL\",\n\t\t\"NODE_NAME\",\n\t\t\"JOB_NAME\",\n\t\t\"JOB_URL\",\n\t\t\"BUILD_NUMBER\",\n\t\t\"BUILD_ID\",\n\t\t\"BUILD_TAG\",\n\t\t\"WORKSPACE\",\n\t\t\"BUILD_CAUSE\",\n\t\t\"GIT_COMMIT\",","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/internal/hcp/registry/metadata/cicd.go#L119-L155","documentation":"CI/CD environment detection for HCP Packer registry metadata. JenkinsCI.Detect probes for the JENKINS_URL variable that Jenkins exports to pipeline jobs; this error means Packer was not running on a Jenkins build agent, so this detector does not apply. It is benign when another CI detector succeeds, and only matters if Jenkins metadata was expected, in which case confirm the build runs inside a Jenkins job.","triggerScenarios":"Thrown at internal/hcp/registry/metadata/cicd.go:137 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Expected negative detection; try the next CI provider in the chain","Run the build as a Jenkins job if Jenkins metadata is required"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eb36e3c3e48a036f3e8cc94087636ee72e1303c9","analyzedAt":"2026-09-05T13:20:43.127Z","contentChangedAt":"2026-09-05T13:20:43.127Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}