multica-ai/multica · error

attachment has no download URL

Error message

attachment has no download URL

What it means

After fetching attachment metadata, the command expects a non-empty download_url field (a signed URL). If the server returns metadata without a download_url, the command cannot proceed and aborts rather than guessing a URL.

Source

Thrown at server/cmd/multica/cmd_attachment.go:146

func runAttachmentDownload(cmd *cobra.Command, args []string) error {
	client, err := newAPIClient(cmd)
	if err != nil {
		return err
	}

	ctx, cancel := context.WithTimeout(context.Background(), cli.AtLeastAPITimeout(60*time.Second))
	defer cancel()

	// Fetch attachment metadata (includes signed download_url).
	var att map[string]any
	if err := client.GetJSON(ctx, "/api/attachments/"+args[0], &att); err != nil {
		return fmt.Errorf("get attachment: %w", err)
	}

	downloadURL := strVal(att, "download_url")
	if downloadURL == "" {
		return fmt.Errorf("attachment has no download URL")
	}

	filename := filepath.Base(strVal(att, "filename"))
	if filename == "" || filename == "." {
		filename = args[0]
	}

	// Download the file content.
	data, err := client.DownloadFile(ctx, downloadURL)
	if err != nil {
		return fmt.Errorf("download file: %w", err)
	}

	// Write to the output directory, creating it if needed so `-o` works
	// against a directory that does not exist yet (the help example's
	// `-o ./attachments` in a clean workdir).
	outputDir, _ := cmd.Flags().GetString("output-dir")
	if outputDir != "" {

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Update the self-hosted server to a version that returns download_url for attachments
  2. Verify your token has download scope for that attachment (try from the web UI with the same account)
  3. Inspect the raw response to confirm the field is absent: `multica attachment show <id>` or curl the metadata endpoint
  4. Report to the server operator if signing is misconfigured
Defensive patterns

Strategy: validation

Validate before calling

# confirm the field exists before attempting download
curl -fsSH "Authorization: Bearer $MULTICA_TOKEN" "$SERVER/api/attachments/$id" | jq -e '.download_url' >/dev/null

Prevention

When it happens

Trigger: Server version that does not include signed download URLs in the metadata payload; attachment stored on object storage whose signing failed server-side; the authenticated principal is not allowed to download this attachment and the server omits the field; malformed/proxy-mangled JSON.

Common situations: CLI newer than a self-hosted server (field added in a later release); S3/GCS signing misconfiguration server-side; token scopes that permit metadata reads but not downloads.

Related errors


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