santifer/career-ops · error · Error

Invalid or blocked URL

Error message

Invalid or blocked URL: ${rejected.reason}

What it means

SSRF guard in the Gemini batch evaluator's scraper: rejectPrivateOrInvalid() flagged the URL before navigation, so the request was never made. It fires for malformed/unparseable URLs or addresses that resolve into private/loopback/internal ranges (e.g. http://localhost, 127.x, 10.x, 169.254.x, file: schemes). The interpolated reason names which check failed; the input at fault is the URL taken from the batch input line.

Solutions

  1. Fix or replace the offending URL in the batch input file with a public HTTPS job-posting URL
  2. Remove internal/localhost links from the batch list — the evaluator only scrapes publicly reachable pages
  3. If the target is genuinely public, check for a typo, a non-http scheme, or a hostname that DNS-resolves to a private range
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at batch-evaluate-gemini.mjs:195 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of santifer/career-ops@aac998c7ed (2026-09-16). Data as JSON: /api/errors/5d4d7f7c9d6d122e. Report an issue: GitHub.

Appendix: source

Thrown at batch-evaluate-gemini.mjs:195

═══════════════════════════════════════════════════════
1. You do NOT have access to WebSearch, Playwright, or file writing tools.
2. Generate Blocks A through G in full, in English.
3. Output a machine-readable summary block in this exact format:

---SCORE_SUMMARY---
COMPANY: <company name>
ROLE: <role title>
SCORE: <global score as decimal, e.g. 3.8>
ARCHETYPE: <detected archetype>
LEGITIMACY: <High Confidence | Proceed with Caution | Suspicious>
---END_SUMMARY---
`;
}

async function scrapeUrl(browser, url) {
  const rejected = rejectPrivateOrInvalid(url);
  if (rejected) {
    throw new Error(`Invalid or blocked URL: ${rejected.reason}`);
  }
  
  const page = await browser.newPage();
  try {
    await page.route('**/*', (route) => {
      const targetUrl = route.request().url();
      const interceptedRejected = rejectPrivateOrInvalid(targetUrl);
      if (interceptedRejected) {
        return route.abort('accessdenied');
      }
      return route.continue();
    });

    await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30000 });
    
    const finalRejected = rejectPrivateOrInvalid(page.url());
    if (finalRejected) {
      throw new Error(`Invalid or blocked URL after redirect: ${finalRejected.reason}`);

View on GitHub (pinned to aac998c7ed)