theonedev/onedev · error · ExplicitException
This workspace is provisioned on agent previously, and canno
Error message
This workspace is provisioned on agent previously, and cannot be reprovisioned via server docker
What it means
ServerDockerProvisioner.submitTask throws ExplicitException when the task is pinned to a specific agent (pinnedAgentId != null). A workspace previously provisioned on a (remote) agent cannot have its cluster tasks executed via the server-docker provisioner — the pin is incompatible.
Source
Thrown at server-plugin/server-plugin-provisioner-serverdocker/src/main/java/io/onedev/server/plugin/provisioner/serverdocker/ServerDockerProvisioner.java:557
throw new RuntimeException(e);
}
return serverHost;
}
protected int getConcurrencyNumber() {
return concurrency != null ? concurrency : 0;
}
@Override
public List<RegistryLoginFacade> getRegistryLogins(String token) {
return getRegistryLoginFacades(token);
}
@Override
public <T> Future<T> submitTask(@Nullable String pinnedServerAddress, @Nullable Long pinnedAgentId,
ClusterTask<T> task, TaskLogger logger) {
if (pinnedAgentId != null) {
throw new ExplicitException("""
This workspace is provisioned on agent previously, \
and cannot be reprovisioned via server docker""");
}
logger.log("Pending resource allocation...");
return getResourceService().submitServerTask(
pinnedServerAddress, getName(), getConcurrencyNumber(), 1, task);
}
@Override
public void deleteWorkspace(Long projectId, Long workspaceNumber, @Nullable String pinnedServer, @Nullable Long pinnedAgentId) {
ServerProvisionerUtils.deleteWorkspace(projectId, workspaceNumber, pinnedServer);
}
@Override
public boolean isApplicable(Project project) {
return getApplicableProjects() == null || WildcardUtils.matchPath(getApplicableProjects(), project.getPath());
}
View on GitHub (pinned to d44925c47c)
Solutions
- Re-create/reprovision the workspace so it is provisioned by server docker without agent pinning
- Clear the stale agent pin on the workspace (or reset workspace state) before re-running
- Keep the workspace on its original agent-based provisioner if it must run on that agent
- If migrating provisioners intentionally, create a fresh workspace instead of reprovisioning the old one
Example fix
null
Defensive patterns
Strategy: validation
Validate before calling
if (task.getPinnedAgentId() != null) { throw new IllegalStateException('Use the original agent-based provisioner for this workspace'); } Try / catch
try { submitTask(...); } catch (ExplicitException e) { if (e.getMessage().contains('provisioned on agent')) recreateWorkspaceWithoutAgentPin(); else throw e; } Prevention
- Do not switch a workspace from agent-based provisioner to server docker; create a new workspace instead
- Clean up stale agent pins when agents are decommissioned
- Track which provisioner originally provisioned each workspace
When it happens
Trigger: A cluster task with a non-null pinnedAgentId submitted against the server docker provisioner — typically a workspace that was originally provisioned by the agent/server-shell provisioner and later switched to server docker, then re-provisioned or resumed with a stale agent pin.
Common situations: Migrating workspaces from agent-based provisioner to server docker; stale workspace state referencing an old agent after provisioner change; resuming an interrupted task pinned to a decommissioned agent.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
- Specified workspace provisioner '${provisioner}' is disabled
- Specified workspace provisioner '${provisioner}' is not appl
- No applicable provisioner discovered for current workspace.
- Unrecognized interpolation variable: ${t}
- Not authorized
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/141f379d37d9cf50.
Report an issue: GitHub.