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

feat(Base): Add region when scan exception occures #775

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

acolombier
Copy link

Hi PynamoDB team!

First, thanks for your great work!

This PR comes after a painful debug session to catch a "table not found" issue. In the end, it turned out that the region had been change in our config file.

A few day ago, the issue occurred again, and even if this time, it took me only a few minutes to remember this issue, I thought it would be great to display the region which is currently used for scanning, and then help people catching a potential region misconfiguration, especially since the region is defaulted in settings.py.

Hope you like the idea,
Thanks

@ikonst
Copy link
Contributor

ikonst commented May 1, 2020

I'm not sure what this exception normally says (does it have the table's name?) but I think this change would be overly specific to the problem you faced -- "fighting the last war", so to speak.

@acolombier
Copy link
Author

Hi @ikonst ,

Sorry, I should have stated that first.

Basically the error message from boto3 looks like the following:

An error occurred (ResourceNotFoundException) when calling the <OperationName> operation: Requested resource not found: Table: <TableName> not found

boto3 wouldn't display the region because it is a mandatory setting (if you don't set it up in the code, it is expecting it to find it in your profile definition). Here is what happen if boto3 cannot resolve an explicitly set region:

botocore.exceptions.NoRegionError: You must specify a region.

However, PynamoDB is "breaking" this safeguard by explicitly defaulting the region to us-east-1 and thus, brings to confusion when you are used to AWS services(/boto3) requirements.

If you wish, the aim of this PR is to bring the safeguard in a non-destructive way. :)

I hope that makes it more clear.

Thanks.

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

Successfully merging this pull request may close these issues.

None yet

2 participants