Skip to content

Test connection reports OK when local_archive_root does not exist; Import then blames the destination #1377

Description

@jss367

Problem

Test connection on a remote target reports "Connection OK — SSH, remote path, and rsync all good" even when local_archive_root points at a directory that does not exist. The misconfiguration surfaces much later, on the Import page, as a message that blames the destination rather than the archive root.

Reproduction

  1. Configure a remote target with a valid host/user/remote path.

  2. Set Local archive root to a path that doesn't exist, or that differs from the real folder by a typo (in the case that prompted this: ~/Pictures/Vireo_Archive in config vs ~/Pictures/Vireo Archive on disk — underscore vs space, invisible because the field is too narrow to show the full path).

  3. Click Test connection → green "Connection OK".

  4. Go to Import, pick Copy to archive + a local destination + an after-import process.

  5. The "Then move to NAS" row does not appear. The hint shown is:

    Move to NAS unavailable: the destination is not inside any remote target's local archive root. Set one under Settings > Remote targets.

Why the message misleads

The hint (vireo/templates/import.html:1467-1469) is accurate in a literal sense but points at the wrong field. The destination may be perfectly reasonable; the archive root is the broken value. A user reading this will re-examine and re-type their destination, which can never fix it.

Root cause

_coerce_remote_target validates that local_archive_root is absolute and not inside mount_path (vireo/config.py:753-775), but never that it exists.

test_remote_connection's contract omits it entirely — from the docstring at vireo/app.py:22137:

SSH reachability, remote-path writability, GNU rsync availability, and whether the local mount path is currently present.

Note that mount_path is existence-checked (res["mount_present"] = bool(mount and os.path.isdir(mount)), vireo/app.py:22159) — so the asymmetry is already inconsistent within the same endpoint.

Suggested fix

  1. Add an archive_root_present check to /api/remote-targets/test mirroring mount_present, and downgrade the result from a bare "Connection OK" when it's false — e.g. "Connection OK, but the local archive root does not exist — chained moves won't be offered."
  2. Optionally offer to create the directory inline, since the fix is a one-line mkdir -p.
  3. Make the Import-side hint distinguish the two cases: "no target has an archive root configured" vs "the configured archive root (<path>) does not exist" vs "your destination is outside it (<archive root>)". Showing the actual archive-root path in the message would have made this self-diagnosing.

Related: the field is too narrow to display a typical absolute path, which is what let the typo hide (see the folder-picker issue).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions