theonedev/onedev · error · ExplicitException

Unrecognized interpolation variable: ${t}

Error message

Unrecognized interpolation variable: ${t}

What it means

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.

Source

Thrown at server-core/src/main/java/io/onedev/server/model/support/administration/jobexecutor/RegistryLogin.java:80

	@Editable(order=300, name="Password", description = "Specify password or access token of specified registry")
	@NotEmpty
	@Password
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public RegistryLoginFacade getFacade(String jobToken) {
		var interpolator = new JobVariableInterpolator(t -> {
			if (t.equalsIgnoreCase(JobVariable.SERVER_URL.name()))
				return OneDev.getInstance(SettingService.class).getSystemSetting().getServerUrl();
			else if (t.equalsIgnoreCase(JobVariable.JOB_TOKEN.name()))
				return jobToken;
			else
				throw new ExplicitException("Unrecognized interpolation variable: " + t);
		});
		return new RegistryLoginFacade(
				interpolator.interpolate(getRegistryUrl()), 
				interpolator.interpolate(getUserName()), 
				getPassword());
	}
	
}

View on GitHub (pinned to d44925c47c)

Solutions

  1. Edit Administration → Global Pipeline Setting → Container Registries and replace the unknown variable with ${serverUrl} or ${jobToken} only
  2. If a literal $ is needed, escape it per JobVariableInterpolator rules instead of using ${...} syntax
  3. Check the interpolated value in a test build to confirm only supported variables remain

Example fix

// before (registry username)
username: "ci-${registryName}"
// after (only SERVER_URL / JOB_TOKEN supported)
username: "ci-${jobToken}"
Defensive patterns

Strategy: validation

Validate before calling

java.util.regex.Matcher m = java.util.regex.Pattern.compile("\\$\\{([^}]+)\\}")
    .matcher(registryLogin.getRegistryUrl() + registryLogin.getUserName());
while (m.find()) {
    String v = m.group(1);
    if (!v.equalsIgnoreCase("SERVER_URL") && !v.equalsIgnoreCase("JOB_TOKEN"))
        throw new ValidationException("Unsupported variable: " + v);
}

Try / catch

try {
    var facade = registryLogin.getFacade(jobToken);
} catch (ExplicitException e) {
    logger.error("Bad registry variable: {}", e.getMessage());
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/6d8d76fcb9501541. Report an issue: GitHub.