{"record":{"id":"927ce32d40034bbf","repo":"multica-ai/multica","slug":"invalid-multica-daemon-port-q-inside-a-daemon-man","errorCode":null,"errorMessage":"invalid MULTICA_DAEMON_PORT %q inside a daemon-managed task","messagePattern":"invalid MULTICA_DAEMON_PORT %q inside a daemon-managed task","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_daemon.go","lineNumber":1447,"sourceCode":"// whatever profile name the caller passes, so deriving the port there would let\n// a task report on a daemon that is not the one hosting it — and for a task\n// hosted by a named-profile daemon it would silently probe the default daemon\n// instead. A missing port fails closed rather than guessing.\nfunc daemonStatusHealthPort(cmd *cobra.Command) (int, error) {\n\tprofile := resolveProfile(cmd)\n\tif !inDaemonTaskIdentityContext() {\n\t\treturn healthPortForProfile(profile), nil\n\t}\n\tif profile != \"\" {\n\t\treturn 0, fmt.Errorf(\"daemon status --profile is not available inside a daemon-managed task\")\n\t}\n\traw := strings.TrimSpace(os.Getenv(\"MULTICA_DAEMON_PORT\"))\n\tif raw == \"\" {\n\t\treturn 0, fmt.Errorf(\"daemon status inside a daemon-managed task requires the daemon-injected MULTICA_DAEMON_PORT\")\n\t}\n\tport, err := strconv.Atoi(raw)\n\tif err != nil || port <= 0 {\n\t\treturn 0, fmt.Errorf(\"invalid MULTICA_DAEMON_PORT %q inside a daemon-managed task\", raw)\n\t}\n\treturn port, nil\n}\n\n// describeDaemonManager turns the daemon's launched_by tag into something a\n// user can act on. Unknown values are passed through rather than dropped: a\n// newer daemon naming a manager this CLI predates is still worth showing.\nfunc describeDaemonManager(launchedBy string) string {\n\tif launchedBy == \"desktop\" {\n\t\treturn \"Multica Desktop app (start and stop it from the app)\"\n\t}\n\treturn launchedBy\n}\n\n// printDaemonStatusReport renders a key/value summary of the daemon health\n// response. The value column is aligned to the widest label so the dynamic\n// \"Daemon [profile]\" row stays in step with the static rows below it.\nfunc printDaemonStatusReport(w io.Writer, label string, health map[string]any) {","sourceCodeStart":1429,"sourceCodeEnd":1465,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_daemon.go#L1429-L1465","documentation":"Error \"invalid MULTICA_DAEMON_PORT %q inside a daemon-managed task\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/cmd/multica/cmd_daemon.go:1447 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the MULTICA_DAEMON_PORT value to a valid port number."],"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"}