Closed shomerj closed 4 weeks ago
Thanks for reaching out. The Boto3 list_exports command involves a call to the underlying DynamoDB ListExports API and the NextToken
is failing validation here. I tried to reproduce this issue but was not able to. First I created 11 exports:
import boto3
dynamodb = boto3.client('dynamodb')
s3 = boto3.client('s3')
NUM_EXPORTS = 11
for i in range(1, NUM_EXPORTS + 1):
response = dynamodb.export_table_to_point_in_time(
TableArn='arn:aws:dynamodb:us-west-2:account-id:table/table',
S3Bucket='my-bucket',
S3Prefix='my-prefix',
ExportFormat='DYNAMODB_JSON'
)
Then I ran list_exports
:
import boto3
dynamodb = boto3.client('dynamodb')
response = dynamodb.list_exports()
print(len(response['ExportSummaries']))
while 'NextToken' in response:
response = dynamodb.list_exports(NextToken=response['NextToken'])
print(len(response['ExportSummaries']))
And as expected that outputs:
10
1
And if I specify MaxResults=25
in my initial call, then it will output 11
as expected.
So I'm no sure what is causing the issue you're experiencing. I recommend that you first update your version of Boto3 by uninstalling/reinstalling it. And if still seeing an issue, please share your full debug logs (with sensitive info redacted) by adding boto3.set_stream_logger('')
to your script.
Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.
Describe the bug
I am trying to fetch all of the DynamoDB exports for a given table. When I try and fetched the next page of exports using the
NextToken
returned in the response I get the following exception:Fetching the next page (set of exports) works until the exports count is above 10. For example, if I set the MaxResults to 5, grabbing the next set of exports using the
NextToken
works. Grabbing the 10 through 15 exports will fail giving me the exception stated above.Expected Behavior
The
NextToken
returned from thelist_exports
function should not raise a ValidationExceptions. Instead it should return all exports until all have been returned.Current Behavior
boto3 version: '1.33.8'
The following is the stack trace returned:
Reproduction Steps
The following is the test script I used to demonstrate the error. Private information is starred out:
Possible Solution
No response
Additional Information/Context
No response
SDK version used
1.33.8
Environment details (OS name and version, etc.)
Amazon Linux 6.6.32-linuxkit