Skip to content

Explain how to upgrade when boto3 is too old for the obj plugin - #940

Open
lyelgate wants to merge 1 commit into
linode:devfrom
lyelgate:fix/obj-outdated-boto3
Open

lyelgate wants to merge 1 commit into
linode:devfrom
lyelgate:fix/obj-outdated-boto3

Conversation

@lyelgate

@lyelgate lyelgate commented Nov 1, 2026

Copy link
Copy Markdown

📝 Description

What does this PR do and why is this change necessary?

Fixes #769.

The S3 client is configured with request_checksum_calculation and response_checksum_validation, which botocore only accepts from 1.36.0. With an older boto3 installed, every linode-cli obj command crashed with TypeError: Got unexpected keyword argument 'request_checksum_calculation', which doesn't tell the user what to do. As noted on the issue, the fix is to upgrade boto3.

This PR checks the botocore version when the plugin is invoked, next to the existing check for a missing boto3, and exits with the same exit code and a message naming the installed version and how to upgrade:

This plugin requires boto3 1.36.0 or later, but botocore 1.35.99 is installed. Please upgrade it by running 'pip3 install --upgrade boto3', or reinstall the CLI with its Object Storage dependencies: 'pip3 install --upgrade "linode-cli[obj]"'

The check is on botocore because that is where Config rejects the options; boto3 releases use the matching botocore version. The minimum is a MIN_BOTOCORE_VERSION constant in obj/config.py, matching the boto3>=1.36.0 already declared for the obj extra in pyproject.toml. It uses packaging, which is already a dependency.

✔️ How to Test

What are the steps to reproduce the issue or verify the changes?

pip install "boto3<1.36"
linode-cli obj ls     # before: TypeError traceback; after: the upgrade message above
pip install -U boto3
linode-cli obj ls     # works as before

How do I run the relevant unit/integration tests?

LINODE_CLI_TEST_MODE=1 pytest tests/unit/test_plugin_obj.py -k botocore

The new tests accept 1.36.0 and a newer version, reject 1.35.99 with the upgrade message, and check that linode-cli obj ls exits before running the command when botocore is outdated. That last test fails without this change. black, isort, autoflake and pylint pass, and so does make test-unit.

The S3 client is configured with request_checksum_calculation and
response_checksum_validation, which botocore only accepts from 1.36.0.
With an older boto3 installed, every obj command crashed with
"TypeError: Got unexpected keyword argument
'request_checksum_calculation'".

Check the botocore version when the plugin is invoked, next to the
existing check for a missing boto3, and exit with a message that names
the installed version and how to upgrade it.

Fixes linode#769
@lyelgate
lyelgate requested review from a team as code owners November 1, 2026 11:35
@lyelgate
lyelgate requested review from psnoch-akamai and zliang-akamai and removed request for a team November 1, 2026 11:35

This branch has not been deployed

No deployments
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.

[Bug]: TypeError: Got unexpected keyword argument 'request_checksum_calculation'

1 participant