Skip to content

panic: string field contains invalid UTF-8 [recovered] #9913

Closed

Description

@m23project

What happened?

Hi,

Syncthing crashes with "panic: string field contains invalid UTF-8 [recovered]" since a few days. I'm running Syncthing on Debian 12 and Linux Mint 22 64 bit PCs and one Rapspberry Pi OS (32 bit), that is used for encrypted storing and broadcasting the synced directories.The crash happens on all machines but the Pi.

The setup worked for about 3 years without problem. I used ISO-8859-15 for filename encoding before the crash happened and converted the filenames to UTF-8 now in case that it could cause the problem. But the crash still happened.

I tried syncthing -reset-database and syncthing --verbose and enabling debugging in the config.xml, but it didn't help or didn't give me hints how to resolv the issue by myselv.

By changing the contents of a synced directory it seems that Syncthing crashes when scanning a subdirectory name that contains an "ü".

Would be great, if it can be fixed or if you could give a hint what changes I should do locally (eg. configuration).

Thank you,
Hauke

Syncthing version

v1.29.1

Platform & operating system

Debian 12 AMD64, Linux Mint 22 AMD64

Browser version

No response

Relevant log output

[EEZTP] 2025/01/10 15:03:54 WARNING: Aborted scan due to an unexpected error: context canceled
panic: string field contains invalid UTF-8 [recovered]
[monitor] 2025/01/10 15:03:54 WARNING: Panic detected, writing to "/home/test/.local/state/syncthing/panic-20250110-150354.log"
[monitor] 2025/01/10 15:03:54 WARNING: Please check for existing issues with similar panic message at https://github.com/syncthing/syncthing/issues/
[monitor] 2025/01/10 15:03:54 WARNING: If no issue with similar panic message exists, please create a new issue with the panic log attached
[monitor] 2025/01/10 15:03:54 INFO: Syncthing exited: exit status 2
[monitor] 2025/01/10 15:03:55 WARNING: 4 restarts in 7.119028171s; not retrying further

Activity

  1. added
    bug
    needs-triage
    on Jan 10, 2025
  2. calmh commented on Jan 10, 2025

    @calmh
    Member

    Can you paste the full first "paragraph" of the panic trace please?

  3. m23project commented on Jan 10, 2025

    @m23project
    Author

    I anonymised the output a bit, but it shouldn't change the tenor of it:

    [start] 2025/01/10 17:30:05 INFO: syncthing v1.29.1 "Gold Grasshopper" (go1.23.4 linux-amd64) [email protected] 2025-01-09 20:47:10 UTC [noupgrade]
    [EEZTP] 2025/01/10 17:30:05 INFO: My ID: EEZTPIA-...
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Starting up (/home/test/.config/syncthing)
    [EEZTP] 2025/01/10 17:30:05 INFO: Hashing performance is 1159.06 MB/s
    [EEZTP] 2025/01/10 17:30:05 INFO: Overall send rate is unlimited, receive rate is unlimited
    [EEZTP] 2025/01/10 17:30:05 INFO: Using discovery mechanism: IPv4 local broadcast discovery on port 21027
    [EEZTP] 2025/01/10 17:30:05 INFO: Using discovery mechanism: IPv6 local multicast discovery on address [ff12::8384]:21027
    [EEZTP] 2025/01/10 17:30:05 INFO: Ready to synchronize "matrix23-sync" (cpaem-...) (sendreceive)
    [EEZTP] 2025/01/10 17:30:05 INFO: TCP listener ([::]:2233) starting
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Listen address tcp://0.0.0.0:2233 resolution has changed: lan addresses: [tcp://0.0.0.0:2233 tcp://192.168.178.177:2233] wan addresses: [tcp://0.0.0.0:0 tcp://0.0.0.0:2233]
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Folder "cpaem-..." is now scan-waiting
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Folder "cpaem-..." is now scanning
    [EEZTP] 2025/01/10 17:30:05 INFO: Ready to synchronize "Weisheit-Video" (epbpc-...) (sendreceive)
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Folder "epbpc-..." is now scan-waiting
    [EEZTP] 2025/01/10 17:30:05 INFO: Ready to synchronize "keepass" (gnkcd-...) (sendreceive)
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Folder "epbpc-..." is now scanning
    [EEZTP] 2025/01/10 17:30:05 INFO: GUI and API listening on 127.0.0.1:8384
    [EEZTP] 2025/01/10 17:30:05 INFO: Access the GUI via the following URL: hclient6://localhost:8384/
    [EEZTP] 2025/01/10 17:30:05 INFO: My name is "tux09"
    [EEZTP] 2025/01/10 17:30:05 INFO: Device YU3UVTG-... is "client2" at [dynamic]
    [EEZTP] 2025/01/10 17:30:05 INFO: Device DI3HEJ6-... is "client5" at [tcp://client5]
    [EEZTP] 2025/01/10 17:30:05 INFO: Device LFDAIR5-... is "client3" at [dynamic]
    [EEZTP] 2025/01/10 17:30:05 INFO: Device MZ5UBGZ-... is "client4" at [dynamic]
    [EEZTP] 2025/01/10 17:30:05 INFO: Device PODUW3J-... is "client1" at [dynamic]
    [EEZTP] 2025/01/10 17:30:05 INFO: Device S7P7Z4V-... is "client6" at [dynamic]
    [EEZTP] 2025/01/10 17:30:05 INFO: Device U5F76TX-... is "pi" at [tcp4://192.168.178.5:2233]
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Startup complete
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Folder "gnkcd-..." is now scan-waiting
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Folder "gnkcd-..." is now scanning
    [EEZTP] 2025/01/10 17:30:05 INFO: Ready to synchronize "Austausch" (qtiws-...) (sendreceive)
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Folder "qtiws-..." is now scan-waiting
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Folder "qtiws-..." is now scanning
    [EEZTP] 2025/01/10 17:30:05 INFO: Ready to synchronize "camset-Konfiguration" (ytfk2-...) (sendreceive)
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Folder "ytfk2-..." is now scan-waiting
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Folder "ytfk2-..." is now scanning
    [EEZTP] 2025/01/10 17:30:05 INFO: Completed initial scan of sendreceive folder "Sync1" (qtiws-...)
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Folder "qtiws-..." is now idle
    [EEZTP] 2025/01/10 17:30:05 INFO: Completed initial scan of sendreceive folder "Sync2" (gnkcd-...)
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Folder "gnkcd-..." is now idle
    [EEZTP] 2025/01/10 17:30:05 INFO: Completed initial scan of sendreceive folder "Sync3" (ytfk2-...)
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Folder "ytfk2-..." is now idle
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Discovered device U5F76TX-... at [tcp4://192.168.178.5:2233]
    [EEZTP] 2025/01/10 17:30:05 INFO: Completed initial scan of sendreceive folder "Sync4" (epbpc-...)
    [EEZTP] 2025/01/10 17:30:05 VERBOSE: Folder "epbpc-..." is now idle
    panic: string field contains invalid UTF-8 [recovered]
    [monitor] 2025/01/10 17:30:05 WARNING: Panic detected, writing to "/home/test/.local/state/syncthing/panic-20250110-173005.log"
    [monitor] 2025/01/10 17:30:05 WARNING: Please check for existing issues with similar panic message at hclient6s://github.com/syncthing/syncthing/issues/
    [monitor] 2025/01/10 17:30:05 WARNING: If no issue with similar panic message exists, please create a new issue with the panic log attached
    [monitor] 2025/01/10 17:30:05 INFO: Syncthing exited: exit status 2

  4. m23project commented on Jan 10, 2025

    @m23project
    Author

    In case it could be helpful:

    panic-20250110-173005.log

  5. calmh commented on Jan 10, 2025

    @calmh
    Member

    Yes that's that one, thank you.

  6. calmh commented on Jan 10, 2025

    @calmh
    Member

    Could you enable scanner debugging on the log tab and run a scan, or set it from the outside before starting Syncthing with export STTRACE=scanner and post the last 20 or so lines before the panic? I'm trying to figure out how a non-UTF8 filename gets to the point where it apparently is...

  7. calmh commented on Jan 10, 2025

    @calmh
    Member

    Also if I may ask, do you have any symlinks to such files (i.e. where the target of the symlink may contain non-utf8 characters)?

  8. m23project commented on Jan 11, 2025

    @m23project
    Author
    [EEZTP] 2025/01/11 11:57:35.495379 walk.go:449: DEBUG: walker/cpaem-...@0xc00023e000 checking: File{Name:"handbücher/selfhtml/inter/index.htm", Sequence:0, Permissions:0644, ModTime:2007-02-11 16:52:49 +0100 CET, Version:{[{EEZTPIA 1736593055}]}, VersionHash:, Length:4007, Deleted:false, Invalid:false, LocalFlags:0x0, NoPermissions:false, BlockSize:131072, NumBlocks:0, BlocksHash:, Platform:{<nil> <nil> <nil> <nil> <nil> <nil>}, InodeChangeTime:2023-09-27 08:53:37.788188729 +0200 CEST}
    [EEZTP] 2025/01/11 11:57:35.495494 walk.go:473: DEBUG: walker/cpaem-...@0xc00023e000 rescan: File{Name:"handbücher/selfhtml/inter/index.htm", Sequence:31959, Permissions:0644, ModTime:2025-01-10 04:05:35 +0100 CET, Version:{[{EEZTPIA 1736593055}]}, VersionHash:, Length:0, Deleted:true, Invalid:false, LocalFlags:0x0, NoPermissions:false, BlockSize:131072, NumBlocks:0, BlocksHash:, Platform:{<nil> <nil> <nil> <nil> <nil> <nil>}, InodeChangeTime:2023-09-27 08:53:37.788188729 +0200 CEST}
    [EEZTP] 2025/01/11 11:57:35.496066 walk.go:476: DEBUG: walker/cpaem-...@0xc00023e000 to hash: handbücher/selfhtml/inter/index.htm File{Name:"handbücher/selfhtml/inter/index.htm", Sequence:0, Permissions:0644, ModTime:2007-02-11 16:52:49 +0100 CET, Version:{[{EEZTPIA 1736593055}]}, VersionHash:, Length:4007, Deleted:false, Invalid:false, LocalFlags:0x0, NoPermissions:false, BlockSize:131072, NumBlocks:0, BlocksHash:, Platform:{<nil> <nil> <nil> <nil> <nil> <nil>}, InodeChangeTime:2023-09-27 08:53:37.788188729 +0200 CEST}
    [EEZTP] 2025/01/11 11:57:35.496156 walk.go:248: WARNING: Aborted scan due to an unexpected error: context canceled
    [EEZTP] 2025/01/11 11:57:35.496202 walk.go:208: DEBUG: walker/cpaem-...@0xc00023e000 real to hash: handbücher/Debian sarge Mailserver Howto - postfix, saslauthd, dovecot imapd_pop3d.html~
    [EEZTP] 2025/01/11 11:57:35.496477 walk.go:248: WARNING: Aborted scan due to an unexpected error: context canceled
    [EEZTP] 2025/01/11 11:57:35.496721 folder.go:925: INFO: Failed initial scan of sendreceive folder "Sync1" (epbpc-...)
    [EEZTP] 2025/01/11 11:57:35.499756 folder.go:925: INFO: Failed initial scan of sendreceive folder "Sync2" (cpaem-...)
    [EEZTP] 2025/01/11 11:57:35.839431 tcp_listen.go:120: INFO: TCP listener ([::]:12345) shutting down
    
  9. m23project commented on Jan 11, 2025

    @m23project
    Author

    I can set the environment variable, but cannot reach any tab in the web ui, because it crashes too early.

    One of the problems is the directory that contains an "ü". The files and directories are in UTF-8 now and symlinks are present.

    PS Syncthing doesn't crash, when I use the binary from the v1.28.1 archive release.

  10. calmh commented on Jan 11, 2025

    @calmh
    Member
  11. m23project commented on Jan 11, 2025

    @m23project
    Author

    This build works for me :-)

  12. m23project commented on Jan 11, 2025

    @m23project
    Author

    Would it be possible to keep some versions in the Debian repository? So it would be possible to install an older version of the package if needed.

  13. thessy commented on Jan 11, 2025

    @thessy

    With upgrade to 1.29.0 via https://apt.syncthing.net I encountered also panic errors.

    Build above does also works for me again.

  14. added a commit that references this issue on Jan 11, 2025
    516f3e2
  15. added this to the v1.29.2 milestone on Jan 12, 2025
  16. added a commit that references this issue on Mar 10, 2025
    70b5f09
  17. added
    frozen-due-to-age
    on Jul 1, 2026
  18. locked and limited conversation to collaborators on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfrozen-due-to-ageneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions