You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using docker-compose up -d after using docker-compose pull (as per documentation) to upgrade containers, the setup stops working and containers don't come up. The main problem seems to be the Redis container throwing a bunch of error messages, more information below.
Solution/Workaround
Use the command docker-compose down before docker-compose up -d, as in:
docker-compose pull
docker-compose down
docker-compose up -d
Pretty much the whole issue as well as suggested solutions are described here:
I will copy and paste some stuff from the link, so people can find this.
When I run sudo docker-compose up -d, I get the following output:
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 33, in <module>
sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main
command_func()
File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 203, in perform_command
handler(command, command_options)
File "/usr/lib/python3/dist-packages/compose/metrics/decorator.py", line 18, in wrapper
result = fn(*args, **kwargs)
File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1186, in up
to_attach = up(False)
File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1166, in up
return self.project.up(
File "/usr/lib/python3/dist-packages/compose/project.py", line 697, in up
results, errors = parallel.parallel_execute(
File "/usr/lib/python3/dist-packages/compose/parallel.py", line 108, in parallel_execute
raise error_to_reraise
File "/usr/lib/python3/dist-packages/compose/parallel.py", line 206, in producer
result = func(obj)
File "/usr/lib/python3/dist-packages/compose/project.py", line 679, in do
return service.execute_convergence_plan(
File "/usr/lib/python3/dist-packages/compose/service.py", line 579, in execute_convergence_plan
return self._execute_convergence_recreate(
File "/usr/lib/python3/dist-packages/compose/service.py", line 499, in _execute_convergence_recreate
containers, errors = parallel_execute(
File "/usr/lib/python3/dist-packages/compose/parallel.py", line 108, in parallel_execute
raise error_to_reraise
File "/usr/lib/python3/dist-packages/compose/parallel.py", line 206, in producer
result = func(obj)
File "/usr/lib/python3/dist-packages/compose/service.py", line 494, in recreate
return self.recreate_container(
File "/usr/lib/python3/dist-packages/compose/service.py", line 612, in recreate_container
new_container = self.create_container(
File "/usr/lib/python3/dist-packages/compose/service.py", line 330, in create_container
container_options = self._get_container_create_options(
File "/usr/lib/python3/dist-packages/compose/service.py", line 921, in _get_container_create_options
container_options, override_options = self._build_container_volume_options(
File "/usr/lib/python3/dist-packages/compose/service.py", line 960, in _build_container_volume_options
binds, affinity = merge_volume_bindings(
File "/usr/lib/python3/dist-packages/compose/service.py", line 1548, in merge_volume_bindings
old_volumes, old_mounts = get_container_data_volumes(
File "/usr/lib/python3/dist-packages/compose/service.py", line 1579, in get_container_data_volumes
container.image_config['ContainerConfig'].get('Volumes') or {}
KeyError: 'ContainerConfig'
Alas, my attempt at fixing this problem using the new command "docker compose" without the hyphen resulted in a set of new volume folders for the persistent data, which were empty. The old ones were still there. Because "docker compose" uses a new syntax for creating names of volume folders.
So when moving from "docker-compose" to "docker compose", I guess everyone will either need to rename their folders for persistent data (does this actually work?) or change the yaml file to point to the exact locations. My configuration still mirrors the example. It currently looks like this:
I believe all of the documentation + examples should be updated but this also means some files needs to be renamed. I've been using docker compose in place of docker-compose since docker put up the notices for the v1 syntax.
Compose nowadays use compose.yaml or compose.yml as filename, where everything here mentions docker-compose.yml and in very rare edge cases having docker-compose.yml as file can cause problems. It has been a while since i migrated from v1 to v2 but i don't remember having any data loss from that change, and the named volumes i had were working fine. The only imporant thing is to do docker-compose down before doing docker compose up -d (note the dashes in the command and the order of execution) and it should be fine.
Problem
When using
docker-compose up -d
after usingdocker-compose pull
(as per documentation) to upgrade containers, the setup stops working and containers don't come up. The main problem seems to be the Redis container throwing a bunch of error messages, more information below.Solution/Workaround
Use the command
docker-compose down
beforedocker-compose up -d
, as in:Pretty much the whole issue as well as suggested solutions are described here:
[Docker-compose giving 'ContainerConfig' errors after update today](https://askubuntu.com/questions/1508129/docker-compose-giving-containerconfig-errors-after-update-today)
I will copy and paste some stuff from the link, so people can find this.
When I run sudo docker-compose up -d, I get the following output:
Alas, my attempt at fixing this problem using the new command "docker compose" without the hyphen resulted in a set of new volume folders for the persistent data, which were empty. The old ones were still there. Because "docker compose" uses a new syntax for creating names of volume folders.
So when moving from "docker-compose" to "docker compose", I guess everyone will either need to rename their folders for persistent data (does this actually work?) or change the yaml file to point to the exact locations. My configuration still mirrors the example. It currently looks like this:
The resulting folder is named as such:
dockernextcloud_nextcloud
The "docker compose" command on the same yaml creates a new folder from scratch with this name:
docker_nextcloud_nextcloud
The text was updated successfully, but these errors were encountered: