santifer/career-ops · error

getonbrd: categories configured — cap is (each one costs up…

Error message

getonbrd: ${out.length} categories configured — cap is ${MAX_CATEGORIES} (each one costs up to max_pages requests)

What it means

resolveCategories caps the number of categories at MAX_CATEGORIES because each category costs up to max_pages HTTP requests per scan; too many categories multiplies request volume and risks rate limiting. The error reports the actual count and the cap.

Solutions

  1. Trim the list to the MAX_CATEGORIES most relevant slugs (the cap value is in the error).
  2. Run multiple board entries with disjoint category subsets if broad coverage is genuinely needed.
  3. Trade categories against max_pages: fewer categories with more pages may cover the same volume within the cap.
  4. Raise MAX_CATEGORIES in providers/getonbrd.mjs only if you accept the multiplied request cost and rate-limit risk.

Example fix

# before
categories: [programming, data-science, machine-learning-ai, design, marketing, sales, finance, devops, mobile, qa]  # 10 > cap
# after
categories: [programming, data-science, machine-learning-ai, devops]  # within cap
Defensive patterns

Strategy: validation

Validate before calling

if ((cfg.categories || []).length > MAX_CATEGORIES) throw new Error(`Cap is ${MAX_CATEGORIES} categories per Getonboard entry`);

Type guard

const withinCategoryCap = (c) => !Array.isArray(c.categories) || c.categories.length <= MAX_CATEGORIES;

Try / catch

try { resolveCategories(entry); } catch (e) { if (e.message.includes('cap is')) console.error(e.message, '— split into multiple entries or trim the list'); throw e; }

Prevention

When it happens

Trigger: Configuring more than MAX_CATEGORIES valid slugs in a Getonboard entry's categories list — e.g. pasting the portal's entire category taxonomy into one entry.

Common situations: Bulk-migrating an old config that listed dozens of categories; a script that appends categories without dedup/capping; misunderstanding that each category is a separate paginated request chain, not a server-side filter.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


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

Appendix: source

Thrown at providers/getonbrd.mjs:68

  const raw = entry?.categories !== undefined ? entry.categories : entry?.category;
  if (raw === undefined || raw === null) return [DEFAULT_CATEGORY];

  const list = Array.isArray(raw) ? raw : [raw];
  const out = [];
  for (const c of list) {
    if (typeof c !== 'string' || !CATEGORY_SLUG_RE.test(c.trim())) {
      throw new Error(
        `getonbrd: invalid category ${JSON.stringify(c)} — expected a slug like "programming" or "machine-learning-ai"`,
      );
    }
    const slug = c.trim();
    if (!out.includes(slug)) out.push(slug);
  }
  if (!out.length) {
    throw new Error('getonbrd: `categories` is empty — omit it to use the "programming" default');
  }
  if (out.length > MAX_CATEGORIES) {
    throw new Error(
      `getonbrd: ${out.length} categories configured — cap is ${MAX_CATEGORIES} (each one costs up to max_pages requests)`,
    );
  }
  return out;
}

/** @param {string} url */
function assertGetonbrdUrl(url) {
  let parsed;
  try {
    parsed = new URL(url);
  } catch {
    throw new Error(`getonbrd: invalid URL: ${url}`);
  }
  if (parsed.protocol !== 'https:') throw new Error(`getonbrd: URL must use HTTPS: ${url}`);
  if (parsed.hostname !== TRUSTED_HOST) {
    throw new Error(`getonbrd: untrusted hostname "${parsed.hostname}" — must be ${TRUSTED_HOST}`);
  }

View on GitHub (pinned to aac998c7ed)