theonedev/onedev · error · NotAcceptableException
Server URL can only be "${ingressUrl}"
Error message
Server URL can only be "${ingressUrl}" What it means
setSystemSetting validates the server URL in the submitted SystemSetting: when the server runs behind a known ingress URL (e.g. in cluster mode), the URL is forced to that value and any other server URL is rejected.
Source
Thrown at server-core/src/main/java/io/onedev/server/rest/resource/SettingResource.java:216
@Api(order=1450)
@Path("/contributed-settings")
@GET
public List<ContributedAdministrationSetting> getContributedSettings() {
if (!SecurityUtils.isAdministrator())
throw new UnauthorizedException();
return new ArrayList<>(settingService.getContributedSettings().values());
}
@Api(order=1500)
@Path("/system")
@POST
public Response setSystemSetting(@NotNull @Valid SystemSetting systemSetting) {
if (!SecurityUtils.isAdministrator())
throw new UnauthorizedException();
String ingressUrl = OneDev.getInstance().getIngressUrl();
if (ingressUrl != null && !ingressUrl.equals(systemSetting.getServerUrl()))
throw new NotAcceptableException("Server URL can only be \"" + ingressUrl + "\"");
var oldAuditContent = VersionedXmlDoc.fromBean(settingService.getSystemSetting()).toXML();
settingService.saveSystemSetting(systemSetting);
auditService.audit(null, "changed system setting via RESTful API",
oldAuditContent, VersionedXmlDoc.fromBean(systemSetting).toXML());
return Response.ok().build();
}
@Api(order=1600)
@Path("/authenticator")
@POST
public Response setAuthenticator(@Valid Authenticator authenticator) {
if (!SecurityUtils.isAdministrator())
throw new UnauthorizedException();
var oldAuditContent = VersionedXmlDoc.fromBean(settingService.getAuthenticator()).toXML();
settingService.saveAuthenticator(authenticator);
auditService.audit(null, "changed authenticator via RESTful API",
oldAuditContent, VersionedXmlDoc.fromBean(authenticator).toXML());
return Response.ok().build();View on GitHub (pinned to d44925c47c)
Solutions
- Submit serverUrl exactly equal to the configured ingress URL
- Remove/change the ingress URL configuration if the server URL legitimately changed
- Update ingress settings in the deployment instead of the system setting
Example fix
// before
{"serverUrl": "http://old.example.com"}
// after
{"serverUrl": "https://onedev.example.com"} // must match ingress URL Defensive patterns
Strategy: validation
Validate before calling
if (ingressUrl && systemSetting.serverUrl !== ingressUrl) throw new Error('serverUrl must equal ingress URL: ' + ingressUrl); Prevention
- Fetch current system setting first and reuse its serverUrl
- Keep ingress URL and server URL in sync in deployment config
- Beware trailing-slash and http/https mismatches
When it happens
Trigger: POSTing a SystemSetting whose serverUrl differs from the ingress URL derived by the server (e.g. behind a reverse proxy/ingress that fixes the external URL).
Common situations: Kubernetes deployments with ingress configured; changing the external URL via API while an ingress URL is enforced; trailing-slash or http/https mismatches between submitted and ingress URLs.
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
- ${e.getMessage()}
- Unable to send verification email as mail service is not con
- At least one email address should be present for a user
- Time tracking needs to be enabled for the project
- Iteration is not defined in project hierarchy of the issue
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/f9572957670fffe5.
Report an issue: GitHub.