{"record":{"id":"575130ff8f12b5a2","repo":"zed-industries/zed","slug":"usage-collab-version-serve-api-collab-all","errorCode":null,"errorMessage":"usage: collab <version | serve <api|collab|all>>","messagePattern":"usage: collab <version \\| serve <api\\|collab\\|all>>","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/collab/src/main.rs","lineNumber":52,"sourceCode":"    if let Err(error) = env::load_dotenv() {\n        eprintln!(\n            \"error loading .env.toml (this is expected in production): {}\",\n            error\n        );\n    }\n\n    let mut args = args().skip(1);\n    match args.next().as_deref() {\n        Some(\"version\") => {\n            println!(\"collab v{} ({})\", VERSION, REVISION.unwrap_or(\"unknown\"));\n        }\n        Some(\"serve\") => {\n            let mode = match args.next().as_deref() {\n                Some(\"collab\") => ServiceMode::Collab,\n                Some(\"api\") => ServiceMode::Api,\n                Some(\"all\") => ServiceMode::All,\n                _ => {\n                    return Err(anyhow!(\"usage: collab <version | serve <api|collab|all>>\"))?;\n                }\n            };\n\n            let config = envy::from_env::<Config>().expect(\"error loading config\");\n            init_tracing(&config);\n            init_panic_hook();\n\n            let mut app = Router::new()\n                .route(\"/\", get(handle_root))\n                .route(\"/healthz\", get(handle_liveness_probe))\n                .layer(Extension(mode));\n\n            let listener = TcpListener::bind(format!(\"0.0.0.0:{}\", config.http_port))\n                .expect(\"failed to bind TCP listener\");\n\n            let mut on_shutdown = None;\n\n            if mode.is_collab() || mode.is_api() {","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/collab/src/main.rs#L34-L70","documentation":"Returned by the collab binary's argument parser when the first argument is 'serve' but the second argument is missing or none of api|collab|all. This variant of the usage string is emitted before the service mode router is built, so nothing starts. It is pure command-line misuse, not a runtime failure.","triggerScenarios":"Running 'collab serve' with no mode; 'collab serve web', 'collab serve llm' on an older build where llm is not accepted; scripts or container entrypoints that pass an empty or misspelled mode argument.","commonSituations":"Deployments copying docs from a newer/older zed version whose accepted modes differ (see the sibling usage string that does include llm); CI scripts with unquoted variables producing 'serve ' with no mode; typos in systemd/Docker command lines.","solutions":["Use one of the accepted modes for this build: collab serve api, collab serve collab, or collab serve all","Check collab version to confirm which modes this build supports","Fix the entrypoint/script so the mode argument is always present and quoted"],"exampleFix":"# before\ncollab serve\n\n# after\ncollab serve all","handlingStrategy":"validation","validationCode":"# Validate the serve mode before launching.\nMODE=\"${1:?usage: collab serve <api|collab|all>}\"\ncase \"$MODE\" in api|collab|all) ;; *) echo \"invalid mode: $MODE\" >&2; exit 2 ;; esac\nexec collab serve \"$MODE\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin the collab binary version and script arguments together in deployment config","Fail fast in entrypoint scripts with an explicit usage check before exec","Run 'collab version' in CI to assert the expected subcommand set"],"tags":["cli","usage","collab-server","deployment"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}