Skip to content

Backup fails: backupDir resolves to undefined due to double api.resolvePath() call #753

@adcosgou

Description

@adcosgou

Bug Description

The backup functionality fails silently because backupDir resolves to undefined.

Root Cause

In index.ts around line 3011, the code does:

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

The problem: resolvedDbPath is already an absolute path returned by a previous api.resolvePath() call. When api.resolvePath() receives an already-absolute path, it returns undefined instead of the path unchanged.

This causes the backup to write to undefined/ which fails silently.

Fix

Simply remove the outer api.resolvePath() wrapper:

// Before (broken):
const backupDir = api.resolvePath(join(resolvedDbPath, "..", "backups"));

// After (fixed):
const backupDir = join(resolvedDbPath, "..", "backups");

Since resolvedDbPath is already absolute, join() produces a valid absolute path without needing another resolution.

Environment

  • Plugin version: memory-lancedb-pro@1.1.0-beta.9
  • OpenClaw version: 2026.5.4
  • Node.js: v24.14.0
  • OS: Debian Linux

Workaround

Patching the installed index.ts directly (as we have done locally) fixes the issue immediately. Backup then works correctly — verified with 47 memories backed up successfully.

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