Skip to content

TraceMiddleware crashes when http option is false - #3206

Closed
johanrosenson wants to merge 1 commit into
aws:masterfrom
johanrosenson:bugfix/tracemiddleware-undefined-debug
Closed

johanrosenson wants to merge 1 commit into
aws:masterfrom
johanrosenson:bugfix/tracemiddleware-undefined-debug

Conversation

@johanrosenson

@johanrosenson johanrosenson commented Nov 1, 2025 •

Copy link
Copy Markdown
Undefined array key "debug" at aws-sdk-php/src/TraceMiddleware.php:289

Description of changes:

When setting the debug.http option to false the above exception will be thrown because $command['@http']['debug'] doesn't exist, adding a null check fixes the issue.

new S3Client([
    'debug' => [
        'logfn' => ...
        'http' => false,
    ],
]);

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@yenfryherrerafeliz

Copy link
Copy Markdown
Contributor

Hey @johanrosenson, I have a left a comment in the issue. This is not the best way to actually fix the issue there. I am currently investigating what we can do to prevent this issue, however, in the mean time feel free to use the workaround in my comment.

Thank you!

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.

2 participants