{"record":{"id":"9e3191798431fa64","repo":"apache/beam","slug":"unknown-command-s-possible-values-are","errorCode":null,"errorMessage":"Unknown command \"%s\". Possible values are {}","messagePattern":"Unknown command \"(.+?)\"\\. Possible values are (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/transform-service/launcher/src/main/java/org/apache/beam/sdk/transformservice/launcher/TransformServiceLauncher.java","lineNumber":410,"sourceCode":"    String pythonRequirementsFile =\n        !config.pythonRequirementsFile.isEmpty() ? config.pythonRequirementsFile : null;\n\n    TransformServiceLauncher service =\n        TransformServiceLauncher.forProject(\n            config.projectName, config.port, pythonRequirementsFile);\n    if (!config.beamVersion.isEmpty()) {\n      service.setBeamVersion(config.beamVersion);\n    }\n\n    if (config.command.equals(\"up\")) {\n      service.start();\n      service.waitTillUp(-1);\n    } else if (config.command.equals(\"down\")) {\n      service.shutdown();\n    } else if (config.command.equals(\"ps\")) {\n      service.status();\n    } else {\n      throw new IllegalArgumentException(\n          String.format(\"Unknown command \\\"%s\\\". Possible values are {}\", config.command));\n    }\n  }\n}\n","sourceCodeStart":392,"sourceCodeEnd":415,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/transform-service/launcher/src/main/java/org/apache/beam/sdk/transformservice/launcher/TransformServiceLauncher.java#L392-L415","documentation":"After config validation, main() dispatches on config.command against known values (e.g. \"up\", \"down\", \"ps\"). Any other non-empty command string falls through to this IllegalArgumentException, formatted with the offending command. Note the message uses String.format for %s but leaves a literal {} for the valid values list.","triggerScenarios":"Invoking the launcher main with a --command value that is not one of the recognized commands (anything other than \"up\", \"down\", \"ps\", and the other handled command strings).","commonSituations":"Typos like --command=start or --command=deploy; passing a command from an older launcher version that was renamed; case mistakes (\"UP\" vs \"up\").","solutions":["Use one of the supported commands: up, down, ps (see COMMAND_POSSIBLE_VALUES in the launcher source).","Fix casing/typos — commands are matched with exact equals().","Check the launcher help text for the current command list in your Beam version."],"exampleFix":"// before\n--command=start\n\n// after\n--command=up","handlingStrategy":"validation","validationCode":"Set<String> valid = Set.of(\"up\", \"down\", \"ps\");\nif (!valid.contains(command))\n  throw new IllegalArgumentException(\"Unknown command: \" + command + \"; valid: \" + valid);","typeGuard":null,"tryCatchPattern":"try {\n  TransformServiceLauncher.main(rawArgs);\n} catch (IllegalArgumentException e) {\n  System.err.println(e.getMessage() + \" — see launcher help for valid commands\");\n}","preventionTips":["Copy command names from the launcher docs/help verbatim; they are case-sensitive.","Centralize launcher invocations in a wrapper script with a whitelist of commands.","Re-check command names after upgrading Beam versions."],"tags":["java","cli","invalid-argument","validation"],"backgroundTag":"invalid-cli-argument","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"}