Skip to content

fleet-nightly: read traffic and accounts from dev2, skip dead sources - #17

Merged
ralyodio merged 1 commit into
mainfrom
fix/fleet-nightly-dev2-sources
Sep 29, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/fleet-nightly-dev2-sources

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

fleet-nightly has failed every night since 2026-09-25 with sql on ywcizjsgrcmhgyplldac -> 404: Resource has been removed. crawlproof moved to dev2 and its Supabase cloud project was deleted. By 09-26 every other property's cloud project was gone as well, so repointing traffic alone would still have left signups and logins empty.

Sources now

  • Traffic: tracker_event_daily_stats in crawlproof's self-hosted Postgres (db.crawlproof.com), CRAWLPROOF_DB_URL in vault fleet-nightly--prod. The tracker site list still comes from crawlproof's API.
  • Accounts: auth.users on each property's dev2 Supabase stack (sb_database_url from the fleet kit's ~/.local/state/dev2-fleet/<site>.json), crawlproof's own DB, and any project still on Supabase cloud (the management API path is kept).
  • Read-only: Node has no Postgres client, so one bun -e process runs every query. Each session is set to transaction read only and checked with show transaction_read_only before its query runs.

Failures: each source may fail on its own. A dead DB or API is skipped and listed under "Sources skipped" in the email. A property that had accounts in the last snapshot but has no source now is named too (tonight: vu1nz.com, whose cloud project was empty and deleted). If traffic is down, the subject says traffic unavailable instead of reporting 0 views. Only a run with no source at all mails a FAILED notice.

Proof (dry runs against the live sources)

  • normal: Fleet nightly, Mon Sep 28: 4,953 views (-25%), 138 signups, 109 logins, 45 tracked, 21 with accounts, 1.9 s under env -i (secrets from the vault)
  • a bad traffic password plus one unreachable stack: the email still builds, with traffic unavailable, 77 signups, 35 logins, traffic skipped (… password authentication failed) and ugig.net (Failed to connect) named

🤖 Generated with Claude Code

Every run since 2026-09-25 died on 'sql on ywcizjsgrcmhgyplldac -> 404
Resource has been removed': crawlproof's Supabase cloud project was deleted
when it moved to dev2, and so was every other property's that night.

- traffic: tracker_event_daily_stats from crawlproof's Postgres on dev2
  (CRAWLPROOF_DB_URL, vault fleet-nightly--prod), through Bun's built-in
  client in a session set read-only and checked before the query runs
- accounts: auth.users on each property's self-hosted stack (URLs from the
  dev2 fleet kit's ~/.local/state/dev2-fleet/<site>.json, plus crawlproof's
  own DB), and any project still on Supabase cloud
- every source may fail alone: a dead database is skipped and named under
  'Sources skipped', and a property that had accounts last time and has no
  source now is named too; only a report with no source at all fails

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 501ebf3 into main Sep 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant