Skip to content

Utilize PermanentFilesystem error messages when appropriate #641

@slifty

Description

@slifty

I had a typo in the path I was trying to have rclone sync to, such that the archive slug was not in the expected format.

The error I saw from rclone was generic:

rclone copy ~/DPhotos "permanent-prod:/archives/asdf(0974-0000)/My Files/test/DPhotos" --progress --fast-list --links --inplace --size-only --sftp-set-modtime=false --exclude '.DS_Store'
2025/05/16 10:21:37 Failed to create file system for "permanent-prod:/archives/asdf(0974-0000)/My Files/test/DPhotos": stat failed: sftp: "An error occurred when attempting to load this path from Permanent.org." (SSH_FX_FAILURE)

But in the logs I saw something more specific:

May 16 14:21:37 sftp-prod node[29803]: 5/16/2025, 2:21:37 PM debug: The specified path did not contain an archive slug
May 16 14:21:37 sftp-prod node[29803]: Error: The specified path did not contain an archive slug
May 16 14:21:37 sftp-prod node[29803]:     at getArchiveSlugFromPath (/data/www/sftp-service/build/utils/getArchiveSlugFromPath.js:11:11)
May 16 14:21:37 sftp-prod node[29803]:     at PermanentFileSystem.loadArchiveIdFromPath (/data/www/sftp-service/build/classes/PermanentFileSystem.js:352:59)
May 16 14:21:37 sftp-prod node[29803]:     at PermanentFileSystem.findFolderInParentDirectory (/data/www/sftp-service/build/classes/PermanentFileSystem.js:385:34)
May 16 14:21:37 sftp-prod node[29803]:     at PermanentFileSystem.loadFolder (/data/www/sftp-service/build/classes/PermanentFileSystem.js:418:37)
May 16 14:21:37 sftp-prod node[29803]:     at PermanentFileSystem.getFileSystemObjectType (/data/www/sftp-service/build/classes/PermanentFileSystem.js:58:37)
May 16 14:21:37 sftp-prod node[29803]:     at PermanentFileSystem.getFileSystemObjectAttributes (/data/www/sftp-service/build/classes/PermanentFileSystem.js:83:33)
May 16 14:21:37 sftp-prod node[29803]:     at SftpSessionHandler.genericStatHandler (/data/www/sftp-service/build/classes/SftpSessionHandler.js:827:25)
May 16 14:21:37 sftp-prod node[29803]:     at SftpSessionHandler.statHandler (/data/www/sftp-service/build/classes/SftpSessionHandler.js:571:10)
May 16 14:21:37 sftp-prod node[29803]:     at SFTP.emit (node:events:517:28)

That more specific error is more useful and actionable (the slug isn't there, sounds like a typo!), and that's what we should send the user!

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