theonedev/onedev · error · NotAcceptableException

This operation requires active subscription

Error message

This operation requires active subscription

What it means

Thrown by UserResource.disableUser because disabling users via the REST API is an enterprise feature gated on an active OneDev subscription. The subscription check runs before the admin check, so even admins get this 406 when no subscription is active.

Source

Thrown at server-core/src/main/java/io/onedev/server/rest/resource/UserResource.java:433

			user.setNotifyOwnEvents(data.isNotifyOwnEvents());
		if (data.isKeepEmailAddressesPrivate() != null)
			user.setKeepEmailAddressesPrivate(data.isKeepEmailAddressesPrivate());
		userService.update(user, oldName);

		if (!getAuthUser().equals(user)) {
			var newAuditContent = VersionedXmlDoc.fromBean(data).toXML();
			auditService.audit(null, "changed account \"" + user.getName() + "\" via RESTful API", oldAuditContent, newAuditContent);
		}
		
		return Response.ok().build();
    }

	@Api(order=1960, description="Disable user")
	@Path("/{userId}/disable")
    @POST
    public Response disableUser(@PathParam("userId") Long userId) {
		if (!subscriptionService.isSubscriptionActive())
			throw new NotAcceptableException("This operation requires active subscription");
		if (!SecurityUtils.isAdministrator()) 
			throw new UnauthorizedException();
		
		if (userId <= User.ROOT_ID)		
			throw new BadRequestException("Should only disable normal users");
		var user = userService.load(userId);
		userService.disable(user);

		auditService.audit(null, "disabled account \"" + user.getName() + "\" via RESTful API", null, null);

		return Response.ok().build();
    }

	@Api(order=1970, description="Enable user")
	@Path("/{userId}/enable")
    @POST
    public Response enableUser(@PathParam("userId") Long userId) {
		if (!subscriptionService.isSubscriptionActive())

View on GitHub (pinned to d44925c47c)

Solutions

  1. Upload/renew the OneDev enterprise license so a subscription is active.
  2. Renew the expired subscription.
  3. Disable the user through the UI/DB alternative available in your edition, if any.
  4. Guard the automation to skip user disable when subscription is inactive.

Example fix

// before
disableUser(userId); // 406 without subscription
// after
if (server.hasActiveSubscription())
    disableUser(userId);
else
    log.info("Subscription inactive; skipping disable for " + userId);
Defensive patterns

Strategy: validation

Validate before calling

if (!client.hasActiveSubscription())
    throw new SkipException("User disable requires an active OneDev subscription");

Try / catch

try { client.disableUser(userId); }
catch (NotAcceptableException e) {
    if (e.getMessage().contains("subscription")) log.warn("Subscription inactive; cannot disable user via API");
    else throw e;
}

Prevention

When it happens

Trigger: POST /rest/users/{userId}/disable while subscriptionService.isSubscriptionActive() returns false (no license/subscription, or expired/trial subscription).

Common situations: Running the free/community edition and calling a gated endpoint; expired subscription; license not yet uploaded after upgrade.

Related errors


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