From 43cc4e846e39a6c863040dd5e991fbd350c0b4d1 Mon Sep 17 00:00:00 2001 From: abraunegg Date: Sat, 7 Mar 2026 08:42:46 +1100 Subject: [PATCH] Fix Bug #3646: broken symlinks log error despite 'skip_symlinks = true' (#3656) Ensure symbolic links are skipped at the start of syncEngine.scanPathForNewData() when skip_symlinks = "true" is configured. This prevents filesystem checks such as exists() and isDir() from being performed on dangling symlinks, which could trigger errors like "No such file or directory" during local scans. --- src/sync.d | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/sync.d b/src/sync.d index bbe8394f..5a1aece1 100644 --- a/src/sync.d +++ b/src/sync.d @@ -7718,8 +7718,17 @@ class SyncEngine { logKey = generateAlphanumericString(); displayFunctionProcessingStart(thisFunctionName, logKey); } - - // Add a processing '.' + + // Skip symlinks as early as possible, including dangling symlinks + if (isSymlink(path)) { + // Should this path be skipped? + if (appConfig.getValueBool("skip_symlinks")) { + if (verboseLogging) {addLogEntry("Skipping item - skip symbolic links configured: " ~ path, ["verbose"]);} + return; + } + } + + // Add a processing '.' if path exists if (exists(path)) { if (isDir(path)) { if (!appConfig.suppressLoggingOutput) { @@ -7764,7 +7773,7 @@ class SyncEngine { return; } } - + // A short lived item that has already disappeared will cause an error - is the path still valid? if (!exists(path)) { addLogEntry("Skipping path - path has disappeared: " ~ path);