JuliusBrussee/caveman · error · Error
${label} must be an absolute http(s) URL
Error message
${label} must be an absolute http(s) URL What it means
Error "${label} must be an absolute http(s) URL" thrown in JuliusBrussee/caveman.
Source
Thrown at packages/mastra/src/index.ts:821
return `${base}/traces/${encodeURIComponent(trace)}?project_id=${encodeURIComponent(project)}`;
}
// ---------------------------------------------------------------------------
// Shared helpers
// ---------------------------------------------------------------------------
function requireNonEmpty(value: string | undefined, label: string): string {
if (typeof value !== "string" || value.trim() === "") throw new Error(`${label} is required`);
return value.trim();
}
function requireBaseUrl(value: string | undefined, label: string): string {
const raw = requireNonEmpty(value, label);
let parsed: URL;
try {
parsed = new URL(raw);
} catch {
throw new Error(`${label} must be an absolute http(s) URL`);
}
// Credentials ride every request to this host. Plain http is allowed only
// for loopback development targets — anywhere else the key or session token
// would transit unencrypted to a caller-chosen host.
const loopback = parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1" || parsed.hostname === "::1" || parsed.hostname === "[::1]";
if (parsed.protocol === "http:" && !loopback) {
throw new Error(`${label} must use https (plain http is allowed only for localhost)`);
}
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
throw new Error(`${label} must be an absolute http(s) URL`);
}
return trimTrailingSlashes(raw);
}
function trimTrailingSlashes(value: string): string {
return value.replace(/\/+$/, "");
}
View on GitHub (pinned to 27d5a3981a)
Solutions
- Use an absolute http(s) URL for the indicated field.
When it happens
Trigger: Thrown at packages/mastra/src/index.ts:821 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15).
Data as JSON: /api/errors/813b9a7f17239d64.
Report an issue: GitHub.