Here’s the last panic up and including to the first callstack:
[start] INFO: syncthing v1.12.1 "Fermium Flea" (go1.15.6 linux-arm) deb@build.syncthing.net 2020-12-06 12:46:27 UTC [noupgrade]
[start] INFO: Database was marked for repair - this may take a while
[LETOB] INFO: My ID: LETOB3N-ZJUZXZT-GLWT22B-CLX6BSH-OGKJ3H4-FA7DOWH-Z7RENBZ-2WO6NAI
[LETOB] INFO: Single thread SHA256 performance is 45 MB/s using minio/sha256-simd (45 MB/s using crypto/sha256).
[LETOB] INFO: Hashing performance is 40.48 MB/s
[LETOB] INFO: Overall send rate is unlimited, receive rate is unlimited
[LETOB] INFO: Using discovery mechanism: global discovery server https://discovery.syncthing.net/v2/?noannounce&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW
[LETOB] INFO: Using discovery mechanism: global discovery server https://discovery-v4.syncthing.net/v2/?nolookup&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW
[LETOB] INFO: Using discovery mechanism: global discovery server https://discovery-v6.syncthing.net/v2/?nolookup&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW
[LETOB] INFO: Using discovery mechanism: IPv4 local broadcast discovery on port 21027
...
[LETOB] INFO: Using discovery mechanism: IPv6 local multicast discovery on address [ff12::8384]:21027
[LETOB] INFO: QUIC listener ([::]:22000) starting
[LETOB] INFO: TCP listener ([::]:22000) starting
[LETOB] INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
[LETOB] INFO: GUI and API listening on [::]:8384
[LETOB] INFO: Access the GUI via the following URL: http://127.0.0.1:8384/
[LETOB] INFO: My name is "rpi-4b"
[LETOB] INFO: Device HS4SPRW-3CPGSEF-52LDZAO-EZ3SFE6-E7E2YVT-6E72S3U-GMAVMQQ-4IUU3AF is "synology" at [dynamic]
[LETOB] INFO: Ready to synchronize "projects" (a4dtg-k6tve) (sendreceive)
[LETOB] INFO: Established secure connection to HS4SPRW-3CPGSEF-52LDZAO-EZ3SFE6-E7E2YVT-6E72S3U-GMAVMQQ-4IUU3AF at 192.168.1.113:22000-192.168.1.111:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256
[LETOB] INFO: Device HS4SPRW-3CPGSEF-52LDZAO-EZ3SFE6-E7E2YVT-6E72S3U-GMAVMQQ-4IUU3AF client is "syncthing v1.12.1" named "synology" at 192.168.1.113:22000-192.168.1.111:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256
[LETOB] INFO: Device HS4SPRW-3CPGSEF-52LDZAO-EZ3SFE6-E7E2YVT-6E72S3U-GMAVMQQ-4IUU3AF folder "projects" (a4dtg-k6tve) has mismatching index ID for us (0x40604A8A1DACE522 != 0x7A9FDEDADF5078E7)
[LETOB] INFO: Device HS4SPRW-3CPGSEF-52LDZAO-EZ3SFE6-E7E2YVT-6E72S3U-GMAVMQQ-4IUU3AF folder "projects" (a4dtg-k6tve) has a new index ID (0x7A9FDEDADF5078E7)
[LETOB] INFO: Ready to synchronize "video" (cvz7k-a9gec) (sendreceive)
[LETOB] INFO: Device HS4SPRW-3CPGSEF-52LDZAO-EZ3SFE6-E7E2YVT-6E72S3U-GMAVMQQ-4IUU3AF folder "video" (cvz7k-a9gec) has mismatching index ID for us (0x652C123A53D2B095 != 0x9139F166B81DD88B)
[LETOB] INFO: Device HS4SPRW-3CPGSEF-52LDZAO-EZ3SFE6-E7E2YVT-6E72S3U-GMAVMQQ-4IUU3AF folder "video" (cvz7k-a9gec) has a new index ID (0x9139F166B81DD88B)
[LETOB] WARNING: Fatal error: cvz7k-a9gec Drop(HS4SPRW-3CPGSEF-52LDZAO-EZ3SFE6-E7E2YVT-6E72S3U-GMAVMQQ-4IUU3AF): device present in global list but missing as device/fileinfo entry
Panic at 2021-01-31T20:51:10Z
panic: device present in global list but missing as device/fileinfo entry
goroutine 192 [running]:
github.com/syncthing/syncthing/lib/db.obfuscateAndPanic(0xd216d0, 0x2898c90)
github.com/syncthing/syncthing/lib/db/lowlevel.go:1171 +0x6c
github.com/syncthing/syncthing/lib/db.fatalError(0xd216d0, 0x2898c90, 0x126195c0, 0x51, 0x362fc00)
github.com/syncthing/syncthing/lib/db/set.go:500 +0x11c
github.com/syncthing/syncthing/lib/db.(*FileSet).Drop(0x11d7dbc0, 0xc627b93c, 0x22cd13db, 0x401e4b77, 0x297267e2, 0x156bf209, 0x4bfd899f, 0xc82a6066, 0x36a58843)
github.com/syncthing/syncthing/lib/db/set.go:61 +0x6a4
github.com/syncthing/syncthing/lib/model.(*indexSenderRegistry).addLocked(0x8132e60, 0x28275d0, 0xb, 0x28275e8, 0x5, 0x0, 0x2827600, 0xb, 0x0, 0x1260cb40, ...)
github.com/syncthing/syncthing/lib/model/indexsender.go:302 +0x8d4
github.com/syncthing/syncthing/lib/model.(*indexSenderRegistry).add(0x8132e60, 0x28275d0, 0xb, 0x28275e8, 0x5, 0x0, 0x2827600, 0xb, 0x0, 0x1260cb40, ...)
github.com/syncthing/syncthing/lib/model/indexsender.go:241 +0x54
github.com/syncthing/syncthing/lib/model.(*model).ccHandleFolders(0x29c6c40, 0xef3c240, 0x6, 0x8, 0xc627b93c, 0x22cd13db, 0x401e4b77, 0x297267e2, 0x156bf209, 0x4bfd899f, ...)
github.com/syncthing/syncthing/lib/model/model.go:1319 +0x4d8
github.com/syncthing/syncthing/lib/model.(*model).ClusterConfig(0x29c6c40, 0xc627b93c, 0x22cd13db, 0x401e4b77, 0x297267e2, 0x156bf209, 0x4bfd899f, 0xc82a6066, 0x36a58843, 0xef3c240, ...)
github.com/syncthing/syncthing/lib/model/model.go:1186 +0x510
github.com/syncthing/syncthing/lib/protocol.(*rawConnection).dispatcherLoop(0x844a630, 0x0, 0x0)
github.com/syncthing/syncthing/lib/protocol/protocol.go:429 +0x894
github.com/syncthing/syncthing/lib/protocol.(*rawConnection).Start.func2(0x844a630)
github.com/syncthing/syncthing/lib/protocol/protocol.go:262 +0x1c
created by github.com/syncthing/syncthing/lib/protocol.(*rawConnection).Start
github.com/syncthing/syncthing/lib/protocol/protocol.go:261 +0x64
That’s followed by another 117 callstacks.
There are six folders in all - in addition to “projects” and “video” mentioned in the log file there’s also “personal”, “photos”, “software” and “sync”. I have two instances of syncthing connected together - “synology” (which is my home NAS device) and “rpi-4b” (which I use as a backup/portable NAS) and is where the problem is.
The latter had been turned off for a few months and upon booting it up again it had about 1.5 TB of data to sync from synology. It had made good progress on that (about 600 GB I think), but then suddenly lost power due to a dodgy connector and presumably corrupted the database in the process.
I have now noticed that back on synology lots of copies of files have started appearing in folders which they don’t belong in. Looking in the Syncthing log on the NAS there are lots of lines like this:
[HS4SP] 22:13:20 INFO: Puller (folder "video" (cvz7k-a9gec), item "(2013-02-04) Thailand/DSC01936_IMG_20130216_092312.jpg"): syncing: no connected device has the required version of this file
[HS4SP] 22:13:20 INFO: Puller (folder "video" (cvz7k-a9gec), item "(2012-02-26) India - Varanasi to Banbassa/DSC00099.JPG"): syncing: no connected device has the required version of this file
[HS4SP] 22:13:20 INFO: Puller (folder "video" (cvz7k-a9gec), item "(2019-08-15) Brittany/IMG_20190821_114426.jpg"): syncing: no connected device has the required version of this file
[HS4SP] 22:13:20 INFO: Puller (folder "video" (cvz7k-a9gec), item "(2016-05-14) Naomi/DSC_0015.JPG"): syncing: no connected device has the required version of this file
[HS4SP] 22:13:20 INFO: Puller (folder "video" (cvz7k-a9gec), item "(2012-02-26) India - Varanasi to Banbassa/AAA_IMG_4410.JPG"): syncing: no connected device has the required version of this file
[HS4SP] 22:13:20 INFO: Puller (folder "video" (cvz7k-a9gec), item "(2020-05-30) Garden/DSC_0036.JPG"): syncing: no connected device has the required version of this file
[HS4SP] 22:13:20 INFO: Puller (folder "video" (cvz7k-a9gec), item "(2013-02-04) Thailand/DSC02189.JPG"): syncing: no connected device has the required version of this file
[HS4SP] 22:13:20 INFO: Puller (folder "video" (cvz7k-a9gec), item "(2019-08-15) Brittany/IMG_20190818_142510.jpg"): syncing: no connected device has the required version of this file
Those files live in the “photos” folder but somehow it thinks there should also be copied of them in the “video” folder now too and this cross-pollination is happening between most of the folders. Maybe somehow Syncthing on rpi-4b combined the indexes from multiple folders and told Syncthing on synology about them before I stopped it running?
I’ll leave rpi-4b alone for now in case you require any more information from it in order to help diagnose the bug.
As synology seems to now think it should have all sorts of extra files I think I should wipe Synthing’s indexes on there, remove the duplicate files, then rebuild the indexes from scratch.