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

Version 2.0.0 doesn't work #14

Closed
shadowhand opened this issue Oct 6, 2021 · 6 comments
Closed

Version 2.0.0 doesn't work #14

shadowhand opened this issue Oct 6, 2021 · 6 comments

Comments

@shadowhand
Copy link
Contributor

I can't figure out why, but upgrading to version 2.0.0 causes all calls to error with:

Code:    ResourceNotFoundException
Message: Cannot do operations on a non-existent table

Nothing about my configuration has changed, other than switching:

- use Aws\DynamoDb\DynamoDbClient;
+ use AsyncAws\DynamoDb\DynamoDbClient;
@RikudouSage
Copy link
Owner

Do you have any more details? Do you have correct region? Does the table exist in the region?

@shadowhand
Copy link
Contributor Author

shadowhand commented Oct 6, 2021

As I said, the only change was switching versions and replacing the client. Region is correct, table is correct and exists. There's really nothing else to report; it was working, I upgraded, and now it doesn't.

@RikudouSage
Copy link
Owner

Well, AWS is a little magic when it comes to guessing your configuration, it's possible the official SDK got the region from somewhere else.

Can you send a snippet of how you construct the object?

@shadowhand
Copy link
Contributor Author

final class DynamoDbCacheFactory
{
    public function __invoke(ContainerInterface $container): DynamoDbCache
    {
        return new DynamoDbCache(
            tableName: $container->get('aws.dynamodb.tables.cache'),
            client: $container->get(DynamoDbClient::class),
            prefix: $container->get('app.version'),
        );
    }
}

@RikudouSage
Copy link
Owner

And the DynamoDbClient?

@shadowhand
Copy link
Contributor Author

shadowhand commented Oct 6, 2021

I think I found the problem. It seems that AsyncAws doesn't respect region being configured and defaults to us-east-1 for all operations. Or at least it does when configured with a custom endpoint.

async-aws/aws#1111

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

No branches or pull requests

2 participants