{"record":{"id":"c54d0b2be98524cd","repo":"alibaba/nacos","slug":"20002-c54d0b","errorCode":"20002","errorMessage":"Plugin configuration is required","messagePattern":"Plugin configuration is required","errorType":"http","errorClass":"NacosApiException","httpStatus":400,"severity":"warning","filePath":"core/src/main/java/com/alibaba/nacos/core/controller/v3/PluginControllerV3.java","lineNumber":161,"sourceCode":"     * @param configJson plugin configuration as JSON string\n     * @param localOnly  whether only apply to local node\n     * @return success result\n     */\n    @Since(\"3.2.0\")\n    @PutMapping(\"/config\")\n    @Secured(resource = Commons.NACOS_ADMIN_CORE_CONTEXT_V3\n        + \"/plugin\", action = ActionTypes.WRITE, signType = SignType.CONSOLE,\n        apiType = ApiType.ADMIN_API)\n    public Result<String> updatePluginConfig(@RequestParam(\"pluginType\") String pluginType,\n        @RequestParam(\"pluginName\") String pluginName, @RequestParam(\"config\") String configJson,\n        @RequestParam(value = \"localOnly\", defaultValue = \"false\") boolean localOnly)\n        throws NacosApiException {\n        validatePluginIdentifier(pluginType, pluginName);\n        Map<String, String> config =\n            JacksonUtils.toObj(configJson, new TypeReference<Map<String, String>>() {\n            });\n        if (config == null) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(),\n                ErrorCode.PARAMETER_VALIDATE_ERROR,\n                \"Plugin configuration is required\");\n        }\n        String pluginId = pluginType + \":\" + pluginName;\n        unifiedPluginManager.updatePluginConfig(pluginId, config, localOnly);\n        return Result.success(\"Plugin configuration updated successfully\");\n    }\n    \n    private void validatePluginIdentifier(String pluginType, String pluginName)\n        throws NacosApiException {\n        if (StringUtils.isBlank(pluginType) || StringUtils.isBlank(pluginName)) {\n            throw new NacosApiException(HttpStatus.BAD_REQUEST.value(),\n                ErrorCode.PARAMETER_VALIDATE_ERROR,\n                \"Plugin type and name are required\");\n        }\n    }\n    \n    private PluginInfoVO convertToVO(PluginInfo pluginInfo) {","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/core/src/main/java/com/alibaba/nacos/core/controller/v3/PluginControllerV3.java#L143-L179","documentation":"Thrown by PUT /v3/admin/core/plugin/config when the 'config' request param (a JSON string) deserializes to a null Map<String,String>. NacosApiException ErrorCode.PARAMETER_VALIDATE_ERROR (code 20002), HTTP 400. Note: JacksonUtils.toObj of an empty/invalid string would more likely throw earlier; this null check catches the literal JSON 'null' case.","triggerScenarios":"Passing config=null (the JSON token null) as the 'config' request parameter. validatePluginIdentifier runs first, so pluginType/pluginName must already be non-blank to reach this check.","commonSituations":"Console sending config='null' string; a script defaulting the config to the JSON null literal; a frontend bug that serializes an absent config as null.","solutions":["Pass a real JSON object as the config param, e.g. config={\"key\":\"value\"}.","If no config keys are needed, pass an empty object config={} rather than null.","Fix the client so it never serializes the config field as the JSON null literal."],"exampleFix":"// before\nPUT /v3/admin/core/plugin/config?pluginType=auth&pluginName=xxx&config=null\n\n// after\nPUT /v3/admin/core/plugin/config?pluginType=auth&pluginName=xxx&config=%7B%7D","handlingStrategy":"validation","validationCode":"if (configJson == null || \"null\".equals(configJson.trim())) {\n    throw new IllegalArgumentException(\"config must be a JSON object\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    client.updatePluginConfig(type, name, configJson, localOnly);\n} catch (NacosApiException e) {\n    if (e.getErrCode() == ErrorCode.PARAMETER_VALIDATE_ERROR.getCode()) { /* bad config */ }\n}","preventionTips":["Send a real JSON object for config (use {} when empty).","Never serialize the config as the JSON null literal."],"tags":["plugin","validation","api","bad-request","configuration"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}