santifer/career-ops · error · Error

jobbankca: all keyword request(s) failed

Error message

jobbankca: all ${keywords.length} keyword request(s) failed — ${errors[0]}

What it means

After issuing one request per keyword to the Job Bank feed, the provider counts successes vs errors. If every keyword's first request failed (succeeded === 0) it treats this as a total outage and throws with the first underlying error appended for diagnosis. A keyword that returned zero results is NOT a failure — the provider is recall-first by design, so partial failures still return whatever succeeded.

Solutions

  1. Read the appended first error (${errors[0]}) to identify the root cause (DNS, status code, timeout)
  2. Check connectivity to https://www.jobbank.gc.ca directly in a browser or curl
  3. Retry later — if Job Bank is down, this is transient; keep the scan's Crawl-delay (5s) respected
  4. Check proxy env vars (HTTPS_PROXY) and corporate TLS interception certificates
  5. Inspect data/scan-history or rerun a single keyword to isolate flakiness

Example fix

// before: hammering the feed in a tight loop
await Promise.all(keywords.map(k => fetchFeed(k)));
// after: respect robots Crawl-delay of 5s between requests
for (const k of keywords) {
  await fetchFeedWithRetry(k);
  await sleep(5000);
}
Defensive patterns

Strategy: retry

Validate before calling

// Nothing to pre-validate; this is a runtime outage signal.
// Optionally pre-check reachability:
const ok = await fetch('https://www.jobbank.gc.ca', { method: 'HEAD' }).then(r => r.ok).catch(() => false);

Try / catch

try {
  results = await jobbankcaProvider.fetch(entry, ctx);
} catch (e) {
  if (/all \d+ keyword request\(s\) failed/.test(e.message)) {
    console.warn('Job Bank feed unreachable — will retry next scan:', e.message);
    await backoffRetry(() => jobbankcaProvider.fetch(entry, ctx), { attempts: 3, baseMs: 30000 });
  } else throw e;
}

Prevention

When it happens

Trigger: All keyword requests to https://www.jobbank.gc.ca/jobsearch/feed/jobSearchRSSfeed fail — network offline, DNS failure, Job Bank returning 5xx/429 to every request, a TLS intercepting proxy, or robots-rate-limit responses on every attempt.

Common situations: Corporate proxy/firewall blocking jobbank.gc.ca; Job Bank outage or maintenance window; aggressive local polling exceeding Crawl-delay: 5; VPN or DNS misconfiguration; IPv6 connectivity issues reaching the government host.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at providers/jobbankca.mjs:298

          }
          break;
        }

        const rawEntryCount = (String(xml ?? '').match(/<entry\b[^>]*>[\s\S]*?<\/entry>/gi) || []).length;
        const parsed = parseJobBankFeed(xml);
        for (const job of parsed) {
          if (!byUrl.has(job.url)) byUrl.set(job.url, job);
        }
        if (rawEntryCount < PAGE_SIZE) break; // short feed page — end of this keyword's results
      }
      if (!keywordFailed) succeeded++;
    }

    // Total outage = every keyword's first request failed. A keyword that
    // answered with zero results is not an outage — recall-first, same as
    // arbeitsagentur.mjs.
    if (succeeded === 0 && errors.length) {
      throw new Error(`jobbankca: all ${keywords.length} keyword request(s) failed — ${errors[0]}`);
    }

    return [...byUrl.values()];
  },
};

View on GitHub (pinned to aac998c7ed)