-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Problem
R2 backups are not running automatically despite having:
- ✅ Cron trigger configured (
*/5 * * * *) - ✅ R2 credentials set (R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY, CF_ACCOUNT_ID)
- ✅ R2 bucket mounted successfully
Root Cause
In src/index.ts, the scheduled() function checks for an existing gateway process:
const gatewayProcess = await findExistingMoltbotProcess(sandbox);
if (!gatewayProcess) {
console.log('[cron] Gateway not running yet, skipping sync');
return;
}This creates a chicken-and-egg problem:
- No backup exists in R2 yet (fresh deployment)
- Gateway restart clears all pairing data (ephemeral storage)
- No paired devices = no gateway process
- No gateway process = backup skipped
- Repeat forever - backups never run
Logs
2026-02-08 20:35:26 [cron] Gateway not running yet, skipping sync
2026-02-08 20:30:26 [cron] Gateway not running yet, skipping sync
2026-02-08 20:25:26 [cron] Gateway not running yet, skipping sync
Expected Behaviour
For first-time deployments or after gateway restarts, the backup should:
- Create initial backup even if gateway process isn't running yet, OR
- Start gateway process if needed before backing up, OR
- Provide a manual "Force Backup" button that works (current one also fails)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels