JuliusBrussee/caveman · error · ErrBudgetExceeded
ccr typed object put
Error message
ccr typed object put: %w
What it means
Wraps either the existing-row size SELECT or the INSERT failure inside PutObject, including the full-disk/budget-full remap to ErrBudgetExceeded. It means the typed object could not be stored under the configured budget or the write itself failed.
Solutions
- If the wrapped error is ErrBudgetExceeded, archive or evict old objects to free budget, or raise CAVEMAN_CCR_MAX_BYTES
- Check for locks from concurrent writers and retry
- Reduce the object's stored size (shorter data payload)
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at engine/ccr/store_sqlite.go:513 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18).
Data as JSON: /api/errors/b69f71c8f0979cc0.
Report an issue: GitHub.
Appendix: source
Thrown at engine/ccr/store_sqlite.go:513
return "", err
}
deps, err := json.Marshal(obj.Dependencies)
if err != nil {
return "", fmt.Errorf("ccr typed object dependencies: %w", err)
}
used, err := s.storageBytes()
if err != nil {
return "", fmt.Errorf("ccr typed object budget: %w", err)
}
var existingBytes int64
err = s.db.QueryRow(`SELECT length(data)+length(dependencies_json) FROM typed_objects WHERE object_id=?`, obj.ID).Scan(&existingBytes)
if errors.Is(err, sql.ErrNoRows) {
existingBytes = 0
} else if err != nil {
return "", fmt.Errorf("ccr typed object budget: %w", err)
}
if used-existingBytes+int64(len(obj.Data)+len(deps)) > s.maxBytes {
return "", fmt.Errorf("ccr typed object put: %w", ErrBudgetExceeded)
}
result, err := s.db.Exec(
`INSERT INTO typed_objects (
object_id, object_type, content_hash, source, created_at, repository_state,
session_id, transform_version, currentness, lifecycle, dependencies_json,
original_byte_length, stored_byte_length, data
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)
ON CONFLICT(object_id) DO NOTHING`,
obj.ID, obj.Type, obj.ContentHash, obj.Source, obj.CreatedAt.Format(time.RFC3339Nano),
obj.RepositoryState, obj.SessionID, obj.TransformVersion, obj.Currentness,
obj.Lifecycle, string(deps), obj.OriginalByteLength, obj.StoredByteLength, obj.Data,
)
if err != nil {
if isFull(err) {
return "", fmt.Errorf("ccr typed object put: %w", ErrBudgetExceeded)
}
return "", fmt.Errorf("ccr typed object put: %w", err)
}View on GitHub (pinned to 766dce6b13)