santifer/career-ops · error · Error
getonbrd: invalid URL: ${url}
Error message
getonbrd: invalid URL: ${url} What it means
getonbrd.mjs throws this inside assertGetonbrdUrl() when `new URL(url)` raises — the string is not an absolute, parseable URL. The guard validates the Get on Board feed endpoint before fetching. The validated URL is built from the module constant FEED_BASE ('https://www.getonbrd.com/api/v0/categories/programming/jobs'), so a live throw means FEED_BASE was corrupted/edited to a non-URL, or a test called the guard with a malformed string.
Source
Thrown at providers/getonbrd.mjs:27
// scan.mjs's title_filter can gate on the configured titles instead. Pages are
// fetched until one comes back short/empty or the page cap is reached (default
// 3, override with `max_pages` on the portal entry).
//
// Wire in via a `job_boards:` entry with `provider: getonbrd`.
const FEED_BASE = 'https://www.getonbrd.com/api/v0/categories/programming/jobs';
const TRUSTED_HOST = 'www.getonbrd.com';
const PER_PAGE = 100;
const DEFAULT_MAX_PAGES = 3;
const MAX_PAGES_CAP = 50;
/** @param {string} url */
function assertGetonbrdUrl(url) {
let parsed;
try {
parsed = new URL(url);
} catch {
throw new Error(`getonbrd: invalid URL: ${url}`);
}
if (parsed.protocol !== 'https:') throw new Error(`getonbrd: URL must use HTTPS: ${url}`);
if (parsed.hostname !== TRUSTED_HOST) {
throw new Error(`getonbrd: untrusted hostname "${parsed.hostname}" — must be ${TRUSTED_HOST}`);
}
return url;
}
/** Resolve the page cap: a positive integer `max_pages` on the entry, capped. */
function resolveMaxPages(entry) {
const v = entry?.max_pages;
if (Number.isInteger(v) && v > 0) return Math.min(v, MAX_PAGES_CAP);
return DEFAULT_MAX_PAGES;
}
/**
* Normalize a single Get on Board job (JSON:API resource). Exported for tests.
*View on GitHub (pinned to 9b17a8ac97)
Solutions
- Restore FEED_BASE to 'https://www.getonbrd.com/api/v0/categories/programming/jobs'.
- Ensure no runtime code mutates FEED_BASE; it is a literal constant.
- In tests, pass a well-formed absolute URL when you do not intend to hit this branch.
Example fix
// before const FEED_BASE = '/api/v0/categories/programming/jobs'; // relative -> throws // after const FEED_BASE = 'https://www.getonbrd.com/api/v0/categories/programming/jobs';
Defensive patterns
Strategy: validation
Validate before calling
// Startup self-check: FEED_BASE must be an absolute URL.
function checkGetonbrdFeed() {
try { new URL('https://www.getonbrd.com/api/v0/categories/programming/jobs'); }
catch { throw new Error('getonbrd FEED_BASE is not a valid absolute URL'); }
} Prevention
- Keep FEED_BASE a literal absolute URL; never compute it at runtime.
- Add a CI test that assertGetonbrdUrl(FEED_BASE) does not throw.
- Review any PR editing the FEED_BASE line.
When it happens
Trigger: FEED_BASE was edited to a relative path or a string with illegal characters; a config/CI injection replaced the constant with undefined/''; a unit test invokes assertGetonbrdUrl('/api/v0/...') or assertGetonbrdUrl('not a url').
Common situations: A contributor shortens the constant to a path assuming base resolution; a templating step mangled the URL; a test expected a different error path.
Related errors
- getonbrd: URL must use HTTPS: ${url}
- getonbrd: untrusted hostname "${parsed.hostname}" — must be
- flowxtra: untrusted hostname "${parsed.hostname}" — must be
- gem: invalid URL: ${url}
- gem: URL must use HTTPS: ${url}
AI-assisted analysis of santifer/career-ops@9b17a8ac97 (2026-08-13).
Data as JSON: /api/errors/d5558b9ac288e506.
Report an issue: GitHub.