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

DynamoDB dynamodb:DescribeTable Error when using OverrideTableName #1421

Closed
ayongbannayan opened this issue Oct 7, 2019 · 10 comments
Closed
Labels
breaking-change This issue requires a breaking change to remediate. bug This issue is a bug. dynamodb p2 This is a standard priority issue queued

Comments

@ayongbannayan
Copy link

I'm using the object persistent model, the name of the DynamoDB table is also dynamic. My queries currently function however when using X-Ray I'm noticing an exception that is occurring after the query.

In my object I am not using the DynamoDBTable attribute because the table name is dynamic. I'm using the DynamoDBOperationConfig and setting the OverrideTableName property.

When excuting QueryAsync the query returns results but X-Ray shows the following

Screen Shot 2019-10-07 at 1 44 25 PM

The error that is occurring is ...not authorized to perform: dynamodb:DescribeTable on resource: arn:aws:dynamodb:ca-central-1:xxxxxxxxx:table/T where T is the name of the object and not the table.

using (DynamoDBContext context = new DynamoDBContext(AmazonDynamoDB))
{
    DynamoDBOperationConfig config = new DynamoDBOperationConfig
    {
        OverrideTableName = “TableName”,
        IndexName = “IndexName”
    };

    AsyncSearch<ObjectType> query = context.QueryAsync<ObjectType>(“HashKey”, config);
    IEnumerable<ObjectType> objects = await query.GetRemainingAsync();
}

I'm not sure how to handle this exception. I've tried to set the DynamoDBTable however the error simply changes to the name I provide instead of the objects Name. Not sure what else I'm missing.

Regards
Artin

@klaytaybai klaytaybai added the bug This issue is a bug. label Oct 8, 2019
@klaytaybai
Copy link
Contributor

Hi @Artin-ST, thanks for reporting this. I think it is root caused by a known bug. I'll look into this more soon and add more details as I go along.

@harshghorpade
Copy link

Hello, any update on this bug ? I can still reproduce this exact same issue with AWSSDK.DynamoDBv2 version 3.3.105.26 on .NET Core 3.1 Project.

@AdalbertKhoolsaat
Copy link

AdalbertKhoolsaat commented Sep 15, 2020

Hey there, in the exact same manner as the OP I found out that I suffer from this bug as well.
At the company I work for we are considering using X-Ray (as part of CloudWatch ServiceLens), and we found this bug with the very first project we started monitoring (using v3.3.105.34 on .NET Core 3.1).

Considering that the OPM is used quite generally around here , this issue is definitely pretty widespread.

@ashishdhingra ashishdhingra added the A label Oct 6, 2020
@hunanniu hunanniu added the queued label Oct 7, 2020
@ashishdhingra ashishdhingra added the breaking-change This issue requires a breaking change to remediate. label Mar 11, 2021
@ashishdhingra
Copy link
Contributor

Breaking change as per #1218 (comment)

@ashishdhingra
Copy link
Contributor

Also refer #1448 and validate the scenario if this issue is fixed in next major release.

@github-actions
Copy link

We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.

@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 Mar 12, 2022
@Kralizek
Copy link
Contributor

@ashishdhingra Both this one and #1448 are closed now. Could you please reopen one of them to make sure the error is tracked?

@ashovlin
Copy link
Member

In our next major version of the SDK (development underway now, see #3209), we've separated the hierarchy between DynamoDBContextConfig and DynamoDBOperationConfig. You will no longer be able to pass an operation-level config in to the context-level constructor, where OverrideTableName is not honored.

var dynamoDbOperationConfig = new DynamoDBOperationConfig
{
    OverrideTableName = _tableName            
};

var context = new DynamoDBContext(_client, dynamoDbOperationConfig);  // no longer possible in V4   

We didn't want to take a single override table name as an input to the context object, since one can reuse a context object with multiple tables. If you do want to override table names on an application-level, you can use the TableAlias or TypeMapping collections on AWSConfigsDynamoDB.Context.

We'll close this once V4 packages ship with this change. This addresses #1218 which we de-duped into this one.


Revisiting this issue and #1448 which was also de-duped here. These appear to be both be overriding the table name via a DynamoDBOperationConfig on a query. This is working as expected when I attempt to reproduce with AWSSDK.DynamoDBv2 3.7.400.5. Let us know if you're still seeing an issue on V3.

var config = new DynamoDBOperationConfig
{
    OverrideTableName =TableName,
};

var query = context.QueryAsync<ObjectType>(“HashKey”, config);

@bhoradc
Copy link

bhoradc commented Sep 13, 2024

Hello @ayongbannayan,

These changes are available in .NET 4 Preview. Kindly track this issue for when this change would go GA.

Will go ahead and close this out. Thank you.

Regards,
Chaitanya

@bhoradc bhoradc closed this as completed Sep 13, 2024
Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This issue requires a breaking change to remediate. bug This issue is a bug. dynamodb p2 This is a standard priority issue queued
Projects
None yet
Development

No branches or pull requests

9 participants