{"record":{"id":"3c667916641f41e8","repo":"multica-ai/multica","slug":"refusing-to-restart-invalid-server-url-q-w","errorCode":null,"errorMessage":"refusing to restart: invalid server URL %q: %w","messagePattern":"refusing to restart: invalid server URL %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_daemon.go","lineNumber":1175,"sourceCode":"// child's preflight, leaving no daemon at all (#5165). So probe the server\n// the daemon will talk to with the stored token (same whoami call as\n// `multica auth status`) and refuse to touch the running daemon on failure.\nfunc requireDaemonRestartPreflight(cmd *cobra.Command, profile string) error {\n\tif err := requireDaemonAuth(profile); err != nil {\n\t\treturn err\n\t}\n\tcfg, err := cli.LoadCLIConfigForProfile(profile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"load CLI config: %w\", err)\n\t}\n\n\trawURL := resolveDaemonServerURL(cmd, profile)\n\tif rawURL == \"\" {\n\t\trawURL = daemon.DefaultServerURL\n\t}\n\tbaseURL, err := daemon.NormalizeServerBaseURL(rawURL)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"refusing to restart: invalid server URL %q: %w\", rawURL, err)\n\t}\n\n\tloginHint := \"multica login\"\n\tif profile != \"\" {\n\t\tloginHint += \" --profile \" + profile\n\t}\n\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\tif err := cli.NewAPIClient(baseURL, \"\", cfg.Token).GetJSON(ctx, \"/api/me\", nil); err != nil {\n\t\tvar httpErr *cli.HTTPError\n\t\tif errors.As(err, &httpErr) {\n\t\t\tif httpErr.StatusCode == http.StatusUnauthorized {\n\t\t\t\treturn fmt.Errorf(\"refusing to restart: the server rejected your login token (it may have expired or been revoked); the running daemon was left untouched.\\nRun '%s' to sign in again, then rerun 'multica daemon restart'\", loginHint)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"refusing to restart: preflight check against %s failed (%w); the running daemon was left untouched\", baseURL, err)\n\t\t}\n\t\treturn fmt.Errorf(\"refusing to restart: cannot reach the Multica server at %s (%w); the running daemon was left untouched.\\nMake sure the server is running and reachable, then rerun 'multica daemon restart'\", baseURL, err)","sourceCodeStart":1157,"sourceCodeEnd":1193,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_daemon.go#L1157-L1193","documentation":"Error \"refusing to restart: invalid server URL %q: %w\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/cmd/multica/cmd_daemon.go:1175 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the configured server URL and retry the restart."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}