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

ValueError: too many values to unpack on _resolve_endpoint_ruleset call #1234

Open
lexicalunit opened this issue Mar 20, 2024 · 4 comments
Open

Comments

@lexicalunit
Copy link

I have the following versions installed:

➜ pip freeze | grep -E "boto3|botocore|pynamodb"
boto3==1.34.66
botocore==1.34.66
pynamodb==5.4.0

And I get this error when calling .exists() on a Model class:

[...]
  File "site-packages/pynamodb/models.py", line 762, in exists
    cls._get_connection().describe_table()
  File "site-packages/pynamodb/connection/table.py", line 294, in describe_table
    return self.connection.describe_table(self.table_name)
  File "site-packages/pynamodb/connection/base.py", line 791, in describe_table
    data = self.dispatch(DESCRIBE_TABLE, operation_kwargs)
  File "site-packages/pynamodb/connection/base.py", line 340, in dispatch
    data = self._make_api_call(operation_name, operation_kwargs, settings)
  File "site-packages/pynamodb/connection/base.py", line 376, in _make_api_call
    endpoint_url, additional_headers = self.client._resolve_endpoint_ruleset(
ValueError: too many values to unpack (expected 2)
@nipun-AiR
Copy link

Updating to 5.5.1 fixed this issue for me.

@canopus1io
Copy link

canopus1io commented Mar 21, 2024

opened PR to apply this fix to the 4.x version #1235

@indexfingers
Copy link

I have a potentially naive follow up question. I ran into the same problem and found the same fix. What I'd love to understand is why the problem occurred in the first place. If the version of pynamodb I'm using didn't change, and the version of botocore didn't change, what did?

@monkut
Copy link

monkut commented May 13, 2024

It appears that in cases where lambda/ecs/fargate (?) the underlying included boto3 may be used, and updated periodically.
It looks like in this case pynamodb is calling a private boto3 api, _resolve_endpoint_ruleset(). ._resolve_endpoint_ruleset() return signature changed causing pynamodb to crash. Or, if boto3/botocore are the same and you still get this issue, it could be that boto3/botocore where passing the raw response from an external API call.

Looking over the latest pynamodb.connections.base.py code it looks like usage of ._resolve_endpoint_ruleset() has been removed.

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

5 participants