JuliusBrussee/caveman · error
file changed while opening
Error message
file changed while opening
What it means
Error "file changed while opening" thrown in JuliusBrussee/caveman.
Source
Thrown at engine/ccr/store_sqlite.go:285
if info.Mode()&os.ModeSymlink != 0 || !info.Mode().IsRegular() {
return fmt.Errorf("refusing non-regular file")
}
file, err := os.OpenFile(path, os.O_RDWR, 0)
if errors.Is(err, os.ErrNotExist) && !create {
// The sidecar vanished between Lstat and open — a concurrent process
// checkpointed the WAL and removed it. Nothing left to secure.
return nil
}
if err != nil {
return err
}
defer file.Close()
opened, err := file.Stat()
if err != nil {
return err
}
if !os.SameFile(info, opened) {
return fmt.Errorf("file changed while opening")
}
return file.Chmod(0o600)
}
func configureStorageBudget(db *sql.DB, maxBytes int64) error {
var pageSize int64
if err := db.QueryRow(`PRAGMA page_size`).Scan(&pageSize); err != nil {
return fmt.Errorf("read page size: %w", err)
}
if pageSize <= 0 {
return errors.New("invalid sqlite page size")
}
maxPages := maxBytes / pageSize
if maxPages < 16 {
return fmt.Errorf("budget %d is below SQLite minimum %d", maxBytes, 16*pageSize)
}
var applied int64
if err := db.QueryRow(fmt.Sprintf(`PRAGMA max_page_count=%d`, maxPages)).Scan(&applied); err != nil {View on GitHub (pinned to 27d5a3981a)
Solutions
- The file changed while opening; retry the operation.
When it happens
Trigger: Thrown at engine/ccr/store_sqlite.go:285 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15).
Data as JSON: /api/errors/022026338ea130da.
Report an issue: GitHub.