alibaba/nacos · error · NacosApiException

20004

20004

Error message

Config not exist, please publish Config first.

What it means

Error "Config not exist, please publish Config first." thrown in alibaba/nacos.

Source

Thrown at config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:172

    
    /**
     * Query configuration.
     */
    @Since("3.0.0")
    @GetMapping
    @TpsControl(pointName = "ConfigQuery")
    @Secured(action = ActionTypes.READ, signType = SignType.CONFIG, apiType = ApiType.ADMIN_API)
    public Result<ConfigDetailInfo> getConfig(ConfigFormV3 configForm) throws NacosException {
        configForm.validate();
        // check namespaceId
        String namespaceId = NamespaceUtil.processNamespaceParameter(configForm.getNamespaceId());
        // check params
        String dataId = configForm.getDataId();
        String groupName = configForm.getGroupName();
        ConfigAllInfo configAllInfo =
            configInfoPersistService.findConfigAllInfo(dataId, groupName, namespaceId);
        if (Objects.isNull(configAllInfo)) {
            throw new NacosApiException(NacosException.NOT_FOUND, ErrorCode.RESOURCE_NOT_FOUND,
                "Config not exist, please publish Config first.");
        }
        // decrypted
        String encryptedDataKey = configAllInfo.getEncryptedDataKey();
        Pair<String, String> pair = EncryptionHandler.decryptHandler(dataId, encryptedDataKey,
            configAllInfo.getContent());
        configAllInfo.setContent(pair.getSecond());
        ConfigDetailInfo result = ResponseUtil.transferToConfigDetailInfo(configAllInfo);
        return Result.success(result);
    }
    
    /**
     * Publish configuration.
     */
    @Since("3.0.0")
    @PostMapping
    @TpsControl(pointName = "ConfigPublish")
    @Secured(action = ActionTypes.WRITE, signType = SignType.CONFIG, apiType = ApiType.ADMIN_API)

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Verify the resource identifiers (namespace, name, version) and that the resource exists before retrying.

When it happens

Trigger: Thrown at config/src/main/java/com/alibaba/nacos/config/server/controller/v3/ConfigControllerV3.java:172 when the library encounters an invalid state.

Common situations: Operating on a config that has never been published.


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