welldone-cloud / aws-list-resources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

botocore.exceptions.InvalidRetryConfigurationError: Cannot provide retry configuration for "mode"

ABCMoNa opened this issue · comments

Hi,

I was just trying your script on Ubuntu 20.04, where it fails with a botocore configuration issue:

botocore.exceptions.InvalidRetryConfigurationError: Cannot provide retry configuration for "mode". 
Valid retry configuration options are: 'max_attempts'

More details:

redacteduser@redactedhost:~/redacteddir$ lsb_release -ds
Ubuntu 20.04.5 LTS

redacteduser@redactedhost:~/redacteddir$ which python3
/usr/bin/python3

redacteduser@redactedhost:~/redacteddir$ dpkg -S /usr/bin/python3
python3-minimal: /usr/bin/python3

redacteduser@redactedhost:~/redacteddir$ apt list --installed python3-minimal
Listing... Done
python3-minimal/focal,now 3.8.2-0ubuntu2 amd64 [installed,automatic]

redacteduser@redactedhost:~/redacteddir$ git log -1 | grep ^commit
commit 7a9d46c373b23a1065ae1731474da110f2dcdbf8

redacteduser@redactedhost:~/redacteddir$ /usr/bin/python3 --version
Python 3.8.10

redacteduser@redactedhost:~/redacteddir$ $ pip3 install -r requirements.txt
Requirement already satisfied: boto3 in /home/redacteduser/.local/lib/python3.8/site-packages (from -r requirements.txt (line 1)) (1.4.7)
Requirement already satisfied: s3transfer<0.2.0,>=0.1.10 in /home/redacteduser/.local/lib/python3.8/site-packages (from boto3->-r requirements.txt (line 1)) (0.1.13)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /home/redacteduser/.local/lib/python3.8/site-packages (from boto3->-r requirements.txt (line 1)) (0.10.0)
Requirement already satisfied: botocore<1.8.0,>=1.7.0 in /home/redacteduser/.local/lib/python3.8/site-packages (from boto3->-r requirements.txt (line 1)) (1.7.48)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/lib/python3/dist-packages (from botocore<1.8.0,>=1.7.0->boto3->-r requirements.txt (line 1)) (2.7.3)
Requirement already satisfied: docutils>=0.10 in /home/redacteduser/.local/lib/python3.8/site-packages (from botocore<1.8.0,>=1.7.0->boto3->-r requirements.txt (line 1)) (0.15.2)


redacteduser@redactedhost:~/redacteddir$ python3 ./aws_list_resources.py
Traceback (most recent call last):
  File "./aws_list_resources.py", line 12, in <module>
    boto_config = botocore.config.Config(
  File "/home/redacteduser/.local/lib/python3.8/site-packages/botocore/config.py", line 135, in __init__
    self._validate_retry_configuration(self.retries)
  File "/home/redacteduser/.local/lib/python3.8/site-packages/botocore/config.py", line 181, in _validate_retry_configuration
    raise InvalidRetryConfigurationError(
botocore.exceptions.InvalidRetryConfigurationError: Cannot provide retry configuration for "mode". Valid retry configuration options are: 'max_attempts'

redacteduser@redactedhost:~/redacteddir$ 

(Additional blank lines were added and redactions made as indicated)

Can you recommend how to solve this?
Thanks!

Hi @ABCMoNa !

Thank you for bringing this up! You included a lot of detail, which is great.
I see that your boto3 version is a bit dated. The pip3 install -r requirements.txt command unfortunately does not update it, because I failed to specify a minium required version in there. I corrected this now and commited a change.

Could you please pull and try again? Alternatively, it should also work if you run
pip install boto3 --upgrade

Cheers,
Michael

Thank you, Michael.

After a git pull, I did run pip3 install -r requirements.txt as suggested, which installed (actually upgraded) some of the dependencies:

  • boto3-1.25.5-py3-none-any.whl
  • botocore-1.28.5-py3-none-any.whl
  • s3transfer-0.6.0-py3-none-any.whl

I am now able to run the script and have it return the usage info.

I therefore consider this issue to be fixed.