{"record":{"id":"f00bf02cefcfe177","repo":"apache/dolphinscheduler","slug":"environment-config-is-null","errorCode":"ENVIRONMENT_CONFIG_IS_NULL","errorMessage":"ENVIRONMENT_CONFIG_IS_NULL","messagePattern":"ENVIRONMENT_CONFIG_IS_NULL","errorType":"error_code","errorClass":"ServiceException","httpStatus":null,"severity":"warning","filePath":"dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java","lineNumber":426,"sourceCode":"        for (String workerGroup : deleteKeySet) {\n            List<TaskDefinition> taskDefinitionList =\n                    taskDefinitionDao.queryByEnvironmentCodeAndWorkerGroup(environmentCode, workerGroup);\n\n            if (Objects.nonNull(taskDefinitionList) && taskDefinitionList.size() != 0) {\n                Set<String> collect =\n                        taskDefinitionList.stream().map(TaskDefinition::getName).collect(Collectors.toSet());\n                throw new ServiceException(Status.UPDATE_ENVIRONMENT_WORKER_GROUP_RELATION_ERROR, workerGroup,\n                        environmentName, collect);\n            }\n        }\n    }\n\n    protected void checkParams(String name, String config, String workerGroups) {\n        if (StringUtils.isEmpty(name)) {\n            throw new ServiceException(Status.ENVIRONMENT_NAME_IS_NULL);\n        }\n        if (StringUtils.isEmpty(config)) {\n            throw new ServiceException(Status.ENVIRONMENT_CONFIG_IS_NULL);\n        }\n        if (StringUtils.isNotEmpty(workerGroups)) {\n            try {\n                JSONUtils.parseObject(workerGroups, new TypeReference<List<String>>() {\n                });\n            } catch (IllegalArgumentException e) {\n                throw new ServiceException(Status.ENVIRONMENT_WORKER_GROUPS_IS_INVALID);\n            }\n        }\n    }\n\n}\n","sourceCodeStart":408,"sourceCodeEnd":439,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java#L408-L439","documentation":"Thrown by checkParams (called from createEnvironment/updateEnvironmentByCode) when the environment config is null or blank. The config field holds the environment's key=value settings; without it the environment is unusable, so validation fails with ENVIRONMENT_CONFIG_IS_NULL.","triggerScenarios":"createEnvironment or updateEnvironmentByCode called with config == null or \"\".","commonSituations":"Users saving an environment without pasting any config; import tooling producing empty config fields; frontend sending config as empty string after clearing the editor.","solutions":["Supply a valid config string (e.g. key=value pairs) with the request","Ensure the UI/config editor content is serialized into the request body","For intentionally empty configs, use a placeholder like a comment line if the schema requires non-empty","Check import/export tooling for dropped config fields"],"exampleFix":"// before\ncreateEnvironment(loginUser, \"prod\", desc, \"\", groups); // throws\n// after\ncreateEnvironment(loginUser, \"prod\", desc, \"JAVA_HOME=/usr/lib/jvm\", groups);","handlingStrategy":"validation","validationCode":"if (config == null || config.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"environment config is required\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    environmentService.createEnvironment(loginUser, name, desc, config, workerGroups);\n} catch (ServiceException e) {\n    if (e.getCode() == Status.ENVIRONMENT_CONFIG_IS_NULL.getCode()) {\n        // supply config and retry\n    } else { throw e; }\n}","preventionTips":["Template environment configs so config is always populated","Validate the UI editor is non-empty before submit","Check export/import round-trips preserve the config field"],"tags":["dolphinscheduler","environment","missing-parameter","config"],"backgroundTag":"missing-required-config-field","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}