I attempted to do a brewblox-ctl update. I ended up with this error which looks docker-compose related.
Any ideas?
brewblox-ctl up
Traceback (most recent call last):
File “/home/pi/.local/bin/docker-compose”, line 10, in
sys.exit(main())
File “/home/pi/.local/lib/python3.7/site-packages/compose/cli/main.py”, line 72, in main
command()
File “/home/pi/.local/lib/python3.7/site-packages/compose/cli/main.py”, line 125, in perform_command
project = project_from_options(’.’, options)
File “/home/pi/.local/lib/python3.7/site-packages/compose/cli/command.py”, line 76, in project_from_options
environment_file=environment_file
File “/home/pi/.local/lib/python3.7/site-packages/compose/cli/command.py”, line 142, in get_project
verbose=verbose, version=api_version, context=context, environment=environment
File “/home/pi/.local/lib/python3.7/site-packages/compose/cli/docker_client.py”, line 47, in get_client
environment=environment, tls_version=get_tls_version(environment)
File “/home/pi/.local/lib/python3.7/site-packages/compose/cli/docker_client.py”, line 147, in docker_client
if not context.is_docker_host():
AttributeError: ‘Context’ object has no attribute ‘is_docker_host’
Command ‘docker-compose up -d --remove-orphans’ returned non-zero exit status 1.
Thanks
This sounds like a version mismatch somewhere.
Could you please run
docker version
docker-compose --version
Here you go:
docker version
Client: Docker Engine - Community
Version: 19.03.12
API version: 1.40
Go version: go1.13.10
Git commit: 48a6621
Built: Mon Jun 22 15:53:41 2020
OS/Arch: linux/arm
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.12
API version: 1.40 (minimum version 1.12)
Go version: go1.13.10
Git commit: 48a6621
Built: Mon Jun 22 15:47:34 2020
OS/Arch: linux/arm
Experimental: false
containerd:
Version: 1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
docker-compose --version
docker-compose version 1.26.2, build unknown
Those versions are latest.
To force updated installs of python packages, you can run
pip3 install --user --update --no-cache brewblox-ctl
pip3 freeze
You can ignore the error about launchpad lacking testresources.
That ran ok. But brewblox-ctl (up/down/update) all seem to fail
AttributeError: ‘Context’ object has no attribute ‘is_docker_host’
Command ‘docker-compose down --remove-orphans’ returned non-zero exit status 1.
If I run docker-compose up I get this error. Maybe its a docker-compose issue?
Traceback (most recent call last):
File “/home/pi/.local/bin/docker-compose”, line 10, in
sys.exit(main())
File “/home/pi/.local/lib/python3.7/site-packages/compose/cli/main.py”, line 72, in main
command()
File “/home/pi/.local/lib/python3.7/site-packages/compose/cli/main.py”, line 125, in perform_command
project = project_from_options(’.’, options)
File “/home/pi/.local/lib/python3.7/site-packages/compose/cli/command.py”, line 76, in project_from_options
environment_file=environment_file
File “/home/pi/.local/lib/python3.7/site-packages/compose/cli/command.py”, line 142, in get_project
verbose=verbose, version=api_version, context=context, environment=environment
File “/home/pi/.local/lib/python3.7/site-packages/compose/cli/docker_client.py”, line 47, in get_client
environment=environment, tls_version=get_tls_version(environment)
File “/home/pi/.local/lib/python3.7/site-packages/compose/cli/docker_client.py”, line 147, in docker_client
if not context.is_docker_host():
AttributeError: ‘Context’ object has no attribute ‘is_docker_host’
The problem seems to be a possible version mismatch between the docker and docker-compose packages in python.
You can check by running pip3 show docker
. If it reports version 4.2.1
, then the issue should be fixed by running pip3 install --user --upgrade --no-cache docker
(this should install version 4.3.1).
Thanks Bob that fixed the issue.
Cheers
1 Like