alibaba/nacos · error · NacosLockException

unLock error.

Error message

unLock error.

What it means

Error "unLock error." thrown in alibaba/nacos.

Source

Thrown at lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:475

        lockInfo.setOwner(lockInstance.getOwner());
        request.setLockInfo(lockInfo);
        WriteRequest writeRequest = WriteRequest.newBuilder().setGroup(group())
            .setData(ByteString.copyFrom(serializer.serialize(request)))
            .setOperation(LockOperationEnum.RELEASE.name()).build();
        try {
            Response response = protocol.write(writeRequest);
            if (response.getSuccess()) {
                return serializer.deserialize(response.getData().toByteArray());
            }
            throw new NacosLockException(response.getErrMsg());
        } catch (NacosLockException e) {
            int paramSize = lockInstance.getParams() == null ? 0 : lockInstance.getParams().size();
            LOGGER.error("key: {}, lockType:{}, paramSize:{} unlock fail, errorMsg: {}",
                lockInstance.getKey(),
                lockInstance.getLockType(), paramSize, e.getMessage());
            throw e;
        } catch (Exception e) {
            throw new NacosLockException("unLock error.", e);
        }
    }
    
    @Override
    public Boolean renew(LockInstance lockInstance) {
        MutexLockRequest request = new MutexLockRequest();
        LockInfo lockInfo = new LockInfo();
        lockInfo.setKey(new LockKey(lockInstance.getLockType(), lockInstance.getKey()));
        lockInfo.setParams(lockInstance.getParams());
        lockInfo.setOwner(lockInstance.getOwner());
        
        long expiredTime = lockInstance.getExpiredTime();
        if (expiredTime < 0) {
            lockInfo.setEndTime(defaultExpireTime + getNowTimestamp());
        } else {
            lockInfo.setEndTime(Math.min(maxExpireTime, expiredTime) + getNowTimestamp());
        }
        request.setLockInfo(lockInfo);

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Inspect the server logs for the underlying cause, fix it, and retry the operation.

When it happens

Trigger: Thrown at lock/src/main/java/com/alibaba/nacos/lock/service/impl/LockOperationServiceImpl.java:475 when the library encounters an invalid state.

Common situations: An unlock call failed on the server.


AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14). Data as JSON: /api/errors/20a49c88e7085403. Report an issue: GitHub.