{"record":{"id":"8036c6c696b8eb8b","repo":"multica-ai/multica","slug":"app-url-is-required-when-server-url-points-at","errorCode":null,"errorMessage":"--app-url is required when --server-url points at a remote host (e.g. --app-url https://app.internal.co)","messagePattern":"--app-url is required when --server-url points at a remote host \\(e\\.g\\. --app-url https://app\\.internal\\.co\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_setup.go","lineNumber":214,"sourceCode":"\t// Before this, setup self-host read only the flags, so a self-hoster who set\n\t// MULTICA_SERVER_URL still got the localhost default and an \"unreachable\"\n\t// error (GitHub #3912).\n\texisting, _ := cli.LoadCLIConfigForProfile(profile)\n\tserverURL, userProvidedServerURL := resolveSelfHostServerURL(cmd, existing)\n\tappURL := resolveSelfHostAppURL(cmd, existing)\n\tfrontendPort, _ := cmd.Flags().GetInt(\"frontend-port\")\n\n\tif appURL == \"\" {\n\t\tif userProvidedServerURL && !serverHostIsLocal(serverURL) {\n\t\t\t// We can't guess the frontend URL for a remote server: api.x.co\n\t\t\t// and app.x.co, or an https-fronted deployment, would silently\n\t\t\t// produce a broken login URL. Ask the user instead.\n\t\t\tentered, err := promptAppURL(serverURL)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif entered == \"\" {\n\t\t\t\treturn fmt.Errorf(\"--app-url is required when --server-url points at a remote host (e.g. --app-url https://app.internal.co)\")\n\t\t\t}\n\t\t\tappURL = entered\n\t\t} else {\n\t\t\tappURL = fmt.Sprintf(\"http://localhost:%d\", frontendPort)\n\t\t}\n\t}\n\n\tok, err := confirmOverwrite(profile, serverURL, appURL)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !ok {\n\t\treturn nil\n\t}\n\n\t// Probe before persisting anything. A failed setup must never overwrite a\n\t// working config or wipe the saved token: persistSelfHostConfigIfReachable\n\t// writes only when the server answers, so an unreachable host leaves the","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_setup.go#L196-L232","documentation":"Validation error from `multica setup self-host`: --app-url was omitted, --server-url was user-provided and points at a remote (non-local) host, and the interactive prompt either could not be shown or the user entered nothing. The CLI refuses to guess the frontend URL because api.x.co vs app.x.co or an https front-end cannot be derived reliably; a wrong guess would produce a broken login URL.","triggerScenarios":"Running `multica setup self-host --server-url https://api.internal.co` without --app-url in a non-interactive terminal (CI, pipe, script) where promptAppURL returns an empty string, or answering the prompt with empty input.","commonSituations":"Automating setup in a provisioning script without passing --app-url; SSH sessions without a TTY; users assuming the app URL is derived from the server URL like in earlier versions.","solutions":["Pass the frontend URL explicitly: `multica setup self-host --server-url https://api.internal.co --app-url https://app.internal.co`.","If running interactively, re-run the command and enter the app URL at the prompt instead of leaving it blank.","For scripted runs, always include --app-url because the prompt is not available without a TTY.","Double-check the value answers at the browser-facing origin (where the login page opens), not the API origin."],"exampleFix":"# before\nmultica setup self-host --server-url https://api.internal.co\n# after\nmultica setup self-host --server-url https://api.internal.co --app-url https://app.internal.co","handlingStrategy":"validation","validationCode":"# Shell: refuse to run remote self-host setup without an app URL\nserver_host=\"$(printf '%s' \"$SERVER_URL\" | sed -E 's#https?://([^/:]+).*#\\1#')\"\ncase \"$server_host\" in localhost|127.*|::1) ;; *) [ -n \"$APP_URL\" ] || { echo \"APP_URL required for remote server\"; exit 2; } ;; esac","typeGuard":null,"tryCatchPattern":"Detect the '--app-url is required' message in the command's stderr and fail the automation job early with a clear missing-parameter error rather than retrying.","preventionTips":["Always pass --app-url when scripting setup against non-localhost servers.","Treat server URL (API origin) and app URL (browser origin) as separate required inputs in remote deployments.","Remember the interactive prompt needs a TTY; pipes/CI never see it."],"tags":["go","cli","setup","validation","self-hosted"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}