{"record":{"id":"c8e0d6cc3c1b3edf","repo":"santifer/career-ops","slug":"jobbankca-all-keywords-length-keyword-request","errorCode":null,"errorMessage":"jobbankca: all ${keywords.length} keyword request(s) failed — ${errors[0]}","messagePattern":"jobbankca: all (.+?) keyword request\\(s\\) failed — (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"providers/jobbankca.mjs","lineNumber":298,"sourceCode":"          }\n          break;\n        }\n\n        const rawEntryCount = (String(xml ?? '').match(/<entry\\b[^>]*>[\\s\\S]*?<\\/entry>/gi) || []).length;\n        const parsed = parseJobBankFeed(xml);\n        for (const job of parsed) {\n          if (!byUrl.has(job.url)) byUrl.set(job.url, job);\n        }\n        if (rawEntryCount < PAGE_SIZE) break; // short feed page — end of this keyword's results\n      }\n      if (!keywordFailed) succeeded++;\n    }\n\n    // Total outage = every keyword's first request failed. A keyword that\n    // answered with zero results is not an outage — recall-first, same as\n    // arbeitsagentur.mjs.\n    if (succeeded === 0 && errors.length) {\n      throw new Error(`jobbankca: all ${keywords.length} keyword request(s) failed — ${errors[0]}`);\n    }\n\n    return [...byUrl.values()];\n  },\n};\n","sourceCodeStart":280,"sourceCodeEnd":304,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/providers/jobbankca.mjs#L280-L304","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the appended first error (${errors[0]}) to identify the root cause (DNS, status code, timeout)","Check connectivity to https://www.jobbank.gc.ca directly in a browser or curl","Retry later — if Job Bank is down, this is transient; keep the scan's Crawl-delay (5s) respected","Check proxy env vars (HTTPS_PROXY) and corporate TLS interception certificates","Inspect data/scan-history or rerun a single keyword to isolate flakiness"],"exampleFix":"// before: hammering the feed in a tight loop\nawait Promise.all(keywords.map(k => fetchFeed(k)));\n// after: respect robots Crawl-delay of 5s between requests\nfor (const k of keywords) {\n  await fetchFeedWithRetry(k);\n  await sleep(5000);\n}","handlingStrategy":"retry","validationCode":"// Nothing to pre-validate; this is a runtime outage signal.\n// Optionally pre-check reachability:\nconst ok = await fetch('https://www.jobbank.gc.ca', { method: 'HEAD' }).then(r => r.ok).catch(() => false);","typeGuard":null,"tryCatchPattern":"try {\n  results = await jobbankcaProvider.fetch(entry, ctx);\n} catch (e) {\n  if (/all \\d+ keyword request\\(s\\) failed/.test(e.message)) {\n    console.warn('Job Bank feed unreachable — will retry next scan:', e.message);\n    await backoffRetry(() => jobbankcaProvider.fetch(entry, ctx), { attempts: 3, baseMs: 30000 });\n  } else throw e;\n}","preventionTips":["Respect robots.txt Crawl-delay: 5 between requests","Schedule scans with adequate spacing to avoid rate limiting","Monitor for Job Bank outages before assuming config problems","Read errors[0] in the message — it carries the root cause","Check HTTPS_PROXY and corporate TLS interception when running in office networks"],"tags":["network","http","outage","rate-limit","government-api"],"backgroundTag":"http-request-failed","analyzedSha":"aac998c7ed7248ea853b720ceeb1fdbeb322fc5d","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}