{"record":{"id":"7d2b3d911837c291","repo":"theonedev/onedev","slug":"loopback-address-not-allowed-for-destination-of-ka","errorCode":null,"errorMessage":"Loopback address not allowed for destination of Kaniko image build step, please use ip address or host name instead","messagePattern":"Loopback address not allowed for destination of Kaniko image build step, please use ip address or host name instead","errorType":"validation","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/buildspec/step/BuildImageWithKanikoStep.java","lineNumber":221,"sourceCode":"\t\t@NotEmpty\n\t\tpublic String getDestinations() {\n\t\t\treturn destinations;\n\t\t}\n\n\t\tpublic void setDestinations(String destinations) {\n\t\t\tthis.destinations = destinations;\n\t\t}\n\n\t\tstatic List<InputSuggestion> suggestVariables(String matchWith) {\n\t\t\treturn BuildSpec.suggestVariables(matchWith, true, true, false);\n\t\t}\n\n\t\t@Override\n\t\tpublic String getOptions() {\n\t\t\tvar options = new ArrayList<String>();\n\t\t\tfor (var destination: StringUtils.splitAndTrim(getDestinations(), \" \")) {\n\t\t\t\tif (destination.contains(\"localhost\") || destination.contains(\"127.0.0.1\"))\n\t\t\t\t\tthrow new ExplicitException(\"Loopback address not allowed for destination of Kaniko image build step, please use ip address or host name instead\");\n\t\t\t\toptions.add(\"--destination=\" + destination);\n\t\t\t}\n\t\t\treturn StringUtils.join(options, \" \");\n\t\t}\n\t\t\n\t}\n\t\n\t@Editable(order=200, name=\"Export as OCI layout\")\n\tpublic static class OCIOutput implements Output {\n\n\t\tprivate static final long serialVersionUID = 1L;\n\n\t\tprivate String destPath;\n\n\t\t@Editable(name=\"OCI Layout Directory\", description = \"Specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job working directory</a> to store OCI layout\")\n\t\t@Interpolative(variableSuggester=\"suggestVariables\")\n\t\t@Path(Path.Type.RELATIVE)\n\t\t@NoSpace","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/buildspec/step/BuildImageWithKanikoStep.java#L203-L239","documentation":"BuildImageWithKanikoStep validates its destination image references and rejects any destination pointing to localhost or 127.0.0.1, since the built image must be pushed to a registry reachable from the build environment.","triggerScenarios":"Thrown at server-core/src/main/java/io/onedev/server/buildspec/step/BuildImageWithKanikoStep.java:221 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Replace localhost/127.0.0.1 in the destination with the registry's IP address or host name.","Use the container registry service name or an externally resolvable registry URL."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}