How to Fix docker.errors.DockerException: Error while fetching server API version: HTTPConnection.request() got an unexpected keyword argument ‘chunked’

If you need to test drive WordPress, Try it now!

Sharing is caring!

You will most likely see this error even on a fresh Ubuntu installation. It’s really strange how nobody caught that.

Yes, it’s frustrating, I know especially if you’re very busy.

it is possible to that this error is related to some python modules/libraries

 requests<2.29.0′ and ‘urllib3<2.0 according to the ticket below. They suggest downgrading but I prefer not to do that.

https://github.com/google-deepmind/alphafold/issues/867

The Solution how to fix the docker error:server API version: HTTPConnection.request() got an unexpected keyword argument ‘chunked’ 

The way to fix this is to use docker compose v2

On Ubuntu linux you can install this by running this command.

Initially I just tried docker-compose2 but the developers wanted to be more verbose I guess.

To install Docker Compose v2 run this command as root.

sudo apt install -y docker-compose-v2

The difference is that you will now use compose as a docker subcommand 

e.g. docker compose and not like you used to docker-compose (dash separated).

New Command

docker compose ....

if you get a docker error docker: ‘compose’ is not a docker command. you need to really install docker-compose-v2 and not skip steps 🙂

Sharing is caring!

If you need to test drive WordPress, Try it now!
This code shared in this post/site is provided "AS IS" without any warranties or guarantees of any kind. The authors and distributors of this code cannot be held responsible for any damage, data loss, or other issues that may arise from its use. It is strongly recommended that you test this code in a staging environment before deploying it to a live site. Always ensure you have proper backups and understand the implications of running this code on your WordPress installation. Use at your own risk.

Leave a Comment

Your email address will not be published. Required fields are marked *