Skip to content

runBackup() fails on OpenClaw 2026.4.29: api.resolvePath double-call returns undefined → mkdir TypeError #731

@SL4N

Description

@SL4N

Symptom

Daily backup fails on every run with:

[plugins] memory-lancedb-pro: backup failed: TypeError [ERR_INVALID_ARG_TYPE]:
  The "path" argument must be of type string or an instance of Buffer or URL.
  Received undefined

Gateway runs fine otherwise; only the backup task is broken. No JSONL backup written.

Affected code

index.ts lines 1865–1908 (runBackup closure):

async function runBackup() {
  try {
    const backupDir = api.resolvePath(
      join(resolvedDbPath, "..", "backups"),
    );
    await mkdir(backupDir, { recursive: true });
    ...

api.resolvePath is called a second time here — resolvedDbPath is already an absolute path (it was produced by an earlier api.resolvePath(...) at line 217). Under OpenClaw 2026.4.29, the second call returns undefined, which then propagates into mkdir(undefined, ...)ERR_INVALID_ARG_TYPE.

The bundled memory-lancedb plugin in the gateway only calls api.resolvePath once (on the raw input dbPath) and then uses plain join(...) for derived paths — that one keeps working.

Suggested fix

Either:

// Don't double-resolve; resolvedDbPath is already absolute
const backupDir = join(resolvedDbPath, "..", "backups");

…or, if you want the path coercion behaviour for safety, make it idempotent:

const backupDir = api.resolvePath(join(resolvedDbPath, "..", "backups"))
  ?? join(resolvedDbPath, "..", "backups");

Environment

  • OpenClaw 2026.4.29 (a448042) — gateway running on Termux/Android
  • Plugin: memory-lancedb-pro 1.1.0-beta.9
  • Node v22.22

Reproduction

  1. Install plugin in any 2026.4.29 gateway with embedding: OK, retrieval: OK.
  2. Wait for the plugin's daily BACKUP_INTERVAL_MS timer to fire (24h), or manually trigger via the same code path on startup if available.
  3. Observe [plugins] memory-lancedb-pro: backup failed: TypeError ERR_INVALID_ARG_TYPE in the gateway log.

I have not been able to test this against earlier OpenClaw versions to confirm whether api.resolvePath's idempotency changed in 2026.4.29 specifically — flagging the symptom first; the maintainer is better placed to confirm the API contract drift.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions