santifer/career-ops · error · Error

arbeitsagentur: entry "${entry.name || '(unnamed)'}" has no

Error message

arbeitsagentur: entry "${entry.name || '(unnamed)'}" has no arbeitsagentur.keywords[]

What it means

The Arbeitsagentur provider derives its search terms from `entry.arbeitsagentur.keywords[]` via `parseArbeitsagenturConfig`. If that array is empty/absent the provider has nothing to query and throws immediately, naming the entry (or '(unnamed)') so the offending config row is identifiable.

Source

Thrown at providers/arbeitsagentur.mjs:153

// candidate whose title makes no remote claim keeps its real city, which is the
// fail-closed behaviour an unverifiable lookup had in v4: the `Deutschlandweit
// (Homeoffice)` marker exempts a job from the commute location_filter, so
// tagging on nv_true alone would smuggle every hybrid past it.

/** @type {Provider} */
export default {
  id: 'arbeitsagentur',

  /**
   * Fetches and normalizes postings from the Arbeitsagentur Jobsuche API.
   * @param {{ name?: string, arbeitsagentur?: any }} entry
   * @param {{ fetchJson: (url: string, opts?: object) => Promise<any> }} ctx
   * @returns {Promise<Array<{title: string, url: string, company: string, location: string}>>}
   */
  async fetch(entry, ctx) {
    const { keywords, wo, umkreis, days, size, remoteNationwide, remoteMatch, remoteMaxPages } = parseArbeitsagenturConfig(entry);
    if (!keywords.length) {
      throw new Error(`arbeitsagentur: entry "${entry.name || '(unnamed)'}" has no arbeitsagentur.keywords[]`);
    }

    /** @param {string} was @param {Record<string,string>} [extra] */
    const fetchKeyword = async (was, extra = {}) => {
      const params = new URLSearchParams({
        was,
        size: String(size),
        page: '1',
        angebotsart: '1', // 1 = ARBEIT (employment; excludes Ausbildung/Selbständigkeit)
        veroeffentlichtseit: String(days),
        ...extra,
      });
      // redirect:'error' prevents SSRF via server-side redirects.
      const json = await ctx.fetchJson(`${API_URL}?${params.toString()}`, {
        headers: { 'X-API-Key': API_KEY, accept: 'application/json' },
        redirect: 'error',
        timeoutMs: 12_000,
      });

View on GitHub (pinned to 9b17a8ac97)

Solutions

  1. Add an `arbeitsagentur.keywords` array to the entry, e.g. `keywords: ['Softwareentwickler', 'IT-Projektmanager']`.
  2. Verify the YAML nesting: `keywords` must sit under `arbeitsagentur:`, not at the entry root.
  3. Run a config linter/doctor check to catch empty keyword arrays before the scan starts.

Example fix

# before
- name: Bundesagentur für Arbeit
  provider: arbeitsagentur
  arbeitsagentur:
    wo: Berlin

# after
- name: Bundesagentur für Arbeit
  provider: arbeitsagentur
  arbeitsagentur:
    wo: Berlin
    keywords:
      - Softwareentwickler
      - IT-Projektmanager
Defensive patterns

Strategy: validation

Validate before calling

// Validate entry config before invoking the provider
function validateArbeitsagenturEntry(entry) {
  const kw = entry?.arbeitsagentur?.keywords;
  if (!Array.isArray(kw) || kw.length === 0 || kw.some(k => typeof k !== 'string' || !k.trim())) {
    throw new Error(`arbeitsagentur: entry "${entry?.name || '(unnamed)'}" needs a non-empty arbeitsagentur.keywords[] of strings`);
  }
}
validateArbeitsagenturEntry(entry);

Type guard

/** @param {any} e */
function hasArbeitsagenturKeywords(e) {
  return e?.arbeitsagentur?.keywords instanceof Array && e.arbeitsagentur.keywords.length > 0;
}

Prevention

When it happens

Trigger: `parseArbeitsagenturConfig(entry).keywords` is an empty array — i.e. `entry.arbeitsagentur` is missing, has no `keywords` key, or `keywords` is `[]`. Thrown at the top of `fetch` before any network call.

Common situations: A portals.yml entry enables the arbeitsagentur provider but omits the `keywords` list; a YAML indentation error puts keywords under the wrong key; or a templated entry was left with an empty array as a placeholder.

Related errors


AI-assisted analysis of santifer/career-ops@9b17a8ac97 (2026-08-13). Data as JSON: /api/errors/69f1113260db9ae6. Report an issue: GitHub.