Repository navigation
fix(consumer): keep the queue password out of crash traces - #33
Merged
Merged
Conversation
A consumer that died before it read the queue printed its stack trace with every frame's arguments, so the NATS password (cut at 15 characters) and the queue URL landed in Loki on each production cluster when the queue was not provisioned yet. The broker now marks the URL and password as sensitive parameters, and the consumer turns off exception arguments altogether. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F3M7troWjCiEZycnYK98XV Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com>
🟢 Tier S · Ready to mergeThe consumer now disables exception argument capture before loading its dependencies, and the broker marks its URL and password parameters as sensitive. A Broker test verifies that a trace through the factory omits those credentials.
📂 Walkthrough · 3
Reviewed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Torsten · project thread
Why
When the consumer starts before Appwrite has provisioned
v1-reviewson NATS, it dies with an uncaught exception, and PHP prints the stack trace with every frame's arguments. On 2026-11-03 around 02:40 UTC this wroteBroker::factory('nats://appwrite...', 'v1-reviews', 'appwrite', '<first 15 characters of the NATS password>...')to Loki on fra1, nyc3, sgp1 and tor1 prod.What
Broker::factory,nats,redisandfilledmark the queue URL and password#[\SensitiveParameter], so a trace showsObject(SensitiveParameterValue)for them.consumer.phpsetszend.exception_ignore_args=1before anything runs, so no other frame can print a credential either.BrokerTestcase checks that a trace throughBroker::factorynames the call without the URL or password.Checks
php -lon the changed files, and the sameSensitiveParametertrace behaviour confirmed in a standalone PHP script. I could not run the PHPUnit suite here (no Docker and no PHP 8.5 in this session), so CI is the first full run.Generated by Claude Code