I post this observation here as it might come handy for others who see the same error.
I recently moved a directory to another place in the file system and created a macOS alias (that is, a Finder alias, and not a link created with
ln -s) in its place. The alias points to the new location.
What I had not in mind was that the directory is the repository root of one of my Duplicacy backups. As a consequence, the backup failed with this error message:
2020-12-29 15:02:36.939 ERROR LIST_FAILURE Failed to list the repository root: readdirent: invalid argument Failed to list the repository root: readdirent: invalid argument
Solution: I removed the macOS alias and created a symbolic link. (Duplicacy does follow symbolic links.) I could also have changed the Backup to use the new repo root. Maybe I do this later.
So whenever you run across an “invalid argument” error on macOS, verify if a macOS Alias file is the culprit.