thedotmack/claude-mem · warning

Invalid ${settingName} in settings.json, using default

Error message

Invalid ${settingName} in settings.json, using default

What it means

With no env override present, the timeout setting is read from worker settings (settings.json) and run through parseBoundedTimeout. A null result (non-numeric, or numeric but outside min/max) triggers this warning echoing the stored value, and the default is used instead.

Source

Thrown at src/shared/worker-utils.ts:121

  const envVal = process.env[settingName];
  if (envVal !== undefined) {
    const parsed = parseBoundedTimeout(envVal, bounds);
    if (parsed !== null) {
      return parsed;
    }
    logger.warn('SYSTEM', `Invalid ${settingName}, using default`, {
      value: envVal, min: bounds.min, max: bounds.max
    });
    return defaultValue;
  }

  const settingsValue = getWorkerSettings()[settingName];
  const parsed = parseBoundedTimeout(settingsValue, bounds);
  if (parsed !== null) {
    return parsed;
  }

  logger.warn('SYSTEM', `Invalid ${settingName} in settings.json, using default`, {
    value: settingsValue, min: bounds.min, max: bounds.max
  });
  return defaultValue;
}

export function getWorkerPort(): number {
  if (cachedPort !== null) {
    return cachedPort;
  }

  const settings = getWorkerSettings();
  cachedPort = parseInt(settings.CLAUDE_MEM_WORKER_PORT, 10);
  return cachedPort;
}

export function getWorkerHost(): string {
  if (cachedHost !== null) {
    return cachedHost;

View on GitHub (pinned to 8bc631a71a)

Solutions

  1. Edit settings.json so the key is a bare integer (milliseconds) within the min/max shown in the log.
  2. Or delete the key to fall back to the built-in default.
  3. Validate the file's JSON syntax after editing.

Example fix

// settings.json — before
{ "HEALTH_CHECK_TIMEOUT_MS": "10s" }

// after
{ "HEALTH_CHECK_TIMEOUT_MS": 10000 }
Defensive patterns

Strategy: validation

Validate before calling

const settingsValue = getWorkerSettings()[settingName];
if (parseBoundedTimeout(settingsValue, bounds) === null) {
  // invalid entry in settings.json — fix or drop the key before it silently becomes a default
}

Type guard

const isNumericSettingsValue = (v: unknown): v is number =>
  typeof v === 'number' && Number.isFinite(v);

Prevention

When it happens

Trigger: settings.json contains a string like "30s", a number outside the allowed window, or a malformed value for a timeout key such as the health/readiness timeouts.

Common situations: Hand-editing settings.json with units or strings; values carried over from an older version whose bounds differed; JSON type mistakes (string vs number).

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of thedotmack/claude-mem@8bc631a71a (2026-08-20). Data as JSON: /api/errors/3888085fcfa2c4df. Report an issue: GitHub.