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

curl_multi_add_handle(): Argument #2 ($handle) must be of type CurlHandle, Swoole\Curl\Handler given #3044

Closed
1 task
arvinyan86 opened this issue Dec 4, 2024 · 2 comments
Assignees
Labels
closed-for-staleness guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@arvinyan86
Copy link

Describe the bug

When I integrated AWS SDK using Hyperf framework (swoole 5.0) and used DynamoDB for data querying, the result returned an error.
curl_multi_add_handle(): Argument #2 ($handle) must be of type CurlHandle, Swoole\Curl\Handler given . . .
so,how to fix it

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

fix it

Current Behavior

curl error

Reproduction Steps

Execute the following code

Possible Solution

No response

Additional Information/Context

$client = self::getClient();

    $marshaler = new Marshaler();
    $items = [];
    try {
        $params = [
            'TableName' => $tableName, // 替换为你的 DynamoDB 表名
            'KeyConditionExpression' => 'uid = :partition_value', // AND create_time BETWEEN :start_sort_value AND :end_sort_value
            'ExpressionAttributeValues' => [
                ':partition_value' => ['N'=>'20549'], // 替换为你的分区键值,注意类型要与 DynamoDB 中的一致
                //':start_sort_value'=>['N'=>'1733133075'],
                //':end_sort_value'   => ['N'=>'1792541253']
            ]
            // 如果你的表有排序键,并且你想基于排序键进行范围查询,可以添加 SortKeyConditionExpression 和相应的 ExpressionAttributeValues
        ];

        // 执行查询
        $result = $client->query($params);
        // 处理查询结果
        foreach ($result['Items'] as $k=>$item) {
            $items[$k] = $marshaler->unmarshalItem($item);
        }

    } catch (DynamoDbException $e) {
        PublicHelper::catchExceptionInfo($e,'AwsDynamoDb:拉取数据失败1');
    } catch (\Throwable $exception){
        PublicHelper::catchExceptionInfo($exception,'AwsDynamoDb:拉取数据失败2');
    }

SDK version used

3.333

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

centos, php8.0

@arvinyan86 arvinyan86 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 4, 2024
@yenfryherrerafeliz yenfryherrerafeliz self-assigned this Dec 5, 2024
@yenfryherrerafeliz
Copy link
Contributor

Hi @arvinyan86, sorry to hear about your issues. Unfortunately this seems to be a third party problem. I did not see how you instanced your client, however, It looks like you are having some dependencies conflicts. This error is not coming directly from the SDK, but instead from guzzle which is a library we use for HTTP operations. I recommend you to make sure the dependencies you are using are the ones required by the SDK here.

Thanks!

@yenfryherrerafeliz yenfryherrerafeliz added guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 6, 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 closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness guidance Question that needs advice or information. 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