multica-ai/multica · error
start or restart daemon: %w
Error message
start or restart daemon: %w
What it means
Returned by the cloud setup flow when runDaemonAfterSetup fails to start or restart the daemon after successful config save and login. The daemon reads server URL and token only at startup, so despite the config being correct, the machine is not yet connected until a daemon runs. The wrapped error carries the daemon command's failure (launch error, health check timeout, or active-task refusal).
Source
Thrown at server/cmd/multica/cmd_setup.go:176
}
if err := cli.SaveCLIConfigForProfile(cfg, profile); err != nil {
return fmt.Errorf("save config: %w", err)
}
fmt.Fprintln(os.Stderr, "Configured for Multica Cloud (https://multica.ai).")
fmt.Fprintf(os.Stderr, " server_url: %s\n", cfg.ServerURL)
fmt.Fprintf(os.Stderr, " app_url: %s\n", cfg.AppURL)
printConfigLocation(profile)
// Authenticate.
fmt.Fprintln(os.Stderr, "")
if err := runLogin(cmd, args); err != nil {
return err
}
if err := runDaemonAfterSetup(cmd, args); err != nil {
return fmt.Errorf("start or restart daemon: %w", err)
}
fmt.Fprintln(os.Stderr, "\n✓ Setup complete! Your machine is now connected to Multica.")
return nil
}
func runSetupSelfHost(cmd *cobra.Command, args []string) error {
if err := requireHumanLocalCommand("setup"); err != nil {
return err
}
profile := resolveProfile(cmd)
// Resolve the target URLs before confirming the overwrite so the prompt can
// show the incoming values ("old -> new"), making it clear the passed flags
// were received.
//
// Honor MULTICA_SERVER_URL / MULTICA_APP_URL when the matching flag is not
// set — consistent with the rest of the CLI (resolveServerURL) and with theView on GitHub (pinned to 2c0912b6ec)
Solutions
- Check the wrapped error: if it is the active-tasks message, wait for work to finish and run the suggested `multica daemon restart --profile <P>`.
- Run `multica daemon status --profile <P>` to see whether a stale daemon is running; stop it.
- Verify the daemon executable resolves: `which multica` and any runtime-profile path override.
- Retry `multica daemon start --profile <P>` manually to see the daemon's own startup error, then re-run setup or just the daemon start.
Example fix
# before: stale daemon holding the socket multica daemon stop --profile default || true # after multica daemon start --profile default
Defensive patterns
Strategy: retry
Validate before calling
# Pre-flight: confirm no stale daemon and the binary resolves multica daemon status --profile "$P" 2>/dev/null command -v multica >/dev/null || echo "multica not on PATH"
Try / catch
On 'start or restart daemon:' failure, branch: if the wrapped message contains 'active' tasks → schedule retry after drain; otherwise stop stale daemons and retry once with diagnostics captured.
Prevention
- Stop daemons before deployment-switching setups.
- Keep the daemon binary path stable or update runtime profile overrides deliberately.
- In scripts, follow setup with an explicit `multica daemon status` assertion.
When it happens
Trigger: `multica setup` completes login, then the daemon binary cannot be spawned, the daemon crashes on startup, or the restart is refused because the running daemon has active tasks (see the sibling error for that case).
Common situations: Daemon socket/port already occupied by a stale process; daemon binary missing from PATH or the overridden runtime profile path; systemd user service conflicts; active tasks running under the old config.
Related errors
- daemon has %d active %s; setup saved the new configuration b
- agent execution context requires MULTICA_TOKEN to be a task-
- daemon-managed task requires a task-local Multica config roo
- %s is not available inside a daemon-managed task%s
- %s is not available inside a daemon-managed task
AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15).
Data as JSON: /api/errors/a148f1168ffcd45c.
Report an issue: GitHub.