multica-ai/multica · error

refusing to restart: invalid server URL %q: %w

Error message

refusing to restart: invalid server URL %q: %w

What it means

Error "refusing to restart: invalid server URL %q: %w" thrown in multica-ai/multica.

Source

Thrown at server/cmd/multica/cmd_daemon.go:1175

// child's preflight, leaving no daemon at all (#5165). So probe the server
// the daemon will talk to with the stored token (same whoami call as
// `multica auth status`) and refuse to touch the running daemon on failure.
func requireDaemonRestartPreflight(cmd *cobra.Command, profile string) error {
	if err := requireDaemonAuth(profile); err != nil {
		return err
	}
	cfg, err := cli.LoadCLIConfigForProfile(profile)
	if err != nil {
		return fmt.Errorf("load CLI config: %w", err)
	}

	rawURL := resolveDaemonServerURL(cmd, profile)
	if rawURL == "" {
		rawURL = daemon.DefaultServerURL
	}
	baseURL, err := daemon.NormalizeServerBaseURL(rawURL)
	if err != nil {
		return fmt.Errorf("refusing to restart: invalid server URL %q: %w", rawURL, err)
	}

	loginHint := "multica login"
	if profile != "" {
		loginHint += " --profile " + profile
	}

	ctx, cancel := cli.APIContext(context.Background())
	defer cancel()
	if err := cli.NewAPIClient(baseURL, "", cfg.Token).GetJSON(ctx, "/api/me", nil); err != nil {
		var httpErr *cli.HTTPError
		if errors.As(err, &httpErr) {
			if httpErr.StatusCode == http.StatusUnauthorized {
				return 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)
			}
			return fmt.Errorf("refusing to restart: preflight check against %s failed (%w); the running daemon was left untouched", baseURL, err)
		}
		return 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)

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Fix the configured server URL and retry the restart.

When it happens

Trigger: Thrown at server/cmd/multica/cmd_daemon.go:1175 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/3c667916641f41e8. Report an issue: GitHub.