{"record":{"id":"8053dacf889c33f1","repo":"theonedev/onedev","slug":"unrecognized-interpolation-variable-t-8053da","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/workspaceprovisioner/RegistryLogin.java","lineNumber":82,"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 workspaceToken) {\n\t\tvar interpolator = new WorkspaceVariableInterpolator(t -> {\n\t\t\tif (t.equalsIgnoreCase(WorkspaceVariable.SERVER_URL.name()))\n\t\t\t\treturn OneDev.getInstance(SettingService.class).getSystemSetting().getServerUrl();\n\t\t\telse if (t.equalsIgnoreCase(WorkspaceVariable.WORKSPACE_TOKEN.name()))\n\t\t\t\treturn workspaceToken;\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":64,"sourceCodeEnd":90,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/model/support/administration/workspaceprovisioner/RegistryLogin.java#L64-L90","documentation":"This is the workspace-provisioner counterpart of the job registry login error: RegistryLogin.getFacade() interpolates the registry URL/username with WorkspaceVariableInterpolator, which only recognizes WORKSPACE_TOKEN and SERVER_URL. Any other ${...} variable throws this ExplicitException, indicating an unsupported or misspelled placeholder in the workspace registry configuration.","triggerScenarios":"Configuring a container registry for workspace provisioning with a registry URL or username containing a ${...} variable other than ${serverUrl} or ${workspaceToken}, then triggering workspace provisioning.","commonSituations":"Copying variables from pipeline/job contexts (e.g. ${jobToken}) into workspace registry settings; typo in variable name; leftover template placeholders.","solutions":["Edit the workspace-provisioner container registry settings and use only ${serverUrl} or ${workspaceToken} in URL/username","Remove or escape stray ${...} placeholders that were copied from job settings","Re-run provisioning to verify interpolation succeeds"],"exampleFix":"// before (workspace registry username)\nusername: \"ws-${jobToken}\"\n// after\nusername: \"ws-${workspaceToken}\"","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(\"WORKSPACE_TOKEN\"))\n        throw new ValidationException(\"Unsupported variable: \" + v);\n}","typeGuard":null,"tryCatchPattern":"try {\n    var facade = registryLogin.getFacade(workspaceToken);\n} catch (ExplicitException e) {\n    logger.error(\"Bad workspace registry variable: {}\", e.getMessage());\n}","preventionTips":["Use only ${serverUrl} and ${workspaceToken} in workspace registry settings","Don't copy job-context variables into workspace settings","Validate configs after upgrading OneDev"],"tags":["workspace","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-14T05:17:10.506Z"}