Skip to content

Wallet migration fails silently when the target _WatchingOnly.lmdb already exists #782

Description

@dkjn28

Migrating a legacy wallet a second time fails with a message the user never sees, and the migration cannot be retried without manual filesystem surgery.

AssetWallet_Single::forkWatchingOnly() refuses to overwrite an existing file:

//check file does not exist
if (FileUtils::pathExists(newPath, 0)) {
   throw WalletException("WO wallet filename already exists");
}

CppBridge::migrateWallet() catches it and returns it as reply.setError(e.what()), but the GUI surfaces only:

Migration of Wallet <id> failed!

The exception text does not reach the log either: Armory spawns the bridge with --ephemeral, and main.cpp:63 drops the log level to LogLvlWarn in that case, so nothing is recorded.

The result is a dead end. A user whose first migration produced a watching-only wallet (see the unencrypted-wallet case) retries, gets "failed", and has no way to learn that the fix is to move armory_<id>_WatchingOnly.lmdb out of the data dir.

Two things would help independently:

  • surface the error string the bridge already returns, instead of a generic "failed"
  • either pick a non-colliding filename, or say explicitly which file is in the way

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions