Summary
pkg/app/app.go can panic during startup when the configured BoltDB file already exists.
Problem
The bootstrap path uses os.OpenFile(..., os.O_EXCL) and can call fh.Close() when fh is nil on EEXIST.
Scope
- Guard
Close() so it only runs when a valid file handle exists
- Keep existing-file path non-fatal
- Add a regression test for pre-existing DB file
Acceptance Criteria
- Startup with an existing BoltDB file does not panic
- Regression test covers the existing-file path
make tests passes for affected package
References
Summary
pkg/app/app.gocan panic during startup when the configured BoltDB file already exists.Problem
The bootstrap path uses
os.OpenFile(..., os.O_EXCL)and can callfh.Close()whenfhis nil onEEXIST.Scope
Close()so it only runs when a valid file handle existsAcceptance Criteria
make testspasses for affected packageReferences
pkg/app/app.go:273