René's URL Explorer Experiment


Title: fix(observability): attach the real cause at three error-swallowing sites by waleedlatif1 · Pull Request #6336 · simstudioai/sim · GitHub

Open Graph Title: fix(observability): attach the real cause at three error-swallowing sites by waleedlatif1 · Pull Request #6336 · simstudioai/sim

X Title: fix(observability): attach the real cause at three error-swallowing sites by waleedlatif1 · Pull Request #6336 · simstudioai/sim

Description: Problem Three log sites discard the underlying error. All three were hit in production and each independently blocked root-cause analysis. Sites 1. lib/logs/execution/trace-secret-projection.ts — four bare catch {} blocks fell back to structural-only spans with no reason attached, across ~30 distinct throw sites (node/depth/array limits, cyclic content, non-plain prototypes, accessor properties, ref-fetch failures, budget exceeded). Now each reports which invariant fired. Security: every TraceSecretProjectionError message is a compile-time literal (the ${label} interpolations are all static constants), so logging it is safe. Any other failure originates outside the module and could quote trace content — a SyntaxError from JSON.parse embeds the text it choked on — so those are reported by name only. describeProjectionFailure enforces the split. structuralOnlySpan still strips errorMessage, deliberately. It is a block's error text and routinely embeds resolved secret values (a provider error echoing a URL or header). The structural fallback exists precisely because projection/matching failed, so no redaction can be trusted on that path — retaining it would leak plaintext exactly when redaction is known broken. 2. ExecutionLogger — "Failed to record execution usage to usage_log ledger; charge may be unbilled" logged "error":{}. Error.message/stack are non-enumerable, so Object.assign(entry, { error }) + JSON.stringify in the production logger yields {}. Now logs describeError(error). 3. WorkspaceFileStorage / FetchExternalUrl — same saveError:{} problem, plus uploadWorkspaceFile rethrew new Error(...) without a cause, so Drizzle's Failed query: wrapper — and with it the Postgres SQLSTATE — was unrecoverable. All 137 prod occurrences were the same select ... from "workspace" where id = $1 limit $2 for update in lib/billing/storage/tracking.ts. The rethrow now chains { cause: error } and both sites log describeError, which reports the deepest link's code. If the leading hypothesis (SELECT ... FOR UPDATE routed to a read replica) is right, the next occurrence logs SQLSTATE 25006 and settles it. That hypothesis is not proven here — this change only makes it observable. What is now logged Error names, messages, and driver codes/SQLSTATE. No user data, no secret plaintext, no query parameter values. describeError additionally strips the \nparams: tail that DrizzleQueryError appends to its message, closing a pre-existing leak for every existing caller. Tests 7 new tests, one per behavior; all verified failing with the source changes stashed.

Open Graph Description: Problem Three log sites discard the underlying error. All three were hit in production and each independently blocked root-cause analysis. Sites 1. lib/logs/execution/trace-secret-projection.ts — f...

X Description: Problem Three log sites discard the underlying error. All three were hit in production and each independently blocked root-cause analysis. Sites 1. lib/logs/execution/trace-secret-projection.ts — f...

Opengraph URL: https://github.com/simstudioai/sim/pull/6336

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:d3ec2b5a-17d2-300d-301a-c784f8a298aa
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC9A2:18E6DD:A65281:E4D23C:6AFB502C
html-safe-nonce8127a505c2a95cf0bdbc41be434ee3186febd6ef8498523a364ee5e23e4f71a5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOUEyOjE4RTZERDpBNjUyODE6RTREMjNDOjZBRkI1MDJDIiwidmlzaXRvcl9pZCI6IjYyODI4MDM0MjA4MDk4NzU1MDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac155fc9cf6cdd0e2062eca5acc139f1f34eb0b08eed203b63a01c194b155c8167
hovercard-subject-tagpull_request:4223288846
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/simstudioai/sim/pull/6336/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altProblem Three log sites discard the underlying error. All three were hit in production and each independently blocked root-cause analysis. Sites 1. lib/logs/execution/trace-secret-projection.ts — f...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
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
releasecbf66c024bb6d10e6955baa7413c54cf13a201bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/6336/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6336%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%2Fsimstudioai%2Fsim%2Fpull%2F6336%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=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/6336/files
Reloadhttps://github.com/simstudioai/sim/pull/6336/files
Reloadhttps://github.com/simstudioai/sim/pull/6336/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
fix/error-cause-observabilityhttps://github.com/simstudioai/sim/tree/fix/error-cause-observability
Conversation 3 https://github.com/simstudioai/sim/pull/6336
Commits 1 https://github.com/simstudioai/sim/pull/6336/commits
Checks 2 https://github.com/simstudioai/sim/pull/6336/checks
Files changed https://github.com/simstudioai/sim/pull/6336/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6336/files
fix(observability): attach the real cause at three error-swallowing sites https://github.com/simstudioai/sim/pull/6336/files#top
Show all changes 1 commit https://github.com/simstudioai/sim/pull/6336/files
a5e0276 fix(observability): attach the real cause at three error-swallowing s… waleedlatif1 Aug 6, 2026 https://github.com/simstudioai/sim/pull/6336/commits/a5e0276142716d567c1194f20d321f9f8faf28d8
Clear filters https://github.com/simstudioai/sim/pull/6336/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6336/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6336/files
logger.test.ts https://github.com/simstudioai/sim/pull/6336/files#diff-8c4f5ac108be5428c5d49656f82f56b6b45192e331adf3e402db58e1cda8e064
logger.ts https://github.com/simstudioai/sim/pull/6336/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
trace-secret-projection.test.ts https://github.com/simstudioai/sim/pull/6336/files#diff-d685a127b7054d2a90c57b539b3e51556d9c5b81828f2ae30b5dc12f8b380357
trace-secret-projection.ts https://github.com/simstudioai/sim/pull/6336/files#diff-ce82991a770f73aafcf2aaf915136f82d13830d6ace29a0ed6e50ae0d159b620
fetch-external-url.test.ts https://github.com/simstudioai/sim/pull/6336/files#diff-270277b8cd32e78a4be34c6cd10bb177697150165c604ee57c02f48b6da077c5
fetch-external-url.ts https://github.com/simstudioai/sim/pull/6336/files#diff-3b96ff9cacb7268579c8c67c7ec04dfca4c0c8221707257710289b403f85c028
workspace-file-manager.ts https://github.com/simstudioai/sim/pull/6336/files#diff-fcf305d0b37403347596bca42fc6889e9038c9f8e2c69ba20676c0f0d8fead34
workspace-file-storage-accounting.test.ts https://github.com/simstudioai/sim/pull/6336/files#diff-f378b2028cfe58a78cf40ac52d4ccc66a70f0da843d1ac137ebb9177c22a8b59
errors.test.ts https://github.com/simstudioai/sim/pull/6336/files#diff-4b120d67b511864a6cecf3889fe9a1c7319ae3fada14df67dccd5cbc28ef1453
errors.ts https://github.com/simstudioai/sim/pull/6336/files#diff-f63e91b89e1f4b1ef06ce3e18986797e5feee754df3ab36a5c15fc5d6596d44f
apps/sim/lib/logs/execution/logger.test.tshttps://github.com/simstudioai/sim/pull/6336/files#diff-8c4f5ac108be5428c5d49656f82f56b6b45192e331adf3e402db58e1cda8e064
View file https://github.com/simstudioai/sim/blob/a5e0276142716d567c1194f20d321f9f8faf28d8/apps/sim/lib/logs/execution/logger.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6336/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6336/files#diff-8c4f5ac108be5428c5d49656f82f56b6b45192e331adf3e402db58e1cda8e064
https://github.com/simstudioai/sim/pull/6336/files#diff-8c4f5ac108be5428c5d49656f82f56b6b45192e331adf3e402db58e1cda8e064
https://github.com/simstudioai/sim/pull/6336/files#diff-8c4f5ac108be5428c5d49656f82f56b6b45192e331adf3e402db58e1cda8e064
https://github.com/simstudioai/sim/pull/6336/files#diff-8c4f5ac108be5428c5d49656f82f56b6b45192e331adf3e402db58e1cda8e064
apps/sim/lib/logs/execution/logger.tshttps://github.com/simstudioai/sim/pull/6336/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
View file https://github.com/simstudioai/sim/blob/a5e0276142716d567c1194f20d321f9f8faf28d8/apps/sim/lib/logs/execution/logger.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6336/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6336/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/6336/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/6336/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/6336/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
apps/sim/lib/logs/execution/trace-secret-projection.test.tshttps://github.com/simstudioai/sim/pull/6336/files#diff-d685a127b7054d2a90c57b539b3e51556d9c5b81828f2ae30b5dc12f8b380357
View file https://github.com/simstudioai/sim/blob/a5e0276142716d567c1194f20d321f9f8faf28d8/apps/sim/lib/logs/execution/trace-secret-projection.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6336/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6336/files#diff-d685a127b7054d2a90c57b539b3e51556d9c5b81828f2ae30b5dc12f8b380357
https://github.com/simstudioai/sim/pull/6336/files#diff-d685a127b7054d2a90c57b539b3e51556d9c5b81828f2ae30b5dc12f8b380357
https://github.com/simstudioai/sim/pull/6336/files#diff-d685a127b7054d2a90c57b539b3e51556d9c5b81828f2ae30b5dc12f8b380357
https://github.com/simstudioai/sim/pull/6336/files#diff-d685a127b7054d2a90c57b539b3e51556d9c5b81828f2ae30b5dc12f8b380357
https://github.com/simstudioai/sim/pull/6336/files#diff-d685a127b7054d2a90c57b539b3e51556d9c5b81828f2ae30b5dc12f8b380357
https://github.com/simstudioai/sim/pull/6336/files#diff-d685a127b7054d2a90c57b539b3e51556d9c5b81828f2ae30b5dc12f8b380357
https://github.com/simstudioai/sim/pull/6336/files#diff-d685a127b7054d2a90c57b539b3e51556d9c5b81828f2ae30b5dc12f8b380357
apps/sim/lib/logs/execution/trace-secret-projection.tshttps://github.com/simstudioai/sim/pull/6336/files#diff-ce82991a770f73aafcf2aaf915136f82d13830d6ace29a0ed6e50ae0d159b620
View file https://github.com/simstudioai/sim/blob/a5e0276142716d567c1194f20d321f9f8faf28d8/apps/sim/lib/logs/execution/trace-secret-projection.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6336/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6336/files#diff-ce82991a770f73aafcf2aaf915136f82d13830d6ace29a0ed6e50ae0d159b620
https://github.com/simstudioai/sim/pull/6336/files#diff-ce82991a770f73aafcf2aaf915136f82d13830d6ace29a0ed6e50ae0d159b620
https://github.com/simstudioai/sim/pull/6336/files#diff-ce82991a770f73aafcf2aaf915136f82d13830d6ace29a0ed6e50ae0d159b620
https://github.com/simstudioai/sim/pull/6336/files#diff-ce82991a770f73aafcf2aaf915136f82d13830d6ace29a0ed6e50ae0d159b620
https://github.com/simstudioai/sim/pull/6336/files#diff-ce82991a770f73aafcf2aaf915136f82d13830d6ace29a0ed6e50ae0d159b620
https://github.com/simstudioai/sim/pull/6336/files#diff-ce82991a770f73aafcf2aaf915136f82d13830d6ace29a0ed6e50ae0d159b620
https://github.com/simstudioai/sim/pull/6336/files#diff-ce82991a770f73aafcf2aaf915136f82d13830d6ace29a0ed6e50ae0d159b620
https://github.com/simstudioai/sim/pull/6336/files#diff-ce82991a770f73aafcf2aaf915136f82d13830d6ace29a0ed6e50ae0d159b620
https://github.com/simstudioai/sim/pull/6336/files#diff-ce82991a770f73aafcf2aaf915136f82d13830d6ace29a0ed6e50ae0d159b620
https://github.com/simstudioai/sim/pull/6336/files#diff-ce82991a770f73aafcf2aaf915136f82d13830d6ace29a0ed6e50ae0d159b620
apps/sim/lib/uploads/contexts/workspace/fetch-external-url.test.tshttps://github.com/simstudioai/sim/pull/6336/files#diff-270277b8cd32e78a4be34c6cd10bb177697150165c604ee57c02f48b6da077c5
View file https://github.com/simstudioai/sim/blob/a5e0276142716d567c1194f20d321f9f8faf28d8/apps/sim/lib/uploads/contexts/workspace/fetch-external-url.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6336/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6336/files#diff-270277b8cd32e78a4be34c6cd10bb177697150165c604ee57c02f48b6da077c5
https://github.com/simstudioai/sim/pull/6336/files#diff-270277b8cd32e78a4be34c6cd10bb177697150165c604ee57c02f48b6da077c5
https://github.com/simstudioai/sim/pull/6336/files#diff-270277b8cd32e78a4be34c6cd10bb177697150165c604ee57c02f48b6da077c5
https://github.com/simstudioai/sim/pull/6336/files#diff-270277b8cd32e78a4be34c6cd10bb177697150165c604ee57c02f48b6da077c5
apps/sim/lib/uploads/contexts/workspace/fetch-external-url.tshttps://github.com/simstudioai/sim/pull/6336/files#diff-3b96ff9cacb7268579c8c67c7ec04dfca4c0c8221707257710289b403f85c028
View file https://github.com/simstudioai/sim/blob/a5e0276142716d567c1194f20d321f9f8faf28d8/apps/sim/lib/uploads/contexts/workspace/fetch-external-url.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6336/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6336/files#diff-3b96ff9cacb7268579c8c67c7ec04dfca4c0c8221707257710289b403f85c028
https://github.com/simstudioai/sim/pull/6336/files#diff-3b96ff9cacb7268579c8c67c7ec04dfca4c0c8221707257710289b403f85c028
https://github.com/simstudioai/sim/pull/6336/files#diff-3b96ff9cacb7268579c8c67c7ec04dfca4c0c8221707257710289b403f85c028
apps/sim/lib/uploads/contexts/workspace/workspace-file-manager.tshttps://github.com/simstudioai/sim/pull/6336/files#diff-fcf305d0b37403347596bca42fc6889e9038c9f8e2c69ba20676c0f0d8fead34
View file https://github.com/simstudioai/sim/blob/a5e0276142716d567c1194f20d321f9f8faf28d8/apps/sim/lib/uploads/contexts/workspace/workspace-file-manager.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6336/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6336/files#diff-fcf305d0b37403347596bca42fc6889e9038c9f8e2c69ba20676c0f0d8fead34
https://github.com/simstudioai/sim/pull/6336/files#diff-fcf305d0b37403347596bca42fc6889e9038c9f8e2c69ba20676c0f0d8fead34
https://github.com/simstudioai/sim/pull/6336/files#diff-fcf305d0b37403347596bca42fc6889e9038c9f8e2c69ba20676c0f0d8fead34
https://github.com/simstudioai/sim/pull/6336/files#diff-fcf305d0b37403347596bca42fc6889e9038c9f8e2c69ba20676c0f0d8fead34
Please reload this pagehttps://github.com/simstudioai/sim/pull/6336/files
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.