multica-ai/multica · error

must be an absolute path

Error message

%s must be an absolute path

What it means

Thrown by resolveDiskUsageRoot in the multica CLI daemon command when the daemon-injected workspaces root environment variable (daemon.TaskWorkspacesRootEnv) is set to a relative path. For daemon-managed tasks the CLI refuses to guess the disk-usage tree root, because a profile-derived default could report a tree unrelated to the task; the value must be absolute.

Solutions

  1. Set the environment variable named by daemon.TaskWorkspacesRootEnv to an absolute path (e.g. /var/lib/multica/workspaces) and rerun the command
  2. Check how the daemon was started: if you injected the variable yourself, use an absolute path derived from the workspace root
  3. If running outside a daemon-managed context, unset the task-context flag/env so the CLI uses the profile root instead
  4. Restart the daemon after fixing its configuration so it re-injects a correct absolute path

Example fix

# before
export MULTICA_TASK_WORKSPACES_ROOT=workspaces
multica daemon disk-usage

# after
export MULTICA_TASK_WORKSPACES_ROOT=/var/lib/multica/workspaces
multica daemon disk-usage
Defensive patterns

Strategy: validation

Validate before calling

package main

import (
	"fmt"
	"os"
	"path/filepath"
)

// validateTaskWorkspacesRoot checks the daemon-injected root before
// invoking any disk-usage command in task context.
func validateTaskWorkspacesRoot(envName string) error {
	root := os.Getenv(envName)
	if root == "" {
		return fmt.Errorf("%s is not set", envName)
	}
	if !filepath.IsAbs(root) {
		return fmt.Errorf("%s must be an absolute path, got %q", envName, root)
	}
	return nil
}

Prevention

When it happens

Trigger: Running a disk-usage command with taskContext=true (daemon-managed task) where the daemon sets daemon.TaskWorkspacesRootEnv to a relative path like "workspaces" instead of "/var/lib/multica/workspaces". Only reached after the empty-value check passes, so the env var exists but is not filepath.IsAbs.

Common situations: A custom or misconfigured daemon launcher, a wrapper script exporting the env var with a relative path, or a newer daemon version whose injection format changed. Also happens when someone hand-runs a task command and manually sets the env var.

Related errors


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

Appendix: source

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

	}
	return nil
}

// resolveDiskUsageRoot picks the directory to scan. A managed task reads the
// daemon-injected root only: ResolveWorkspacesRoot falls back to a $HOME- and
// profile-derived default, which for a task hosted by a named-profile daemon
// resolves to the default root and reports a tree the task has nothing to do
// with. Failing closed on a missing value keeps that guess out of the output.
func resolveDiskUsageRoot(taskContext bool, profile, rootOverride string) (string, error) {
	if !taskContext {
		return resolveWorkspacesRootForProfile(profile, rootOverride)
	}
	root := strings.TrimSpace(os.Getenv(daemon.TaskWorkspacesRootEnv))
	if root == "" {
		return "", fmt.Errorf("daemon-managed task requires the daemon-injected workspaces root in %s", daemon.TaskWorkspacesRootEnv)
	}
	if !filepath.IsAbs(root) {
		return "", fmt.Errorf("%s must be an absolute path", daemon.TaskWorkspacesRootEnv)
	}
	return filepath.Clean(root), nil
}

// diskUsageNeedsParentStatus reports whether this invocation renders per-task
// rows at all. The --by-workspace table has no STATUS column, so resolving
// statuses for it would spend a network round trip — and, against an
// unreachable server, a full timeout — on data nothing displays, turning a
// local diagnostic into a command that hangs offline. JSON output always
// carries the task array, so it still needs them even with --by-workspace.
func diskUsageNeedsParentStatus(byWorkspace bool, output string) bool {
	return !byWorkspace || output == "json"
}

// fillDiskUsageParentStatuses populates the report's STATUS column in place.
//
// This is best-effort and never fails the command: `disk-usage` is a local
// diagnostic that has to keep working when the machine is offline or logged

View on GitHub (pinned to 2c0912b6ec)