Long filename deleted and failing to sync, error "file name too long"

Hi Syncthing team and community,

I have been using ST for several years and find it incredibly useful, thanks for your work building this excellent project :slightly_smiling_face:

I’m writing because I’ve run into a small error I can’t seem to fix starting about a week back. I moved a file with a long name into a subfolder, and it’s subsequently failed to sync. I may have made it worse in my efforts to fix it by pausing ST, deleting the file manually and resuming ST. Restarting ST on both devices multiple times has not resolved the issue.

Environment (LAN):

  • Device A: Windows 10 PC, running Syncthing v2.1.3 (also using Synctrayzor v2.1.0)
  • Device B: Linux NAS (Synology), running Syncthing v2.1.3.

Sequence of events:

  • On device A I moved several files into a subfolder, this resulted in one filename becoming very long (433 chars i believe).
  • Device B the sync failed to sync the change for the single long file (all else synced normally).
  • I tried renaming the file to a much shorter name on device A.
  • Device B still failed to sync the change, still reporting 1 failed item.
  • I tried shift-deleting the file entirely on device A.
  • Device B still failed to sync the change, still reporting 1 failed item.
  • *At this stage, I believe I paused Syncthing on both devices A, deleted the file manually, and restarted syncthing.
  • Device A is still reporting the share is out of sync for that 1 file (1 failed item, “syncing: delete file: CreateFile [long filename ending.sync-conflict-20260827-115626-B5RJLUH.url] The filename, directory name, or volume label syntax is incorrect.”)
  • Device B is still reporting the share is out of sync for that 1 file (1 failed item, “syncing: delete file: simple versioner: archive: remove [long filename ending ~20260827-034825.url] file name too long”.

I’ve searched extensively but can’t find anyone with my specific issue, or specific fixes to rectify the sync state (i dont care if the file is deleted, i have a copy). Any help appreciated!

Log details follow.

Device A error message detail: Web UI failed items: syncing: delete file: CreateFile \\?\C:\Users\username\Syncthing\Documents-Private\!Uni docs\Assignments\!Sem1\folder and file name changed for privacy..er C.sync-conflict-20260827-115226-B5RJLUH.url: The filename, directory name, or volume label syntax is incorrect.

NB: full length of the path for “\\?\C:\Users\username\Syncthing\Documents-Private\!Uni docs\Assignments\!Sem1\folder and file name changed for privacy..er C.sync-conflict-20260827-115226-B5RJLUH.url” is 437 characters.

Logs (via Synctrayzor): 2026-08-27 11:56:26 INF Deleted file (folder.id=Documents-Private folder.type=sendreceive file.name="!Uni docs\*** PATH REMOVED for privacy ***er C.url" error="CreateFile \\?\C:\Users\username\Syncthing\Documents-Private\!Uni docs\*** PATH REMOVED for privacy ***er C.sync-conflict-20260827-115626-B5RJLUH.url: The filename, directory name, or volume label syntax is incorrect." log.pkg=model) 2026-08-27 11:56:26 WRN Failed to sync (path="!Uni docs\Assignments\!Sem1\*** PATH REMOVED for privacy ***er C.url" error="syncing: delete file: CreateFile \\?\C:\Users\username\Syncthing\Documents-Private\!Uni docs\*** PATH REMOVED for privacy ***er C.sync-conflict-20260827-115626-B5RJLUH.url: The filename, directory name, or volume label syntax is incorrect." folder.id=Documents-Private folder.type=sendreceive log.pkg=model) 2026-08-27 11:56:26 INF Folder failed to sync, will be retried (wait=8m0s folder.id=Documents-Private folder.type=sendreceive log.pkg=model)

Device B error message detail: Web UI failed items: syncing: delete file: simple versioner: archive: remove /Syncthing/Documents-Private/.stversions/!Uni docs/Assignments/!Sem1/folder and file name changed for privacy..er C~20260827-034825.url: file name too long

NB: full length of the path from /Syncthing/"to-042026.url

NB: full length of the path for “/Syncthing/Documents-Private/.stversions/!Uni docs/Assignments/!Sem1/folder and file name changed for privacy..er C~20260827-034825.url” is 406 characters.

Logs: 2026-08-27 03:48:25 INF Deleted file (folder.id=Documents-Private folder.type=sendreceive file.name="!Uni docs/Assignments/!Sem1/folder and file name changed for privacy..er C.url" log.pkg=model) 2026-08-27 03:48:25 INF Failed to delete file (folder.id=Documents-Private folder.type=sendreceive file.name="!Uni docs/Assignments/!Sem1/folder and file name changed for privacy..er C.url" error="simple versioner: archive: remove /Syncthing/Documents-Private/.stversions/!Uni docs/Assignments/!Sem1/folder and file name changed for privacy..er C~20260827-034825.url: file name too long" log.pkg=model) 2026-08-27 03:48:25 WRN Failed to sync (path="!Uni docs/Assignments/!Sem1/folder and file name changed for privacy..er C.url" error="syncing: delete file: simple versioner: archive: remove /Syncthing/Documents-Private/.stversions/!Uni docs/Assignments/!Sem1/folder and file name changed for privacy..er C~20260827-034825.url: file name too long" folder.id=Documents-Private folder.type=sendreceive log.pkg=model) 2026-08-27 03:48:25 INF Folder failed to sync, will be retried (wait=32m0s folder.id=Documents-Private folder.type=sendreceive log.pkg=model)

Hi all, with some fiddling I was able to resolve my issue by:

  1. Shortening folder names containing problem file on Device A
    1. Remedied errors on Device A.
    2. Original errors remained unchanged on Device B - now the error file remained alone in the original long folder structure.
  2. Shortening folder names manually on Device B to a temporary path (I could not use exact same folder name as Device A of course as it already existed)
    1. This caused a duplicate of error file in new folder structure to be created on Device A.
    2. Resolved errors on Device B.
  3. Deleted duplicate file in temporary folder path on Device B.
    1. This synchronized deletion of duplicate & temp file path to Device B.
  4. All errors resolved folder sync OK

Hope this helps someone else with similar issues and errors find a solution.

Hello:

I’ve had this ‘issue’ before too: in my case, the original filename was short enough to be synced - but then the versioning timestamp suffix made it too long to then be deleted. I repeatedly deleted it manually, but it kept coming back across my sync cluster - so I’m now applying an Ignore Pattern to prevent it from returning.

<Fanciful Notions, With No Hope Of Me Being Able To Contribute Meaningfully>

Could there be a better way to handle long filenames rather than outright refuse to do anything with them? For example, could a file with a long name be given a non-conflicting truncated name, and then create a text file next to this file detailing the change in filename? At least the actual data would then be synced to a system’s peers, and the change of filename can be easily manually applied as required.

Thanks!