{"record":{"id":"5e177d979eac3ee9","repo":"multica-ai/multica","slug":"download-url-q-is-relative-but-client-has-no-base","errorCode":null,"errorMessage":"download URL %q is relative but client has no BaseURL","messagePattern":"download URL %q is relative but client has no BaseURL","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/cli/client.go","lineNumber":724,"sourceCode":"\t}\n\treturn json.NewDecoder(resp.Body).Decode(out)\n}\n\n// DownloadFile downloads a file from the given URL and returns the response body.\n// This is used for downloading attachments via their signed download_url.\n// Downloads are limited to 100 MB to match the upload size limit.\n//\n// The URL may be absolute (a signed CloudFront/S3 URL) or relative\n// (a server-relative path like \"/api/attachments/{id}/download\" or\n// \"/uploads/...\") depending on how the\n// server is configured. Relative URLs are resolved against the client's\n// BaseURL and sent with the standard auth headers; absolute URLs are\n// used as-is so that their query-string signatures are not disturbed.\nfunc (c *APIClient) DownloadFile(ctx context.Context, downloadURL string) ([]byte, error) {\n\tisRelative := !strings.HasPrefix(downloadURL, \"http://\") && !strings.HasPrefix(downloadURL, \"https://\")\n\tif isRelative {\n\t\tif c.BaseURL == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"download URL %q is relative but client has no BaseURL\", downloadURL)\n\t\t}\n\t\tdownloadURL = c.BaseURL + downloadURL\n\t}\n\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, downloadURL, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif isRelative {\n\t\tc.setHeaders(req)\n\t}\n\n\tresp, err := c.HTTPClient.Do(req)\n\terr = wrapTransport(req, err)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()","sourceCodeStart":706,"sourceCodeEnd":742,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/cli/client.go#L706-L742","documentation":"Error \"download URL %q is relative but client has no BaseURL\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/cli/client.go:724 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure the client BaseURL, or use a server that returns absolute download URLs."],"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"}