{"record":{"id":"6d8d76fcb9501541","repo":"theonedev/onedev","slug":"unrecognized-interpolation-variable-t","errorCode":null,"errorMessage":"Unrecognized interpolation variable: ${t}","messagePattern":"Unrecognized interpolation variable: (.+?)","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/model/support/administration/jobexecutor/RegistryLogin.java","lineNumber":80,"sourceCode":"\t@Editable(order=300, name=\"Password\", description = \"Specify password or access token of specified registry\")\n\t@NotEmpty\n\t@Password\n\tpublic String getPassword() {\n\t\treturn password;\n\t}\n\n\tpublic void setPassword(String password) {\n\t\tthis.password = password;\n\t}\n\n\tpublic RegistryLoginFacade getFacade(String jobToken) {\n\t\tvar interpolator = new JobVariableInterpolator(t -> {\n\t\t\tif (t.equalsIgnoreCase(JobVariable.SERVER_URL.name()))\n\t\t\t\treturn OneDev.getInstance(SettingService.class).getSystemSetting().getServerUrl();\n\t\t\telse if (t.equalsIgnoreCase(JobVariable.JOB_TOKEN.name()))\n\t\t\t\treturn jobToken;\n\t\t\telse\n\t\t\t\tthrow new ExplicitException(\"Unrecognized interpolation variable: \" + t);\n\t\t});\n\t\treturn new RegistryLoginFacade(\n\t\t\t\tinterpolator.interpolate(getRegistryUrl()), \n\t\t\t\tinterpolator.interpolate(getUserName()), \n\t\t\t\tgetPassword());\n\t}\n\t\n}","sourceCodeStart":62,"sourceCodeEnd":88,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/model/support/administration/jobexecutor/RegistryLogin.java#L62-L88","documentation":"RegistryLogin.getFacade() interpolates variables like ${serverUrl} and ${jobToken} in the registry URL and username using JobVariableInterpolator. Any ${...} placeholder other than SERVER_URL or JOB_TOKEN (case-insensitive) triggers this ExplicitException. Effectively it flags a typo or unsupported variable in the container registry login configuration.","triggerScenarios":"Configuring a container registry's registry URL or username containing an interpolation variable other than ${serverUrl} or ${jobToken} (e.g. ${image}, ${password}, or a misspelled name) and then using the registry in a job.","commonSituations":"Copy-pasted template variables from other OneDev contexts (build/job specs); misspelled variable names like ${serverurl} vs intended ${serverUrl} (handled) or ${serveurl} (not); leftover placeholders like ${registryUrl} in the username field.","solutions":["Edit Administration → Global Pipeline Setting → Container Registries and replace the unknown variable with ${serverUrl} or ${jobToken} only","If a literal $ is needed, escape it per JobVariableInterpolator rules instead of using ${...} syntax","Check the interpolated value in a test build to confirm only supported variables remain"],"exampleFix":"// before (registry username)\nusername: \"ci-${registryName}\"\n// after (only SERVER_URL / JOB_TOKEN supported)\nusername: \"ci-${jobToken}\"","handlingStrategy":"validation","validationCode":"java.util.regex.Matcher m = java.util.regex.Pattern.compile(\"\\\\$\\\\{([^}]+)\\\\}\")\n    .matcher(registryLogin.getRegistryUrl() + registryLogin.getUserName());\nwhile (m.find()) {\n    String v = m.group(1);\n    if (!v.equalsIgnoreCase(\"SERVER_URL\") && !v.equalsIgnoreCase(\"JOB_TOKEN\"))\n        throw new ValidationException(\"Unsupported variable: \" + v);\n}","typeGuard":null,"tryCatchPattern":"try {\n    var facade = registryLogin.getFacade(jobToken);\n} catch (ExplicitException e) {\n    logger.error(\"Bad registry variable: {}\", e.getMessage());\n}","preventionTips":["Only use ${serverUrl} and ${jobToken} in registry settings","Escape literal $ signs instead of writing ${...}","Lint registry configs when exporting/importing settings"],"tags":["docker-registry","interpolation","configuration"],"backgroundTag":"invalid-config-value","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"}