coollabsio/coolify · error · RuntimeException

The S3 storage or backup filename is unavailable for upload

Error message

The S3 storage or backup filename is unavailable for upload cleanup.

What it means

cleanupS3Upload() deletes the object uploaded to S3 during a volume backup (when only the S3 copy should remain). It loads the execution's s3 relation and requires a non-blank filename; if either is missing it throws, which leaves the uploaded object orphaned in the bucket.

Source

Thrown at app/Jobs/VolumeBackupRecoveryJob.php:103

            .'if [ "$running" != true ] && ! docker start "$container" >/dev/null; then echo "$container" >> '
            .escapeshellarg($remainingFile).'; status=1; fi; done < '.escapeshellarg($stateFile).'; fi; '
            .'if [ -s '.escapeshellarg($remainingFile).' ]; then mv '.escapeshellarg($remainingFile).' '.escapeshellarg($stateFile)
            .'; else rm -f '.escapeshellarg($stateFile).' '.escapeshellarg($remainingFile).'; fi; exit $status';

        instant_remote_process(['sh -c '.escapeshellarg($script)], $server, disableMultiplexing: true);
        $execution->update([
            'stop_container_ids' => null,
            'stop_recovery_pending' => false,
        ]);
    }

    public static function cleanupS3Upload(ScheduledVolumeBackupExecution $execution): void
    {
        $execution->loadMissing('s3');
        $s3 = $execution->s3;

        if (! $s3 || blank($execution->filename)) {
            throw new \RuntimeException('The S3 storage or backup filename is unavailable for upload cleanup.');
        }

        deleteBackupsS3($execution->filename, $s3);
        $execution->update([
            's3_cleanup_pending' => false,
            's3_storage_deleted' => true,
        ]);
    }

    public static function stateFile(ScheduledVolumeBackupExecution $execution): string
    {
        return '/tmp/coolify-volume-backup-'.$execution->uuid.'.stopped';
    }
}

View on GitHub (pinned to 70b9acc424)

Solutions

  1. Delete the orphaned object manually from the bucket - locate it by the execution uuid / backup filename prefix
  2. Keep (or re-create) the S3 storage row until executions referencing it finish cleanup, since the relation must resolve to delete the object
  3. After upgrading, let pending executions settle before removing storages
Defensive patterns

Strategy: validation

Validate before calling

// guard before queuing S3 cleanup
$execution->loadMissing('s3');
if (! $execution->s3 || blank($execution->filename)) {
    // do not enqueue automated cleanup; queue a manual-deletion alert instead
    send_internal_notification('S3 object needs manual cleanup for execution '.$execution->uuid);
    return;
}

Prevention

When it happens

Trigger: The S3 storage row was deleted between the upload and the cleanup step, or the execution row has a blank filename (e.g. written by an older Coolify version before filename tracking existed).

Common situations: Deleting an S3 storage while a backup execution is mid-run; upgrading Coolify with in-flight executions; executions created before the filename column was populated.

Related errors


AI-assisted analysis of coollabsio/coolify@70b9acc424 (2026-08-17). Data as JSON: /api/errors/5cf8af6dc0d57176. Report an issue: GitHub.