Skip to content
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

Argument 4 passed to Aws\Exception\AwsException::__construct() must be an instance of Exception or null #2874

Closed
dgastudio opened this issue Jan 29, 2024 · 3 comments
Assignees
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@dgastudio
Copy link

dgastudio commented Jan 29, 2024

Describe the bug

Argument 4 passed to Aws\Exception\AwsException::__construct() must be an instance of Exception or null

Expected Behavior

it should work

Current Behavior

TypeError: Argument 4 passed to Aws\Exception\AwsException::__construct() must be an instance of Exception or null, instance of Error given, called in /lib/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php on line 205 in Aws\Exception\AwsException->__construct() (line 47 of /lib/vendor/aws/aws-sdk-php/src/Exception/AwsException.php).

Reproduction Steps

use Aws\Sqs\SqsClient; 
use Aws\Exception\AwsException;
$client = new SqsClient([
    'region' => 'us-west-2',
]);

try {
    $result = $client->listQueues();
    foreach ($result->get('QueueUrls') as $queueUrl) {
        echo "$queueUrl\n";
    }
} catch (AwsException $e) {
    // output error message if fails
    error_log($e->getMessage());
}

Possible Solution

No response

Additional Information/Context

No response

SDK version used

3.278

Environment details (Version of PHP (php -v)? OS name and version, etc.)

PHP version: 7.1.33-5 (sorry, we can't update)

@dgastudio dgastudio added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 29, 2024
@yenfryherrerafeliz yenfryherrerafeliz self-assigned this Jan 30, 2024
@yenfryherrerafeliz
Copy link
Contributor

Hi @dgastudio, sorry to hear about your issues. I tried to reproduce the reported error but I am not able to. Could you please provide any other details that could help for reproducing this issue?, could you please also enable debug logs in the client by passing the parameter 'debug' set to true.

Please make sure you redact any sensitive information.

I look forward to your response.

When working on reproducing this issue I used the following docker image:
Dockerfile

FROM php:7.1

RUN apt-get update && \
    apt-get install -y \
    git \
    unzip

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

WORKDIR /usr/src/app

COPY . /usr/src/app

RUN composer install

RUN chmod +x src/issue.2874.php

WORKDIR /usr/src/app/src

ENV AWS_ACCESS_KEY_ID ACCESS_KEY_ID_VALUE
ENV AWS_SECRET_ACCESS_KEY SECRET_ACCESS_KEY_VALUE
ENV AWS_SESSION_TOKEN  SESSION_TOKEN_VALUE

CMD ["php", "issue.2874.php"]

Thanks!

@yenfryherrerafeliz yenfryherrerafeliz added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Jan 30, 2024
Copy link

This issue has not recieved a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Feb 10, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants