-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect argument type #2855
Comments
error ocurred if Aws\S3\S3Client created with parameter debug => ["logfn" => function ($msg) use ($logger, &$prevMsg) {}] on 2.293.3 there is no error |
Hi @VadimSafonov, thanks for reporting this. We are aware of this issue and we are working to get this fixed as soon as possible. I will provide more updates in this thread as soon as I get them. Thanks! |
Hi @VadimSafonov, Sorry about the issues. A new middleware was introduced to handle endpoint resolution, which returns a resolved endpoint object passed as the second argument to the next middleware in the handler stack. The trace middleware always expects a request (or null) to be returned as the second argument, so we're going to loosen the requirements there until we come up with more of a long term solution. This will be fixed in today's release. |
Closing this for now, as #2854 should have addressed this. Feel free to re-open if you're still having issues after updating to the latest version of the SDK. |
|
Describe the bug
Aws\TraceMiddleware::Aws{closure}(): Argument #2 ($request) must be of type ?Psr\Http\Message\RequestInterface, Aws\EndpointV2\Ruleset\RulesetEndpoint given, called in
/project/vendor/aws/aws-sdk-php/src/EndpointV2/EndpointV2Middleware.php on line 100
Uncaught Exception Aws\TraceMiddleware::Aws{closure}(): Argument #2 ($request) must be of type ?Psr\Http\Message\RequestInterface, Aws\EndpointV2\Ruleset\RulesetEndpoint given, called in
/project/vendor/aws/aws-sdk-php/src/EndpointV2/EndpointV2Middleware.php on line 100
Stack trace: #0
/project/vendor/aws/aws-sdk-php/src/EndpointV2/EndpointV2Middleware.php(100): Aws\TraceMiddleware->Aws{closure}(Object(Aws\Command), Object(Aws\EndpointV2\Ruleset\RulesetEndpoint))
#1
/project/vendor/aws/aws-sdk-php/src/TraceMiddleware.php(99): Aws\EndpointV2\EndpointV2Middleware->__invoke(Object(Aws\Command), NULL)
#2
/project/vendor/aws/aws-sdk-php/src/InputValidationMiddleware.php(73): Aws\TraceMiddleware->Aws{closure}(Object(Aws\Command))
#3
/project/vendor/aws/aws-sdk-php/src/TraceMiddleware.php(99): Aws\InputValidationMiddleware->__invoke(Object(Aws\Command), NULL)
#4
/project/vendor/aws/aws-sdk-php/src/Middleware.php(90): Aws\TraceMiddleware->Aws{closure}(Object(Aws\Command), NULL)
#5
/project/vendor/aws/aws-sdk-php/src/TraceMiddleware.php(99): Aws\Middleware::Aws{closure}(Object(Aws\Command), NULL)
#6
/project/vendor/aws/aws-sdk-php/src/S3/S3Client.php(631): Aws\TraceMiddleware->Aws{closure}(Object(Aws\Command), NULL)
#7
/project/vendor/aws/aws-sdk-php/src/TraceMiddleware.php(99): Aws\S3\S3Client::Aws\S3{closure}(Object(Aws\Command), NULL)
#8
/project/vendor/aws/aws-sdk-php/src/S3/S3Client.php(654): Aws\TraceMiddleware->Aws{closure}(Object(Aws\Command), NULL)
#9
/project/vendor/aws/aws-sdk-php/src/TraceMiddleware.php(99): Aws\S3\S3Client::Aws\S3{closure}(Object(Aws\Command), NULL)
#10
/project/vendor/aws/aws-sdk-php/src/S3/S3Client.php(588): Aws\TraceMiddleware->Aws{closure}(Object(Aws\Command), NULL)
#11
/project/vendor/aws/aws-sdk-php/src/TraceMiddleware.php(99): Aws\S3\S3Client::Aws\S3{closure}(Object(Aws\Command), NULL)
#12
/project/vendor/aws/aws-sdk-php/src/S3/S3Client.php(607): Aws\TraceMiddleware->Aws{closure}(Object(Aws\Command), NULL)
#13
/project/vendor/aws/aws-sdk-php/src/TraceMiddleware.php(99): Aws\S3\S3Client::Aws\S3{closure}(Object(Aws\Command), NULL)
#14
/project/vendor/aws/aws-sdk-php/src/Middleware.php(58): Aws\TraceMiddleware->Aws{closure}(Object(Aws\Command), NULL)
#15
/project/vendor/aws/aws-sdk-php/src/TraceMiddleware.php(99): Aws\Middleware::Aws{closure}(Object(Aws\Command), NULL)
#16
/project/vendor/aws/aws-sdk-php/src/S3/SSECMiddleware.php(59): Aws\TraceMiddleware->Aws{closure}(Object(Aws\Command), NULL)
#17
/project/vendor/aws/aws-sdk-php/src/TraceMiddleware.php(99): Aws\S3\SSECMiddleware->__invoke(Object(Aws\Command), NULL)
#18
/project/vendor/aws/aws-sdk-php/src/IdempotencyTokenMiddleware.php(77): Aws\TraceMiddleware->Aws{closure}(Object(Aws\Command), NULL)
#19
/project/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(64): Aws\IdempotencyTokenMiddleware->__invoke(Object(Aws\Command))
#20
/project/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(58): Aws\AwsClient->executeAsync(Object(Aws\Command))
#21
/project/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(86): Aws\AwsClient->execute(Object(Aws\Command))
#22
/project/vendor/aws/aws-sdk-php/src/S3/StreamWrapper.php(301): Aws\AwsClient->__call('headObject', Array)
#23
/project/vendor/aws/aws-sdk-php/src/S3/StreamWrapper.php(941): Aws\S3\StreamWrapper->Aws\S3{closure}()
#24
/project/vendor/aws/aws-sdk-php/src/S3/StreamWrapper.php(299): Aws\S3\StreamWrapper->boolCall(Object(Closure), 6)
Expected Behavior
No error
Current Behavior
Error
Reproduction Steps
upload file to s3 using stream wrapper
Possible Solution
No response
Additional Information/Context
No response
SDK version used
3.293.9
Environment details (Version of PHP (
php -v
)? OS name and version, etc.)PHP 8.2.13 (cli) (built: Dec 9 2023 11:53:13) (ZTS) Copyright (c) The PHP Group Zend Engine v4.2.13, Copyright (c) Zend Technologies
The text was updated successfully, but these errors were encountered: