{"record":{"id":"8ac5d659fd3e5e4f","repo":"canopy-network/canopy","slug":"checkpoint-creation-w","errorCode":null,"errorMessage":"checkpoint creation: %w","messagePattern":"checkpoint creation: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"store/store.go","lineNumber":785,"sourceCode":"\t\t\t}\n\t\t\ts.backup.Store(false)\n\t\t\ts.log.Errorf(\"backup failed at height [%d]: %v\", version, err)\n\t\t}()\n\t\t// flush the memtable to SST before checkpointing so the backup does not\n\t\t// depend on WAL replay for recovery (commits use NoSync so WAL records\n\t\t// may not be durable on disk at checkpoint time)\n\t\ts.mu.Lock()\n\t\tversion = s.Version()\n\t\tif err = s.db.Flush(); err != nil {\n\t\t\ts.mu.Unlock()\n\t\t\terr = fmt.Errorf(\"flush before checkpoint: %w\", err)\n\t\t\treturn\n\t\t}\n\t\ts.mu.Unlock()\n\t\t// perform the backup using pebble's checkpointing mechanism which creates a\n\t\t// consistent snapshot of the database at the specified directory\n\t\tif err = s.db.Checkpoint(tempBackupDir); err != nil {\n\t\t\terr = fmt.Errorf(\"checkpoint creation: %w\", err)\n\t\t\treturn\n\t\t}\n\t\t// write the current height to a separate file\n\t\theightFile := filepath.Join(tempBackupDir, \"height.txt\")\n\t\tif err = os.WriteFile(heightFile, fmt.Appendf(nil, \"%d\", version), 0644); err != nil {\n\t\t\terr = fmt.Errorf(\"write height file: %w\", err)\n\t\t\treturn\n\t\t}\n\t\tif err = os.Rename(backupDir, prevBackupDir); err != nil && !os.IsNotExist(err) {\n\t\t\terr = fmt.Errorf(\"rotate backup: %w\", err)\n\t\t\treturn\n\t\t}\n\t\t// promote: atomically move the temp backup into the active slot\n\t\tif err = os.Rename(tempBackupDir, backupDir); err != nil {\n\t\t\terr = fmt.Errorf(\"finalize backup: %w\", err)\n\t\t\treturn\n\t\t}\n\t\tbackupDuration := time.Since(start)","sourceCodeStart":767,"sourceCodeEnd":803,"githubUrl":"https://github.com/canopy-network/canopy/blob/ee8197d91dd410f6592cb650a94c925ee6dc8bad/store/store.go#L767-L803","documentation":"Wrapped failure (fmt.Errorf with %w) around pebble's db.Checkpoint call during store backup: creating the consistent snapshot at tempBackupDir failed. This is a disk-level failure (I/O error, no space, bad path) occurring inside the background backup rotation routine in store.go:785.","triggerScenarios":"Thrown at store/store.go:785 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped pebble error for the root cause (disk full, permissions, invalid path).","Ensure the data directory has free space and write permissions for creating checkpoint directories.","Check that no stale temp backup directory conflicts with tempBackupDir before retrying."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ee8197d91dd410f6592cb650a94c925ee6dc8bad","analyzedAt":"2026-09-06T09:30:15.973Z","contentChangedAt":"2026-09-06T09:30:15.973Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}