{"record":{"id":"ee3f375306671b6a","repo":"sgl-project/sglang","slug":"sidecar-must-not-be-empty","errorCode":null,"errorMessage":"--sidecar must not be empty.","messagePattern":"--sidecar must not be empty\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":4522,"sourceCode":"            if cfg.grpc_worker_threads is not None and cfg.grpc_worker_threads < 1:\n                raise ValueError(\n                    \"SGLANG_GRPC_WORKER_THREADS \"\n                    f\"({cfg.grpc_worker_threads}) must be >= 1\"\n                )\n\n        # Native gRPC is incompatible with launch paths it doesn't wire into.\n        # Legacy takes precedence over grpc_port, keeping re-runs idempotent.\n        native_grpc = cfg.grpc_port is not None and not legacy_grpc\n        if cfg.sidecar_args is not None:\n            if cfg.sidecar is None:\n                raise ValueError(\"--sidecar-args requires --sidecar.\")\n            if not isinstance(cfg.sidecar_args, list) or not all(\n                isinstance(arg, str) for arg in cfg.sidecar_args\n            ):\n                raise ValueError(\"--sidecar-args must be a JSON array of strings.\")\n        if cfg.sidecar is not None:\n            if not cfg.sidecar.strip():\n                raise ValueError(\"--sidecar must not be empty.\")\n            if legacy_grpc:\n                raise ValueError(\n                    \"--sidecar requires SGLang's native gRPC server; \"\n                    \"it cannot be combined with --smg-grpc-mode/--grpc-mode.\"\n                )\n            if cfg.grpc_port is None:\n                raise ValueError(\"--sidecar requires --grpc-port or SGLANG_GRPC_PORT.\")\n        if native_grpc:\n            if cfg.use_ray:\n                raise ValueError(\n                    \"--grpc-port is not supported with --use-ray: the Ray \"\n                    \"serve launch path does not start the native gRPC server.\"\n                )\n            if cfg.encoder_only:\n                raise ValueError(\n                    \"--grpc-port is not supported with --encoder-only: \"\n                    \"encoder disaggregation uses its own server.\"\n                )","sourceCodeStart":4504,"sourceCodeEnd":4540,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L4504-L4540","documentation":"--sidecar accepts a command string to run alongside SGLang's native gRPC server; an empty or whitespace-only string is rejected because there is no command to execute.","triggerScenarios":"Passing --sidecar \"\" or --sidecar \"   \" (e.g. from an unset shell variable like --sidecar \"$SIDECAR_CMD\").","commonSituations":"Templated launch scripts where the sidecar variable is empty in some environments; disabling the sidecar by setting it to an empty string instead of removing the flag.","solutions":["Remove the --sidecar flag entirely if no sidecar is wanted","Set a real command: --sidecar \"python sidecar.py\"","Check that the shell variable used for --sidecar is non-empty before launching"],"exampleFix":"# before\n--sidecar \"\"\n# after\n--sidecar \"python sidecar.py\"","handlingStrategy":"validation","validationCode":"if args.get(\"sidecar\") is not None and not args[\"sidecar\"].strip():\n    args.pop(\"sidecar\")  # or fail fast with a clear message","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fail fast in launch templates when templated variables are empty: : \"${SIDECAR_CMD:?SIDECAR_CMD required}\"","Remove flags rather than setting them to empty strings"],"tags":["grpc","sidecar","config-validation"],"backgroundTag":"empty-required-option","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}