{"record":{"id":"ec658f4bf8ea8f56","repo":"zed-industries/zed","slug":"usage-collab-version-migrate-seed-serve-a","errorCode":null,"errorMessage":"usage: collab <version | migrate | seed | serve <api|collab|llm|all>>","messagePattern":"usage: collab <version \\| migrate \\| seed \\| serve <api\\|collab\\|llm\\|all>>","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/collab/src/main.rs","lineNumber":178,"sourceCode":"                futures::future::select(ctrl_break, ctrl_c).await;\n            };\n\n            axum::Server::from_tcp(listener)\n                .map_err(|e| anyhow!(e))?\n                .serve(app.into_make_service_with_connect_info::<SocketAddr>())\n                .with_graceful_shutdown(async move {\n                    signal.await;\n                    tracing::info!(\"Received interrupt signal\");\n\n                    if let Some(on_shutdown) = on_shutdown {\n                        on_shutdown();\n                    }\n                })\n                .await\n                .map_err(|e| anyhow!(e))?;\n        }\n        _ => {\n            Err(anyhow!(\n                \"usage: collab <version | migrate | seed | serve <api|collab|llm|all>>\"\n            ))?;\n        }\n    }\n    Ok(())\n}\n\nasync fn setup_app_database(config: &Config) -> Result<()> {\n    let db_options = db::ConnectOptions::new(config.database_url.clone());\n    let mut db = Database::new(db_options).await?;\n\n    db.initialize_notification_kinds().await?;\n\n    Ok(())\n}\n\nasync fn handle_root(Extension(mode): Extension<ServiceMode>) -> String {\n    format!(\"zed:{mode} v{VERSION} ({})\", REVISION.unwrap_or(\"unknown\"))","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/collab/src/main.rs#L160-L196","documentation":"Returned by the collab binary's main argument dispatch when the first argument matches none of version | migrate | seed | serve. This is the top-level usage string; note it advertises 'llm' as a serve mode, which can differ from the serve-level usage message in the same file — a sign that accepted subcommands vary across versions of the binary.","triggerScenarios":"Running 'collab foo', 'collab run', or an older subcommand that was removed; an empty first argument from an unquoted shell variable; invoking the binary through a wrapper that prepends unexpected words.","commonSituations":"Upgrade/downgrade mismatches between the binary and deployment scripts; wrappers that inject flags before the subcommand; documentation drift between versions.","solutions":["Run one of: collab version, collab migrate, collab seed, collab serve <api|collab|llm|all>","Run 'collab version' first to confirm the binary and its expected subcommand set","Inspect the wrapper script/systemd unit/Dockerfile CMD for stray or missing arguments"],"exampleFix":"# before\ncollab start\n\n# after\ncollab serve all","handlingStrategy":"validation","validationCode":"# Validate subcommand in wrappers before invoking the binary.\nSUB=\"${1:?usage: collab <version|migrate|seed|serve> }\"\ncase \"$SUB\" in version|migrate|seed|serve) ;; *) echo \"unknown subcommand: $SUB\" >&2; exit 2 ;; esac\nexec collab \"$SUB\" \"${@:2}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Quote shell variables in systemd/Docker CMD so empty args never reach the binary","Check 'collab version' output when deploys change behavior","Keep deployment scripts in the same repo/PR as binary version bumps"],"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"}