santifer/career-ops · error · Error

apify: entry ${entry.name} missing 'actor' (e.g. misceres/in

Error message

apify: entry ${entry.name} missing 'actor' (e.g. misceres/indeed-scraper)

What it means

Thrown by the apify provider's `fetch` hook (plugins/apify/index.mjs:185) when a portals.yml entry declares `provider: apify` but has no `actor` field. The actor field tells the plugin which Apify actor to run (e.g. `misceres/indeed-scraper`); without it the provider cannot call runActor. The example in the message (`misceres/indeed-scraper`) shows the expected owner/actor form. This check runs after the token check.

Source

Thrown at plugins/apify/index.mjs:185

    if (!out[k]) out[k] = String(v);
  }
  return out;
}

/** The keyed provider hook. Reads APIFY_TOKEN from the plugin's scoped ctx.env. */
export default {
  provider: {
    id: 'apify',
    // Keyed providers never auto-detect (the engine also forces this to null).
    detect() { return null; },

    async fetch(entry, ctx) {
      const token = ctx?.env?.APIFY_TOKEN || process.env.APIFY_TOKEN;
      if (!hasToken(token)) {
        throw new Error('APIFY_TOKEN not set — enable apify in config/plugins.yml and add the token to .env');
      }
      if (!entry.actor) {
        throw new Error(`apify: entry ${entry.name} missing 'actor' (e.g. misceres/indeed-scraper)`);
      }
      if (
        !entry.field_map ||
        !isFieldSpec(entry.field_map.title) ||
        !isFieldSpec(entry.field_map.url) ||
        (entry.field_map.company != null && !isFieldSpec(entry.field_map.company)) ||
        (entry.field_map.location != null && !isFieldSpec(entry.field_map.location)) ||
        (entry.field_map.description != null && !isFieldSpec(entry.field_map.description))
      ) {
        throw new Error(
          `apify: entry ${entry.name} has invalid field_map. Each of title, url, company, ` +
          `location, description must be a string or a non-empty array of strings. title and url are required.`
        );
      }

      const opts = { token };
      if (entry.timeout_ms != null) opts.timeoutMs = entry.timeout_ms;
      const items = await runActor(entry.actor, entry.input || {}, opts);

View on GitHub (pinned to 9b17a8ac97)

Solutions

  1. Add the `actor` field in owner/actor form to the portals.yml entry.
  2. Find the actor ID on the Apify store URL (the path after /acts/).
  3. Validate YAML indentation so `actor` is a sibling of `provider`, not nested under field_map.

Example fix

# before — portals.yml
- name: indeed
  provider: apify
  field_map: { title: title, url: url }
  # missing actor
# after
- name: indeed
  provider: apify
  actor: misceres/indeed-scraper
  field_map: { title: title, url: url }
Defensive patterns

Strategy: validation

Validate before calling

// Lint apify entries for a present, well-formed actor field.
for (const e of portals.filter(p => p.provider === 'apify')) {
  if (typeof e.actor !== 'string' || !e.actor.trim()) {
    throw new Error(`Entry '${e.name}' is missing a required 'actor' (e.g. misceres/indeed-scraper).`);
  }
}

Type guard

/** @param {unknown} v */
function hasActor(v) {
  return typeof v?.actor === 'string' && v.actor.trim().length > 0;
}

Try / catch

try {
  await provider.fetch(entry, ctx);
} catch (err) {
  if (/missing 'actor'/.test(err.message)) {
    console.error(`Config error: ${err.message}`);
    process.exitCode = 2;
  } else throw err;
}

Prevention

When it happens

Trigger: A portals.yml entry has `provider: apify` and a field_map but omits `actor`. The `if (!entry.actor)` guard fires.

Common situations: Copy-pasted a portal entry from a non-apify provider and forgot to add `actor`; renamed/removed the actor field accidentally; YAML indentation put actor under the wrong key.

Related errors


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