René's URL Explorer Experiment


Title: bug: a database outage longer than ~30 seconds permanently stops cron schedules (self-hosted) · Issue #5120 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: bug: a database outage longer than ~30 seconds permanently stops cron schedules (self-hosted) · Issue #5120 · triggerdotdev/trigger.dev

X Title: bug: a database outage longer than ~30 seconds permanently stops cron schedules (self-hosted) · Issue #5120 · triggerdotdev/trigger.dev

Description: Provide environment information Self-hosted Trigger.dev v4.8.3 (Docker Compose), linux/arm64 External PostgreSQL reached through a TCP proxy, Redis 7 The same code is in v4.8.5 and on main as of 2026-11-12 Describe the bug A short Postgr...

Open Graph Description: Provide environment information Self-hosted Trigger.dev v4.8.3 (Docker Compose), linux/arm64 External PostgreSQL reached through a TCP proxy, Redis 7 The same code is in v4.8.5 and on main as of 20...

X Description: Provide environment information Self-hosted Trigger.dev v4.8.3 (Docker Compose), linux/arm64 External PostgreSQL reached through a TCP proxy, Redis 7 The same code is in v4.8.5 and on main as of 20...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/issues/5120

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: a database outage longer than ~30 seconds permanently stops cron schedules (self-hosted)","articleBody":"### Provide environment information\n\n- Self-hosted Trigger.dev v4.8.3 (Docker Compose), linux/arm64\n- External PostgreSQL reached through a TCP proxy, Redis 7\n- The same code is in v4.8.5 and on `main` as of 2026-11-12\n\n### Describe the bug\n\nA short PostgreSQL outage permanently stops cron schedules. Ours lasted about 35 seconds and stopped 8 of 123 active schedules. They never fired again until we called the admin recover endpoint (`/admin/api/v1/environments/{id}/schedules/recover`). Nothing in the dashboard shows that a schedule has stopped.\n\nWhy it happens:\n\n1. Each tick is one schedule-engine worker job, `schedule.triggerScheduledTask`. The next tick is only registered at the end of a successful handler (`ScheduleEngine.triggerScheduledTask` → `registerNextTaskScheduleInstance`).\n2. `scheduleWorkerCatalog` gives that job `retry: { maxAttempts: 5 }` (`internal-packages/schedule-engine/src/engine/workerCatalog.ts`). With the redis-worker defaults (factor 2, 1 s base, randomized) all five attempts finish in about 15–30 seconds.\n3. If PostgreSQL is unreachable for that whole window, the job goes to the dead-letter queue. No job exists for the instance any more, so nothing registers the next tick. The chain is broken for good.\n4. The handler is called with `finalAttempt: false, // TODO: implement retry logic` (`internal-packages/schedule-engine/src/engine/index.ts`), so there is no last-attempt fallback.\n\n### Reproduction repo\n\nNo repo needed; this reproduces on a stock self-hosted install.\n\n### To reproduce\n\n1. Self-host v4.8.3 with a few `* * * * *` schedules in a production environment.\n2. Stop PostgreSQL for about 75 seconds, starting just before a minute boundary. Then start it again.\n3. Check Redis. Most schedules now have no entry in `schedule:schedule:{queue:schedule-engine-worker:}items` and one in `…dlq`. They never fire again.\n\nIn an isolated test with four schedules, three stopped permanently after a 76 second outage.\n\n### Suggested fix\n\n- **Reconcile periodically.** Run the existing `recoverSchedulesInEnvironment` logic on a timer for all active, non-development instances, using `enqueueOnce` so a live job is never replaced. This makes the chain self-healing whatever the cause. We run a 60 second loop as a local patch; with it, a 12 minute outage recovered six seconds after PostgreSQL returned, with no duplicate runs.\n- **A longer retry budget for this job**, for example `maxAttempts: 15` with `maxTimeoutInMs: 60_000` (about 9–10 minutes). A short outage then costs a late tick instead of a lost schedule. `calculateNextSchedulableOccurrence` already skips expired slots, so there is no backlog replay.\n- **An idempotency key on the scheduled trigger** (instance id + schedule time). Today a retry after \"trigger succeeded, next-tick registration failed\" can trigger the same slot twice, and a longer retry budget makes that more likely.\n- **Make it visible.** A metric or dashboard state for \"active schedule with no pending job\" would surface this.\n\n### Additional information\n\nThe webapp log at the time showed `Failed to trigger scheduled task` and then `Failed to register schedule instance`, both with Prisma `Can't reach database server`, for each affected instance. The dead-letter entries carry the same error with `attempt: 4`.\n","author":{"url":"https://github.com/shrinidhi4u","@type":"Person","name":"shrinidhi4u"},"datePublished":"2026-11-12T06:09:59Z","url":"https://github.com/triggerdotdev/trigger.dev/issues/5120"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0fee1b3c-6baf-70a6-6f4c-74a3e4d3b083
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDE10:22F43A:FAA857:15F3B79:6AFAD890
html-safe-nonceafa6cb061303bb209fa54b0de8faf86b973a686e60e6c150173410d8ed26d78e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTEwOjIyRjQzQTpGQUE4NTc6MTVGM0I3OTo2QUZBRDg5MCIsInZpc2l0b3JfaWQiOiI4MTU0MjAzMjg5NjY3OTUwNzM2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac6face34a2a464c0e9edea829f38c9b4bcb36a75858a6883e37d1a64b4746efff
hovercard-subject-tagissue:6344002786
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/triggerdotdev/trigger.dev/5120/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8a9bbe6692a7f799f3a163107d8aba3414c5cf9fce5075b45820232c78822104/triggerdotdev/trigger.dev/issues/5120
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8a9bbe6692a7f799f3a163107d8aba3414c5cf9fce5075b45820232c78822104/triggerdotdev/trigger.dev/issues/5120
og:image:altProvide environment information Self-hosted Trigger.dev v4.8.3 (Docker Compose), linux/arm64 External PostgreSQL reached through a TCP proxy, Redis 7 The same code is in v4.8.5 and on main as of 20...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameshrinidhi4u
hostnamegithub.com
expected-hostnamegithub.com
None02f4c00e74911c7cd779fc232c3130cee49eb39fd0ed4bfe3eea3b82c7c18084
turbo-cache-controlno-preview
go-importgithub.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id572570113
octolytics-dimension-repository_nwotriggerdotdev/trigger.dev
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id572570113
octolytics-dimension-repository_network_root_nwotriggerdotdev/trigger.dev
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release33c41e9d150e44415272934d676dc63c57d89c3b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/issues/5120#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2F5120
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2F5120
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/issues/5120
Reloadhttps://github.com/triggerdotdev/trigger.dev/issues/5120
Reloadhttps://github.com/triggerdotdev/trigger.dev/issues/5120
triggerdotdevhttps://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Codehttps://github.com/triggerdotdev/trigger.dev
Issues203 (203)https://github.com/triggerdotdev/trigger.dev/issues
Pull requests65 (65)https://github.com/triggerdotdev/trigger.dev/pulls
Discussionshttps://github.com/triggerdotdev/trigger.dev/discussions
Actionshttps://github.com/triggerdotdev/trigger.dev/actions
Projectshttps://github.com/triggerdotdev/trigger.dev/projects
Security and quality39 (39)https://github.com/triggerdotdev/trigger.dev/security
Insightshttps://github.com/triggerdotdev/trigger.dev/pulse
https://github.com/triggerdotdev/trigger.dev
New issuehttps://github.com/login?return_to=https://github.com/triggerdotdev/trigger.dev/issues/5120
New issuehttps://github.com/login?return_to=https://github.com/triggerdotdev/trigger.dev/issues/5120
bug: a database outage longer than ~30 seconds permanently stops cron schedules (self-hosted)https://github.com/triggerdotdev/trigger.dev/issues/5120#top
https://github.com/shrinidhi4u
shrinidhi4uhttps://github.com/shrinidhi4u
on Nov 12, 2026https://github.com/triggerdotdev/trigger.dev/issues/5120#issue-6344002786
https://github.com/umeraamir69
umeraamir69https://github.com/umeraamir69
on Nov 14, 2026https://github.com/triggerdotdev/trigger.dev/issues/5120#issuecomment-6873132830
https://github.com/umeraamir69/trigger.dev/tree/fix/schedule-cron-outage-5120https://github.com/umeraamir69/trigger.dev/tree/fix/schedule-cron-outage-5120
#5128https://github.com/triggerdotdev/trigger.dev/pull/5128
https://github.com/shohair
shohairhttps://github.com/shohair
on Nov 15, 2026https://github.com/triggerdotdev/trigger.dev/issues/5120#issuecomment-6886847408
Sign up for freehttps://github.com/signup?return_to=https://github.com/triggerdotdev/trigger.dev/issues/5120
Sign in to commenthttps://github.com/login?return_to=https://github.com/triggerdotdev/trigger.dev/issues/5120
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.