{"record":{"id":"391fba205a42d48b","repo":"multica-ai/multica","slug":"repo-is-not-configured-for-this-workspace","errorCode":null,"errorMessage":"repo is not configured for this workspace","messagePattern":"repo is not configured for this workspace","errorType":"http","errorClass":"ErrRepoNotConfigured","httpStatus":400,"severity":"error","filePath":"server/internal/daemon/daemon.go","lineNumber":38,"sourceCode":"\t\"time\"\n\n\t\"golang.org/x/sync/errgroup\"\n\t\"golang.org/x/sync/singleflight\"\n\n\t\"github.com/multica-ai/multica/server/internal/cli\"\n\t\"github.com/multica-ai/multica/server/internal/daemon/execenv\"\n\t\"github.com/multica-ai/multica/server/internal/daemon/repocache\"\n\t\"github.com/multica-ai/multica/server/internal/selfexec\"\n\t\"github.com/multica-ai/multica/server/pkg/agent\"\n\t\"github.com/multica-ai/multica/server/pkg/redact\"\n\t\"github.com/multica-ai/multica/server/pkg/skillbundle\"\n\t\"github.com/multica-ai/multica/server/pkg/taskfailure\"\n)\n\n// ErrRepoNotConfigured is returned by ensureRepoReady when the requested repo\n// URL is not present in the workspace's repo configuration after a fresh\n// server refresh.\nvar ErrRepoNotConfigured = errors.New(\"repo is not configured for this workspace\")\n\n// ErrNoRuntimesToRegister is returned by registerRuntimesForWorkspace when\n// the daemon has nothing to host on a workspace — typically a custom-only\n// daemon whose only enabled custom runtime profile was just disabled, leaving\n// zero built-in agents and zero resolvable profiles. Callers must\n// differentiate by intent: initial registration (syncWorkspacesFromAPI's\n// new-workspace branch) treats this as a config error and skips the\n// workspace until something changes; the profile-drift refresh path\n// (refreshWorkspaceRuntimeProfiles) treats it as a legitimate converged\n// state and explicitly deregisters the now-stale local runtime IDs so the\n// server marks them offline immediately instead of waiting on the 150 s\n// stale-heartbeat sweep.\nvar ErrNoRuntimesToRegister = errors.New(\"no agent runtimes could be registered\")\n\n// errTaskPrepareTimeout distinguishes the daemon's dispatched -> running\n// startup deadline from provider execution timeouts. handleTask maps it to the\n// platform-side timeout failure reason so the server's existing retry path can\n// recover the task on a fresh attempt.","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/daemon/daemon.go#L20-L56","documentation":"Sentinel error ErrRepoNotConfigured in server/internal/daemon/daemon.go: ensureRepoReady refreshed the workspace's repo configuration from the server, then could not find the requested repo URL among the workspace's configured repos. The daemon will not clone/serve a repo the workspace has not been granted, so it fails closed. It is a configuration mismatch between what a task references and what the workspace allows.","triggerScenarios":"A task or agent run references a repo URL that was removed from the workspace's repo config after the task was created; URL normalization mismatch (trailing .git, scheme case, trailing slash) between the task's repo string and the configured entry; fresh daemon syncing a workspace whose repo list is empty on the server.","commonSituations":"Repo removed/archived in workspace settings while queued tasks still reference it; repo URL stored with a different canonical form than the config; workspace provisioning races where the daemon asks before the server applied the repo grant.","solutions":["Re-add the repo URL to the workspace's repo configuration (exact canonical URL), then retry the task.","Compare the task's repo string with the configured one byte-for-byte — normalize .git suffix, scheme, and trailing slash.","If the workspace was just created, give the server a moment to apply repo grants and re-sync before retrying.","Cancel or re-target tasks that reference repos the workspace no longer has."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Canonicalize before comparing/creating tasks\nfunc canonicalRepoURL(u string) string {\n    u = strings.TrimSuffix(u, \".git\")\n    u = strings.TrimRight(u, \"/\")\n    return strings.ToLower(strings.SplitN(u, \"://\", 2)[0]) + strings.SplitN(u, \"://\", 2)[1]\n}","typeGuard":null,"tryCatchPattern":"if errors.Is(err, daemon.ErrRepoNotConfigured) {\n    // surface as workspace config guidance, not a transient failure\n    return fmt.Errorf(\"repo %q is not in this workspace's repo list; add it in workspace settings\", repoURL)\n}","preventionTips":["Store and compare repo URLs in one canonical form everywhere (task creation, workspace config, daemon).","When removing a repo from a workspace, cancel queued tasks that reference it.","After workspace provisioning, verify the repo grant landed before dispatching tasks."],"tags":["daemon","repo","workspace","configuration","go","sentinel-error"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}