paperclipai/paperclip · error · Error

Invalid hostname

Error message

Invalid hostname: ${raw}

What it means

normalizeHostnameInput parsed the input as a URL (prepending http:// if needed) and extraction of a hostname failed, so the raw input is not a parseable hostname.

Solutions

  1. Use a valid hostname: letters, digits, dots, and hyphens; no scheme or port.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cli/src/config/hostnames.ts:13 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/de2072c97c97fec0. Report an issue: GitHub.

Appendix: source

Thrown at cli/src/config/hostnames.ts:13

export function normalizeHostnameInput(raw: string): string {
  const input = raw.trim();
  if (!input) {
    throw new Error("Hostname is required");
  }

  try {
    const url = input.includes("://") ? new URL(input) : new URL(`http://${input}`);
    const hostname = url.hostname.trim().toLowerCase();
    if (!hostname) throw new Error("Hostname is required");
    return hostname;
  } catch {
    throw new Error(`Invalid hostname: ${raw}`);
  }
}

export function parseHostnameCsv(raw: string): string[] {
  if (!raw.trim()) return [];
  const unique = new Set<string>();
  for (const part of raw.split(",")) {
    const hostname = normalizeHostnameInput(part);
    unique.add(hostname);
  }
  return Array.from(unique);
}

View on GitHub (pinned to 120ae5428f)