Skip to content

panic "Snapshot(): database is closed" on start after wiping database #7419

Closed

Description

@tomasz1986

I had this panic today when starting Syncthing after wiping the database. By this I mean manually deleting index-v0.14.0.db after completely shutting Syncthing down, and then trying to start it again. The program still probably restarted itself after the panic and continued to work, and I only noticed the log many hours later.

[7LDIB] 2021/03/02 15:37:18 WARNING: Fatal error: ccmsc-zsmeh Snapshot(): database is closed
Panic at 2021-03-02T15:37:19+09:00
panic: database is closed

goroutine 150 [running]:
github.com/syncthing/syncthing/lib/db.fatalError(0x1b4ca40, 0x20f50f4, 0x160e1280, 0x16, 0x128c01e0)
	github.com/syncthing/syncthing/lib/db/set.go:508 +0x14b
github.com/syncthing/syncthing/lib/db.(*FileSet).Snapshot(0x14fa8720, 0x187459b0)
	github.com/syncthing/syncthing/lib/db/set.go:159 +0x220
github.com/syncthing/syncthing/lib/model.(*folder).pull(0x129ad340, 0x12c9bd00)
	github.com/syncthing/syncthing/lib/model/folder.go:333 +0x10d
github.com/syncthing/syncthing/lib/model.(*folder).Serve(0x129ad340, 0x1b56460, 0x150e26a0, 0x0, 0x0)
	github.com/syncthing/syncthing/lib/model/folder.go:173 +0x9a3
github.com/thejerf/suture/v4.(*Supervisor).runService.func2(0x128f7bc0, 0x6, 0x332ab610, 0x129ad340, 0x1b56460, 0x150e26a0, 0x150dca30, 0x150ea400)
	github.com/thejerf/suture/[email protected]/supervisor.go:546 +0x5f
created by github.com/thejerf/suture/v4.(*Supervisor).runService
	github.com/thejerf/suture/[email protected]/supervisor.go:534 +0x12a

panic-20210302-153719.log

Syncthing v1.13.x (self-compiled with a few custom commits, see https://github.com/tomasz1986/syncthing/commits/tomasz86-v1.13.0)

Activity

  1. added
    bug
    needs-triage
    on Mar 2, 2021
  2. imsodin commented on Mar 2, 2021

    @imsodin
    Member

    This is basically a sub-issue of #5907. I have a branch that fixes this particular error.brewing, so lets keep this open so we have something to close then (I am waiting for #7375 before PRing).

  3. self-assigned this
    on Mar 2, 2021
  4. changed the title [-]"Fatal error: xxxxx-xxxxx Snapshot(): database is closed" on start after wiping database[/-] [+]panic "Snapshot(): database is closed" on start after wiping database[/+] on Mar 2, 2021
  5. tomasz1986 commented on Mar 2, 2021

    @tomasz1986
    MemberAuthor

    Thanks for a super quick reply 🙂.

    Just for the record, although kind of off-topic, but the reason for resetting the database is that I want to bring everything to the initial state for further testing of https://forum.syncthing.net/t/folders-stuck-trying-to-sync-existing-files/16121. Just using -reset-deltas doesn't cut it. Either wiping the database or removing and re-adding the folders seems to be required, and the former is just faster.

  6. removed
    needs-triage
    on Mar 7, 2021
  7. added this to the v1.15.0 milestone on Mar 9, 2021
  8. added a commit that references this issue on Mar 11, 2021
    27a8959
  9. added
    frozen-due-to-age
    on Aug 11, 2022
  10. locked and limited conversation to collaborators on Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugfrozen-due-to-age

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions