canopy-network/canopy · error

checkpoint creation: %w

Error message

checkpoint creation: %w

What it means

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.

Source

Thrown at store/store.go:785

			}
			s.backup.Store(false)
			s.log.Errorf("backup failed at height [%d]: %v", version, err)
		}()
		// flush the memtable to SST before checkpointing so the backup does not
		// depend on WAL replay for recovery (commits use NoSync so WAL records
		// may not be durable on disk at checkpoint time)
		s.mu.Lock()
		version = s.Version()
		if err = s.db.Flush(); err != nil {
			s.mu.Unlock()
			err = fmt.Errorf("flush before checkpoint: %w", err)
			return
		}
		s.mu.Unlock()
		// perform the backup using pebble's checkpointing mechanism which creates a
		// consistent snapshot of the database at the specified directory
		if err = s.db.Checkpoint(tempBackupDir); err != nil {
			err = fmt.Errorf("checkpoint creation: %w", err)
			return
		}
		// write the current height to a separate file
		heightFile := filepath.Join(tempBackupDir, "height.txt")
		if err = os.WriteFile(heightFile, fmt.Appendf(nil, "%d", version), 0644); err != nil {
			err = fmt.Errorf("write height file: %w", err)
			return
		}
		if err = os.Rename(backupDir, prevBackupDir); err != nil && !os.IsNotExist(err) {
			err = fmt.Errorf("rotate backup: %w", err)
			return
		}
		// promote: atomically move the temp backup into the active slot
		if err = os.Rename(tempBackupDir, backupDir); err != nil {
			err = fmt.Errorf("finalize backup: %w", err)
			return
		}
		backupDuration := time.Since(start)

View on GitHub (pinned to ee8197d91d)

Solutions

  1. Inspect the wrapped pebble error for the root cause (disk full, permissions, invalid path).
  2. Ensure the data directory has free space and write permissions for creating checkpoint directories.
  3. Check that no stale temp backup directory conflicts with tempBackupDir before retrying.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at store/store.go:785 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of canopy-network/canopy@ee8197d91d (2026-09-06). Data as JSON: /api/errors/8ac5d659fd3e5e4f. Report an issue: GitHub.