René's URL Explorer Experiment


Title: fix(webapp): recover from ClickHouse JSON parse failures on out-of-range integers by matt-aitken · Pull Request #3759 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: fix(webapp): recover from ClickHouse JSON parse failures on out-of-range integers by matt-aitken · Pull Request #3759 · triggerdotdev/trigger.dev

X Title: fix(webapp): recover from ClickHouse JSON parse failures on out-of-range integers by matt-aitken · Pull Request #3759 · triggerdotdev/trigger.dev

Description: Summary Second class of poisoned-row failure in the runs replication path. PR #3708 plugged lone UTF-16 surrogates; this one handles bare JSON integer literals outside ClickHouse's Int64..UInt64 range. Recovery stays purely reactive — the existing sanitizeRows walker just gains an extra branch, so the hot replication path pays nothing on healthy rows. Fixes the still-firing customer-facing symptom from TRI-9755: a small number of runs continued to be stranded in EXECUTING on the Tasks page after #3708 deployed. CloudWatch showed Dropped batch — ClickHouse JSON parse error but sanitizer found nothing to fix firing 8/8 times since the previous deploy (zero successful sanitizations). Root cause: upstream JS Number precision loss on a 21-digit Google Plus ID (117039831458782873093 → 117039831458782870000) — the precision-lossy value still serialises as a bare integer that exceeds UInt64.MAX, which ClickHouse rejects with INCORRECT_DATA. How the bug ships The customer task emits an output containing a Poshmark profile's spec_format: {"key":"gp_id","proper_key":"Gp Id","value":117039831458782870000,"type":"int"} That value is 1.17e20 — comfortably above UInt64.MAX (1.84e19) but comfortably below 1e21. Number.prototype.toString only switches to exponential form at |value| >= 1e21, so JSON.stringify emits the bare token 117039831458782870000 and the ClickHouse JSON(max_dynamic_paths) column fails with: Code: 117. DB::Exception: Cannot parse JSON object here: {…}: (while reading the value of key output): (at row 1) : While executing ParallelParsingBlockInputFormat. (INCORRECT_DATA) (version 25.12.x) Same error verbatim as prod. The same number quoted ("117039831458782870000") inserts fine — ClickHouse's dynamic JSON column accepts a String subtype on the same path. What changed apps/webapp/app/v3/eventRepository/sanitizeRowsOnParseError.server.ts: New private isUnsafeJsonInteger(value) helper — true iff value is a finite integer-valued JS Number where |value| < 1e21 (so JSON.stringify emits integer form, not exponent) and value falls outside [Int64.MIN, UInt64.MAX]. sanitizeUnknownInPlace gains a number-branch: when the predicate holds, replace the Number with String(value). The downstream JSON column dynamic-types the path as String for that row — fine, since the value was already precision-lossy upstream (no JS Number above 2^53 is numerically meaningful anyway). Float-valued numbers, large floats (>= 1e21), NaN and Infinity are left alone — JSON.stringify emits them with exponents or as null, both of which ClickHouse accepts. apps/webapp/test/sanitizeRowsOnParseError.test.ts: four new unit tests + an extension to sanitizeRows covering surrogate + integer fixes counted together across rows. The unit suite now covers: Positive value above UInt64.MAX (117039831458782870000 — the actual prod value) Negative value below Int64.MIN Boundary values pass through (42, Number.MAX_SAFE_INTEGER, 2^63) Non-integer numbers untouched (floats, 1e25, NaN, Infinity) The actual scan-social-profiles nested shape — finds the offending gp_id deep inside output.data.profiles[].spec_format[].platform_variables[].value .server-changes/runs-replication-bigint-recovery.md — release notes entry. Why reactive, not pre-flight #prepareJson runs millions of times per day on the replication hot path. Walking every JSON tree to look for oversized integers would add bounded-but-real CPU on every healthy row. sanitizeRows only fires after a ClickHouse parse-error rejection, which is a few times a day platform-wide. Extending it costs effectively zero on healthy traffic and gains us recovery on the rare poisoned row. Verification Reproduced 1:1 in a throwaway Docker clickhouse/clickhouse-server:25.12.11.4 (closest available to the prod 25.12.1.1579 build). Pre-sanitize JSON fails with the exact prod error; post-sanitize JSON inserts cleanly and the row is readable with gp_id stored as a String subtype. pnpm --filter webapp exec vitest run test/sanitizeRowsOnParseError.test.ts — 22/22 passing (18 existing + 4 new). pnpm run typecheck --filter webapp — clean. Test plan pnpm run typecheck --filter webapp Unit tests pass against new + existing cases End-to-end Docker ClickHouse repro confirms recovery Post-deploy: confirm Sanitizing batch after ClickHouse JSON parse error warns fire instead of Dropped batch … errors when scan-social-profiles outputs trip CH again Post-deploy: confirm permanentlyDroppedBatches counter stops climbing in /stp/trigger-app-prod/ecs/replication/service-container/process-logs What this does NOT do Doesn't backfill the ~120k+ existing stranded EXECUTING rows in production. Same as #3708 — that needs a reconciliation/backfill sweep (separate ticket — TRI-9755 fix #3). Doesn't address the upstream root cause (the customer task emitting a JS-Number-precision-lossy big int). That's a customer-task concern; our replication path needs to be robust to whatever shape arrives. 🤖 Generated with Claude Code

Open Graph Description: Summary Second class of poisoned-row failure in the runs replication path. PR #3708 plugged lone UTF-16 surrogates; this one handles bare JSON integer literals outside ClickHouse's Int64..UInt6...

X Description: Summary Second class of poisoned-row failure in the runs replication path. PR #3708 plugged lone UTF-16 surrogates; this one handles bare JSON integer literals outside ClickHouse&#39;s Int64..U...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/3759

X: @github

direct link

Domain: github.com

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:6a63ca5e-122f-d0cb-f07a-42db910b7298
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id998C:228216:10B504:17B036:6AFAF40D
html-safe-nonce13bbd2f8dde986b529ec866d929d93bde42b831ae110f0ced1b0cca9db098d3a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OThDOjIyODIxNjoxMEI1MDQ6MTdCMDM2OjZBRkFGNDBEIiwidmlzaXRvcl9pZCI6IjIwNjU1MDYwNTU2OTI2NzgxNTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac5b2ad2e242b4733caeb711567d26ec7fe66ef39453af1aaa8607f62034b10bbf
hovercard-subject-tagpull_request:3753142375
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/3759/files
twitter:imagehttps://avatars.githubusercontent.com/u/10635986?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/10635986?s=400&v=4
og:image:altSummary Second class of poisoned-row failure in the runs replication path. PR #3708 plugged lone UTF-16 surrogates; this one handles bare JSON integer literals outside ClickHouse's Int64..UInt6...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0178036d8230524a18422872393ab7e708443ae4c2047f758560a2db870c1913
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasea85e96a83bed7871993e6b1ffda24105928eee17
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/3759/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F3759%2Ffiles
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%2Fpull%2F3759%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3759/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3759/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3759/files
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 requests67 (67)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
Sign up for GitHub https://github.com/signup?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
matt-aitkenhttps://github.com/matt-aitken
mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
feature/tri-9755-runs-replication-bigint-recoveryhttps://github.com/triggerdotdev/trigger.dev/tree/feature/tri-9755-runs-replication-bigint-recovery
Conversation 10 https://github.com/triggerdotdev/trigger.dev/pull/3759
Commits 2 https://github.com/triggerdotdev/trigger.dev/pull/3759/commits
Checks 36 https://github.com/triggerdotdev/trigger.dev/pull/3759/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/3759/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3759/files
fix(webapp): recover from ClickHouse JSON parse failures on out-of-range integers https://github.com/triggerdotdev/trigger.dev/pull/3759/files#top
Show all changes 2 commits https://github.com/triggerdotdev/trigger.dev/pull/3759/files
88c9f06 fix(webapp): recover from ClickHouse JSON parse failures on out-of-ra… matt-aitken May 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3759/commits/88c9f06ddfc07e939b5428d61cf4ed7291180fd7
b2cc562 fix(webapp): compare bigint sanitizer boundaries via BigInt for exact… matt-aitken May 27, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3759/commits/b2cc5623503103ecafb171f53211ce2ee462caab
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/3759/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3759/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3759/files
runs-replication-bigint-recovery.md https://github.com/triggerdotdev/trigger.dev/pull/3759/files#diff-da9e48a66fc4e12608882e400059143d101f16360c407c4faf979f92fa68c1cf
sanitizeRowsOnParseError.server.ts https://github.com/triggerdotdev/trigger.dev/pull/3759/files#diff-4d209459ebc0ff63710c764a97f46e6cfda604ee2aacaf6cc9bb255390da9891
sanitizeRowsOnParseError.test.ts https://github.com/triggerdotdev/trigger.dev/pull/3759/files#diff-936a199f8ad54e45d02e7068a496c1ec2543b26cbb4b5144729aaf58058cde3f
.server-changes/runs-replication-bigint-recovery.mdhttps://github.com/triggerdotdev/trigger.dev/pull/3759/files#diff-da9e48a66fc4e12608882e400059143d101f16360c407c4faf979f92fa68c1cf
View file https://github.com/triggerdotdev/trigger.dev/blob/b2cc5623503103ecafb171f53211ce2ee462caab/.server-changes/runs-replication-bigint-recovery.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3759/{{ revealButtonHref }}
apps/webapp/app/v3/eventRepository/sanitizeRowsOnParseError.server.tshttps://github.com/triggerdotdev/trigger.dev/pull/3759/files#diff-4d209459ebc0ff63710c764a97f46e6cfda604ee2aacaf6cc9bb255390da9891
View file https://github.com/triggerdotdev/trigger.dev/blob/b2cc5623503103ecafb171f53211ce2ee462caab/apps/webapp/app/v3/eventRepository/sanitizeRowsOnParseError.server.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3759/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3759/files#diff-4d209459ebc0ff63710c764a97f46e6cfda604ee2aacaf6cc9bb255390da9891
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3759/files
https://github.com/triggerdotdev/trigger.dev/pull/3759/files#diff-4d209459ebc0ff63710c764a97f46e6cfda604ee2aacaf6cc9bb255390da9891
https://github.com/triggerdotdev/trigger.dev/pull/3759/files#diff-4d209459ebc0ff63710c764a97f46e6cfda604ee2aacaf6cc9bb255390da9891
https://github.com/triggerdotdev/trigger.dev/pull/3759/files#diff-4d209459ebc0ff63710c764a97f46e6cfda604ee2aacaf6cc9bb255390da9891
apps/webapp/test/sanitizeRowsOnParseError.test.tshttps://github.com/triggerdotdev/trigger.dev/pull/3759/files#diff-936a199f8ad54e45d02e7068a496c1ec2543b26cbb4b5144729aaf58058cde3f
View file https://github.com/triggerdotdev/trigger.dev/blob/b2cc5623503103ecafb171f53211ce2ee462caab/apps/webapp/test/sanitizeRowsOnParseError.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3759/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3759/files#diff-936a199f8ad54e45d02e7068a496c1ec2543b26cbb4b5144729aaf58058cde3f
https://github.com/triggerdotdev/trigger.dev/pull/3759/files#diff-936a199f8ad54e45d02e7068a496c1ec2543b26cbb4b5144729aaf58058cde3f
https://github.com/triggerdotdev/trigger.dev/pull/3759/files#diff-936a199f8ad54e45d02e7068a496c1ec2543b26cbb4b5144729aaf58058cde3f
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.