baopham / laravel-dynamodb

Eloquent syntax for DynamoDB
https://packagist.org/packages/baopham/dynamodb
MIT License
490 stars 127 forks source link

Expecting RequestInterface, given RulesetEndpoint #276

Open bkmorse opened 9 months ago

bkmorse commented 9 months ago

Recently upgraded from php 8.2 to 8.3 and ran composer update and now I see the error below. I switched back to php 8.2 and it works and switched back to 8.3 and the error shows up again. Any help is appreciated. Thank you.

Schema

Describe your table schema:

image

Debug info

$model->where('group', 'reports')
->where('name', 'reports.version')
->first();

Config

[
    'credentials' => [
        'key' => 'dynamodb_local',
        'secret' => 'secret',
    ],
    'region' => 'stub',
    'endpoint' => 'localhost',
    'debug' => true,
]

Error

Aws\TraceMiddleware::Aws{closure}(): Argument #2 ($request) must be of type ?Psr\Http\Message\RequestInterface, Aws\EndpointV2\Ruleset\RulesetEndpoint given, called in vendor/aws/aws-sdk-php/src/EndpointV2/EndpointV2Middleware.php on line 100.

Version info

nelson6e65 commented 9 months ago

I have not tried on PHP 8.3. 🤔

Are aws/aws-sdk-php versions different between your installs on PHP 8.2 and PHP 8.3?

nelson6e65 commented 9 months ago

Have you tried running composer install instead of composer update instead?

bkmorse commented 9 months ago

I have tried both composer install and update

version of aws/aws-sdk-php: php 8.2: 3.271.8 php 8.3: 3.271.8 (after composer install) php 8.3: 3.293.8 (after composer update)

bkmorse commented 9 months ago

I downgraded to 8.2, using docker image: php:8.2.9RC1-fpm-alpine3.17

It still had aws/aws-sdk-php set to version 3.293.9, so I ran:

composer require aws/aws-sdk-php:3.271.8

Then it worked

bkmorse commented 9 months ago

Seems like aws/aws-sdk-php does not support php 8.3

nelson6e65 commented 5 months ago

@bkmorse Chan you check if using aws/aws-sdk-php >= 3.298.0 solves this problem?

https://github.com/aws/aws-sdk-php/blob/master/CHANGELOG.md#32980---2024-01-31