{"record":{"id":"9a9bad4a2758bbb2","repo":"apache/beam","slug":"process-environment-variable-s-is-not-assigned-a-value","errorCode":null,"errorMessage":"Process environment variable '%s' is not assigned a value.","messagePattern":"Process environment variable '(.+?)' is not assigned a value\\.","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/Environments.java","lineNumber":608,"sourceCode":"\n  private static String getDockerContainerImage(PortablePipelineOptions options) {\n    String environmentConfig = options.getDefaultEnvironmentConfig();\n    String environmentOption =\n        PortablePipelineOptions.getEnvironmentOption(options, dockerContainerImageOption);\n    if (environmentConfig != null && !environmentConfig.isEmpty()) {\n      return environmentConfig;\n    }\n    return environmentOption;\n  }\n\n  private static Map<String, String> getProcessVariables(PortablePipelineOptions options) {\n    ImmutableMap.Builder<String, String> variables = ImmutableMap.builder();\n    String assignments =\n        PortablePipelineOptions.getEnvironmentOption(options, processVariablesOption);\n    for (String assignment : assignments.split(\",\", -1)) {\n      String[] tokens = assignment.split(\"=\", -1);\n      if (tokens.length == 1) {\n        throw new IllegalArgumentException(\n            String.format(\"Process environment variable '%s' is not assigned a value.\", tokens[0]));\n      }\n      variables.put(tokens[0], tokens[1]);\n    }\n    return variables.build();\n  }\n\n  private static void verifyEnvironmentOptions(PortablePipelineOptions options) {\n    if (options.getEnvironmentOptions() == null || options.getEnvironmentOptions().isEmpty()) {\n      return;\n    }\n    if (!Strings.isNullOrEmpty(options.getDefaultEnvironmentConfig())) {\n      throw new IllegalArgumentException(\n          \"Pipeline options defaultEnvironmentConfig and environmentOptions are mutually exclusive.\");\n    }\n    Set<String> allowedOptions =\n        allowedEnvironmentOptions.getOrDefault(\n            options.getDefaultEnvironmentType(), ImmutableSet.of());","sourceCodeStart":590,"sourceCodeEnd":626,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/Environments.java#L590-L626","documentation":"getProcessVariables parses the process_variables environment option, which must be a comma-separated list of KEY=VALUE assignments. An entry without '=' (only one token) throws IllegalArgumentException naming the variable name. Every process variable must have an explicit value.","triggerScenarios":"Setting environmentOptions with an entry like 'process_variables=FOO,BAR=1' where FOO has no '=', or a trailing/empty segment that splits to a single token.","commonSituations":"Typos omitting '='; assuming empty values can be written as bare keys; shell quoting stripping characters from the option.","solutions":["Give every variable a value with '=', even if empty: 'FOO=' not 'FOO'","Check the process_variables option string for missing '=' and stray commas","Quote the option value in your shell/CLI so characters are not mangled"],"exampleFix":"// before\n--environmentOption=process_variables=LOG_LEVEL,DEBUG=true\n// after\n--environmentOption=process_variables=LOG_LEVEL=info,DEBUG=true","handlingStrategy":"validation","validationCode":"for (String opt : options.getEnvironmentOptions()) {\n  if (opt.startsWith(\"process_variables=\")) {\n    for (String a : opt.substring(\"process_variables=\".length()).split(\",\", -1)) {\n      if (!a.contains(\"=\")) throw new IllegalArgumentException(\"variable without '=': \" + a);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try { env = Environments.createOrGetDefaultEnvironment(options); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"is not assigned a value\")) { /* fix the variables list */ } }","preventionTips":["Always write KEY=VALUE, using KEY= for empty values","Avoid bare names and stray commas in process_variables","Quote option values in shells"],"tags":["java","apache-beam","environment-variables","config-parsing"],"backgroundTag":"invalid-argument-format","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}