{"record":{"id":"669d75a71ba61458","repo":"multica-ai/multica","slug":"multica-server-url-must-use-ws-wss-http-or-http","errorCode":null,"errorMessage":"MULTICA_SERVER_URL must use ws, wss, http, or https","messagePattern":"MULTICA_SERVER_URL must use ws, wss, http, or https","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/daemon/config.go","lineNumber":588,"sourceCode":"\t\treturn false\n\t}\n\treturn strings.EqualFold(u.Hostname(), officialCloudHost)\n}\n\n// NormalizeServerBaseURL converts a WebSocket or HTTP URL to a base HTTP URL.\nfunc NormalizeServerBaseURL(raw string) (string, error) {\n\tu, err := url.Parse(strings.TrimSpace(raw))\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"invalid MULTICA_SERVER_URL: %w\", err)\n\t}\n\tswitch u.Scheme {\n\tcase \"ws\":\n\t\tu.Scheme = \"http\"\n\tcase \"wss\":\n\t\tu.Scheme = \"https\"\n\tcase \"http\", \"https\":\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"MULTICA_SERVER_URL must use ws, wss, http, or https\")\n\t}\n\tif u.Path == \"/ws\" {\n\t\tu.Path = \"\"\n\t}\n\tu.RawPath = \"\"\n\tu.RawQuery = \"\"\n\tu.Fragment = \"\"\n\treturn strings.TrimRight(u.String(), \"/\"), nil\n}\n\n// TaskWorkspacesRootEnv carries the workspaces root of the daemon that owns a\n// managed task into that task's environment. Task-mode `daemon disk-usage`\n// reads this and nothing else: ResolveWorkspacesRoot derives its default from\n// $HOME and the --profile name, so a task hosted by a named-profile daemon\n// would otherwise scan the default root and silently report the wrong tree.\nconst TaskWorkspacesRootEnv = \"MULTICA_TASK_WORKSPACES_ROOT\"\n\n// ResolveWorkspacesRoot returns the absolute path that the daemon and CLI","sourceCodeStart":570,"sourceCodeEnd":606,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/daemon/config.go#L570-L606","documentation":"NormalizeServerBaseURL accepts only ws, wss, http, and https schemes; anything else (ftp, unix, file, empty scheme like 'localhost:8080' or 'example.com') reaches the default branch of the switch and returns this error. The normalizer's job is to convert a WebSocket URL into its HTTP base, so the scheme whitelist is the contract.","triggerScenarios":"Setting MULTICA_SERVER_URL without a scheme ('multica.example.com'), with a typo ('http//host' or 'htps://host'), or with an unsupported scheme ('unix:///run/multica.sock', 'ftp://...').","commonSituations":"Users writing hostnames without scheme, trailing-slash/typo mistakes, or attempts to point the daemon at a unix socket / custom transport that the client does not support.","solutions":["Use one of the four accepted schemes, e.g. MULTICA_SERVER_URL=https://multica.example.com or wss://multica.example.com","If you typed a bare host, add the scheme — 'host' alone is interpreted as a path-less relative URL with empty scheme","Check for typos in the scheme (htps, htp, ws s) when the value was hand-edited"],"exampleFix":"# before (env)\nexport MULTICA_SERVER_URL=multica.example.com\n# after\nexport MULTICA_SERVER_URL=https://multica.example.com","handlingStrategy":"validation","validationCode":"u, err := url.Parse(strings.TrimSpace(raw))\nif err != nil {\n    return fmt.Errorf(\"invalid MULTICA_SERVER_URL: %w\", err)\n}\nswitch u.Scheme {\ncase \"ws\", \"wss\", \"http\", \"https\":\n    // ok\ndefault:\n    return fmt.Errorf(\"MULTICA_SERVER_URL %q must start with ws://, wss://, http://, or https://\", raw)\n}","typeGuard":null,"tryCatchPattern":"Treat as a configuration error at startup: catch, show the accepted schemes plus the offending value, and exit before the daemon connects.","preventionTips":["Always write the scheme explicitly in config examples","Validate the scheme in config-lint tooling","Prefer https/wss in all documented snippets so users copy the right shape"],"tags":["daemon","config","url-scheme","env-var"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}