-
Notifications
You must be signed in to change notification settings - Fork 325
Closed
Labels
bugSomething isn't workingSomething isn't workinginstallationissues related to db and steampipe installationissues related to db and steampipe installation
Description
Bug Description
The OCI installer (both DB and FDW) does not check available disk space before beginning installation. If the disk fills up during installation, the system can be left in a broken state with old files deleted but new files incomplete.
Severity: HIGH
Location
pkg/ociinstaller/db.go:16-41(InstallDB function)pkg/ociinstaller/fdw.go:18-45(InstallFdw function)
Problem
The installation process requires significant disk space for:
- Downloading OCI image layers to temp directory
- Extracting/unzipping archives
- Moving files to final destination
Currently, there is no validation that sufficient disk space is available before starting. If disk fills up during any of these steps:
- Temp files may be partially written
- Archives may be partially extracted
- File moves may be incomplete
- Old installation files may already be deleted (see CRITICAL: FDW binary removed before verifying new installation succeeds #4753)
Result: System left in broken state without working database or FDW.
Impact
- Severity: HIGH
- User Impact: Database or FDW installation corrupted, system may be unrecoverable
- Frequency: More common on systems with limited disk space or small partitions
- Affected Operations: All OCI installations (DB, FDW, potentially plugins)
Example Scenario
- User has 500MB free disk space
- New DB version is 400MB compressed, 1.2GB uncompressed
- Installation begins:
- Downloads 400MB to temp (100MB free remaining)
- Attempts to extract 1.2GB (disk full error)
- Old DB files may be deleted, new files incomplete
- System cannot start database
Recommended Fix
Add disk space validation before installation:
func InstallDB(ctx context.Context, dblocation string) (string, error) {
// Check available disk space BEFORE starting
requiredSpace := estimateRequiredSpace(constants.PostgresImageRef)
availableSpace, err := getAvailableDiskSpace(dblocation)
if err != nil {
return "", fmt.Errorf("could not check disk space: %w", err)
}
if availableSpace < requiredSpace {
return "", fmt.Errorf(
"insufficient disk space: need ~%s, have %s available",
humanize.Bytes(requiredSpace),
humanize.Bytes(availableSpace),
)
}
// Proceed with installation...
tempDir := ociinstaller.NewTempDir(dblocation)
// ...
}Space estimate: ~2x archive size (for download + extraction, accounting for compression)
Benefits
- Fail fast with clear error message before partial installation
- Better UX - users know immediately if they need to free up space
- System safety - prevents corrupted installations
- Clear guidance - error message tells user exactly how much space needed
Related Tests
pkg/ociinstaller/db_test.go::TestInstallDB_DiskSpaceExhaustion_BugDocumentation
References
- Task 7 completion report:
.ai/milestones/wave-3-untested-packages/tasks/task-7-ociinstaller-COMPLETED.md - Related to CRITICAL: FDW binary removed before verifying new installation succeeds #4753 (FDW binary removal bug)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinginstallationissues related to db and steampipe installationissues related to db and steampipe installation