Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report #948

Closed
serialscaresme opened this issue Aug 3, 2024 · 4 comments · Fixed by #949
Closed

Bug Report #948

serialscaresme opened this issue Aug 3, 2024 · 4 comments · Fixed by #949
Labels
bug Something isn't working docker-compose-v2 Docker Compose v2

Comments

@serialscaresme
Copy link

SUMMARY

I have no idea what is going on, but the log told me to report the issue.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

unsure, using internet pi by jeff geerling

ANSIBLE VERSION

COLLECTION VERSION

CONFIGURATION

OS / ENVIRONMENT

OS- rasbian

STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
pi@raspberrypi:~/internet-pi $ nsible-galaxy collection install -r requirements.yml
bash: nsible-galaxy: command not found
pi@raspberrypi:~/internet-pi $ ansible-galaxy collection install -r requirements.yml
Starting galaxy collection install process
Nothing to do. All requested collections are already installed. If you want to reinstall them, consider using `--force`.
pi@raspberrypi:~/internet-pi $ ansible-playbook main.yml
ERROR! couldn't resolve module/action 'community.docker.docker_compose_v2'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/home/pi/internet-pi/tasks/handlers.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: Restart pi-hole
  ^ here
pi@raspberrypi:~/internet-pi $ ansible-galaxy collection install -r requirements.yml --force
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ansible-posix-1.5.4.tar.gz to /home/pi/.ansible/tmp/ansible-local-11040h_mgy0qk/tmp8r92a6se/ansible-posix-1.5.4-9v__v98x
Installing 'ansible.posix:1.5.4' to '/home/pi/.ansible/collections/ansible_collections/ansible/posix'
ansible.posix:1.5.4 was installed successfully
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/community-docker-3.11.0.tar.gz to /home/pi/.ansible/tmp/ansible-local-11040h_mgy0qk/tmp8r92a6se/community-docker-3.11.0-5d6y1n83
Installing 'community.docker:3.11.0' to '/home/pi/.ansible/collections/ansible_collections/community/docker'
community.docker:3.11.0 was installed successfully
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/community-library_inventory_filtering_v1-1.0.1.tar.gz to /home/pi/.ansible/tmp/ansible-local-11040h_mgy0qk/tmp8r92a6se/community-library_inventory_filtering_v1-1.0.1-mn5zsod8
Installing 'community.library_inventory_filtering_v1:1.0.1' to '/home/pi/.ansible/collections/ansible_collections/community/library_inventory_filtering_v1'
community.library_inventory_filtering_v1:1.0.1 was installed successfully
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/community-general-9.2.0.tar.gz to /home/pi/.ansible/tmp/ansible-local-11040h_mgy0qk/tmp8r92a6se/community-general-9.2.0-9krcu3im
Installing 'community.general:9.2.0' to '/home/pi/.ansible/collections/ansible_collections/community/general'
community.general:9.2.0 was installed successfully
pi@raspberrypi:~/internet-pi $ ansible-playbook main.yml

PLAY [Configure Internet Pi.] **********************************************************************************************

TASK [Gathering Facts] *****************************************************************************************************
ok: [192.168.2.2]

TASK [Load configuration (with defaults from example file).] ***************************************************************
ok: [192.168.2.2] => (item=example.config.yml)
ok: [192.168.2.2] => (item=config.yml)

TASK [Ensure apt cache is up to date.] *************************************************************************************
ok: [192.168.2.2]

TASK [Ensure pacman cache is up to date] ***********************************************************************************
skipping: [192.168.2.2]

TASK [Check if Docker is already present.] *********************************************************************************
ok: [192.168.2.2]

TASK [Download Docker install convenience script.] *************************************************************************
skipping: [192.168.2.2]

TASK [Run Docker install convenience script.] ******************************************************************************
skipping: [192.168.2.2]

TASK [Ensure Docker is started.] *******************************************************************************************
ok: [192.168.2.2]

TASK [Ensure dependencies are installed (Debian).] *************************************************************************
changed: [192.168.2.2]

TASK [Ensure dependencies are installed (Archlinux).] **********************************************************************
skipping: [192.168.2.2]

TASK [Ensure user is added to the docker group: pi] ************************************************************************
ok: [192.168.2.2]

TASK [Reset connection so docker group is picked up.] **********************************************************************
[WARNING]: Reset is not implemented for this connection

TASK [Gather package facts.] ***********************************************************************************************
skipping: [192.168.2.2]

TASK [Add Buster backports apt key.] ***************************************************************************************
skipping: [192.168.2.2] => (item=04EE7237B7D453EC) 
skipping: [192.168.2.2] => (item=648ACFD622F3D138) 
skipping: [192.168.2.2] => (item=0E98404D386FA1D9) 
skipping: [192.168.2.2] => (item=6ED0E7B82643E131) 
skipping: [192.168.2.2]

TASK [Add Buster backports for fixed libseccomp2.] *************************************************************************
skipping: [192.168.2.2]

TASK [Install >libseccomp2.4.4 to fix 32-bit OS issue.] ********************************************************************
skipping: [192.168.2.2]

TASK [Synchronize internet-monitoring directory.] **************************************************************************
changed: [192.168.2.2]

TASK [Ensure internet-monitoring directory is not a Git repository.] *******************************************************
ok: [192.168.2.2]

TASK [Copy templated internet-monitoring files into place.] ****************************************************************
changed: [192.168.2.2] => (item={'src': 'docker-compose.yml.j2', 'dest': 'docker-compose.yml'})
changed: [192.168.2.2] => (item={'src': 'grafana-config.monitoring.j2', 'dest': 'grafana/config.monitoring'})
changed: [192.168.2.2] => (item={'src': 'prometheus.yml.j2', 'dest': 'prometheus/prometheus.yml'})
changed: [192.168.2.2] => (item={'src': 'prometheus-pinghosts.yaml.j2', 'dest': 'prometheus/pinghosts.yaml'})

TASK [Ensure internet-monitoring environment is running.] ******************************************************************
[WARNING]: Cannot parse event from line: 'network internet-monitoring-front-tier was found but has incorrect label
com.docker.compose.network set to "internet-monitoring-front-tier"'. Please report this at https://github.com/ansible-
collections/community.docker/issues/new?assignees=&labels=&projects=&template=bug_report.md
fatal: [192.168.2.2]: FAILED! => {"actions": [{"id": "prometheus", "status": "Pulling", "what": "service"}], "changed": false, "cmd": "/usr/bin/docker compose --ansi never --progress plain --project-directory /home/pi/internet-monitoring up --detach --no-color --quiet-pull --no-build --", "containers": [{"Command": "\"/run.sh\"", "CreatedAt": "2023-07-16 18:56:47 -0700 MST", "ExitCode": 0, "Health": "", "ID": "fc68dc2658f72446181799262d72594b4d3deac42d5f853781eb4be1b59d99c9", "Image": "grafana/grafana", "Labels": {"com.docker.compose.config-hash": "d74687c5fc25ce7c3470c50e5954779a72e98f9add9807f26503b7e865eb7dca", "com.docker.compose.container-number": "1", "com.docker.compose.oneoff": "False", "com.docker.compose.project": "internet-monitoring", "com.docker.compose.project.config_files": "/home/pi/internet-monitoring/docker-compose.yml", "com.docker.compose.project.working_dir": "/home/pi/internet-monitoring", "com.docker.compose.service": "grafana", "com.docker.compose.version": "1.29.2", "maintainer": "Grafana Labs <[email protected]>", "mode": "release"}, "LocalVolumes": "1", "Mounts": "internet-monitoring_grafana_data,/home/pi/internet-monitoring/grafana/provisioning", "Name": "internet-monitoring_grafana_1", "Names": ["internet-monitoring_grafana_1"], "Networks": ["internet-monitoring-back-tier", "internet-monitoring-front-tier"], "Ports": "0.0.0.0:3030->3000/tcp, :::3030->3000/tcp", "Project": "internet-monitoring", "Publishers": [{"Protocol": "tcp", "PublishedPort": 3030, "TargetPort": 3000, "URL": "0.0.0.0"}, {"Protocol": "tcp", "PublishedPort": 3030, "TargetPort": 3000, "URL": "::"}], "RunningFor": "12 months ago", "Service": "grafana", "Size": "0B", "State": "running", "Status": "Up 41 minutes"}, {"Command": "\"/bin/node_exporter --path.procfs=/host/proc --path.sysfs=/host/sys --collector.filesystem.ignored-mount-points ^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($|/)\"", "CreatedAt": "2023-07-16 18:56:08 -0700 MST", "ExitCode": 0, "Health": "", "ID": "2378b45b59f9568238999e076c046e2b3a669506d18ba52e19c0b598cca7d83d", "Image": "prom/node-exporter", "Labels": {"com.docker.compose.config-hash": "2bcf63774816e0b181ede3a8defad9153909c2b1ef05e915d684aab4c757916a", "com.docker.compose.container-number": "1", "com.docker.compose.oneoff": "False", "com.docker.compose.project": "internet-monitoring", "com.docker.compose.project.config_files": "/home/pi/internet-monitoring/docker-compose.yml", "com.docker.compose.project.working_dir": "/home/pi/internet-monitoring", "com.docker.compose.service": "nodeexp", "com.docker.compose.version": "1.29.2", "maintainer": "The Prometheus Authors <[email protected]>"}, "LocalVolumes": "0", "Mounts": "/proc,/sys,/", "Name": "internet-monitoring_nodeexp_1", "Names": ["internet-monitoring_nodeexp_1"], "Networks": ["internet-monitoring-back-tier"], "Ports": "0.0.0.0:9100->9100/tcp, :::9100->9100/tcp", "Project": "internet-monitoring", "Publishers": [{"Protocol": "tcp", "PublishedPort": 9100, "TargetPort": 9100, "URL": "0.0.0.0"}, {"Protocol": "tcp", "PublishedPort": 9100, "TargetPort": 9100, "URL": "::"}], "RunningFor": "12 months ago", "Service": "nodeexp", "Size": "0B", "State": "running", "Status": "Up 41 minutes"}, {"Command": "\"/bin/blackbox_exporter --config.file=/config/blackbox.yml\"", "CreatedAt": "2023-07-16 18:56:08 -0700 MST", "ExitCode": 0, "Health": "", "ID": "7f9dc4e9299469b68030e1446b70af8823b5dfa0c398a12ddce8fe82cfaf9be6", "Image": "prom/blackbox-exporter", "Labels": {"com.docker.compose.config-hash": "e1737ef6e9b1d500814c428c253fe01ff1e66c785e3670e260d0c309adff0665", "com.docker.compose.container-number": "1", "com.docker.compose.oneoff": "False", "com.docker.compose.project": "internet-monitoring", "com.docker.compose.project.config_files": "/home/pi/internet-monitoring/docker-compose.yml", "com.docker.compose.project.working_dir": "/home/pi/internet-monitoring", "com.docker.compose.service": "ping", "com.docker.compose.version": "1.29.2", "maintainer": "The Prometheus Authors <[email protected]>"}, "LocalVolumes": "0", "Mounts": "/home/pi/internet-monitoring/blackbox/config", "Name": "internet-monitoring_ping_1", "Names": ["internet-monitoring_ping_1"], "Networks": ["internet-monitoring-back-tier"], "Ports": "0.0.0.0:9115->9115/tcp, :::9115->9115/tcp", "Project": "internet-monitoring", "Publishers": [{"Protocol": "tcp", "PublishedPort": 9115, "TargetPort": 9115, "URL": "0.0.0.0"}, {"Protocol": "tcp", "PublishedPort": 9115, "TargetPort": 9115, "URL": "::"}], "RunningFor": "12 months ago", "Service": "ping", "Size": "0B", "State": "running", "Status": "Up 41 minutes"}, {"Command": "\"/bin/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/prometheus --storage.tsdb.retention.time=90d --web.console.libraries=/usr/share/prometheus/console_libraries --web.console.templates=/usr/share/prometheus/consoles\"", "CreatedAt": "2023-07-16 18:56:44 -0700 MST", "ExitCode": 0, "Health": "", "ID": "738c8c7854957cdf79241793d211839453ce369a843e5b99432422259a52863f", "Image": "prom/prometheus:v2.25.2", "Labels": {"com.docker.compose.config-hash": "10c3229feb72009083ee8c7c8bd5541c75ce1bc8dbb2f415c1c476fa88cbafda", "com.docker.compose.container-number": "1", "com.docker.compose.oneoff": "False", "com.docker.compose.project": "internet-monitoring", "com.docker.compose.project.config_files": "/home/pi/internet-monitoring/docker-compose.yml", "com.docker.compose.project.working_dir": "/home/pi/internet-monitoring", "com.docker.compose.service": "prometheus", "com.docker.compose.version": "1.29.2", "maintainer": "The Prometheus Authors <[email protected]>"}, "LocalVolumes": "1", "Mounts": "/home/pi/internet-monitoring/prometheus,internet-monitoring_prometheus_data", "Name": "internet-monitoring_prometheus_1", "Names": ["internet-monitoring_prometheus_1"], "Networks": ["internet-monitoring-back-tier"], "Ports": "0.0.0.0:9090->9090/tcp, :::9090->9090/tcp", "Project": "internet-monitoring", "Publishers": [{"Protocol": "tcp", "PublishedPort": 9090, "TargetPort": 9090, "URL": "0.0.0.0"}, {"Protocol": "tcp", "PublishedPort": 9090, "TargetPort": 9090, "URL": "::"}], "RunningFor": "12 months ago", "Service": "prometheus", "Size": "0B", "State": "running", "Status": "Up 41 minutes"}, {"Command": "\"python -u exporter.py\"", "CreatedAt": "2023-07-16 18:56:08 -0700 MST", "ExitCode": 0, "Health": "unhealthy", "ID": "ee836ea758b3b7bdd31fda70b0756eddbd85084896abb82fa289c9659af4e024", "Image": "miguelndecarvalho/speedtest-exporter", "Labels": {"com.docker.compose.config-hash": "0aca99d4d8d6441223687a9183eca5d73964963ede847915a56e2a9ad22e450b", "com.docker.compose.container-number": "1", "com.docker.compose.oneoff": "False", "com.docker.compose.project": "internet-monitoring", "com.docker.compose.project.config_files": "/home/pi/internet-monitoring/docker-compose.yml", "com.docker.compose.project.working_dir": "/home/pi/internet-monitoring", "com.docker.compose.service": "speedtest", "com.docker.compose.version": "1.29.2"}, "LocalVolumes": "0", "Mounts": "", "Name": "internet-monitoring_speedtest_1", "Names": ["internet-monitoring_speedtest_1"], "Networks": ["internet-monitoring-back-tier"], "Ports": "0.0.0.0:9798->9798/tcp, :::9798->9798/tcp", "Project": "internet-monitoring", "Publishers": [{"Protocol": "tcp", "PublishedPort": 9798, "TargetPort": 9798, "URL": "0.0.0.0"}, {"Protocol": "tcp", "PublishedPort": 9798, "TargetPort": 9798, "URL": "::"}], "RunningFor": "12 months ago", "Service": "speedtest", "Size": "0B", "State": "running", "Status": "Up 41 minutes (unhealthy)"}], "images": [{"ContainerName": "internet-monitoring_grafana_1", "ID": "sha256:2e31107ed585e53497efa47722a49593f2bcbb221a320909189bbb9f76c55c38", "Repository": "grafana/grafana", "Size": 317219972, "Tag": "latest"}, {"ContainerName": "internet-monitoring_nodeexp_1", "ID": "sha256:6a33998eca8a7ef8cbb574892c6f07420668b90164886cd09a54192a0bef91a2", "Repository": "prom/node-exporter", "Size": 21941179, "Tag": "latest"}, {"ContainerName": "internet-monitoring_ping_1", "ID": "sha256:715e995230252c3067a1ad76e21758f4e81f6e5b68203ad0bb835a64ef74620b", "Repository": "prom/blackbox-exporter", "Size": 23132764, "Tag": "latest"}, {"ContainerName": "internet-monitoring_prometheus_1", "ID": "sha256:7eae18ad96b713fb0722a646b47749e6f6e0c36b873f1cc7f36fd23a04c78e5c", "Repository": "prom/prometheus", "Size": 165184196, "Tag": "v2.25.2"}, {"ContainerName": "internet-monitoring_speedtest_1", "ID": "sha256:256beb9c3f3f5f2bc642e65c32e18082f41ae0dd76c2ca5fa46e3e3fc9e4ef65", "Repository": "miguelndecarvalho/speedtest-exporter", "Size": 72123439, "Tag": "latest"}], "msg": "Return code 1 is non-zero", "rc": 1, "stderr": " prometheus Pulling \n prometheus Pulled \nnetwork internet-monitoring-front-tier was found but has incorrect label com.docker.compose.network set to \"internet-monitoring-front-tier\"\n", "stderr_lines": [" prometheus Pulling ", " prometheus Pulled ", "network internet-monitoring-front-tier was found but has incorrect label com.docker.compose.network set to \"internet-monitoring-front-tier\""], "stdout": "", "stdout_lines": []}

PLAY RECAP *****************************************************************************************************************
192.168.2.2                : ok=10   changed=3    unreachable=0    failed=1    skipped=8    rescued=0    ignored=0
@felixfontein felixfontein added bug Something isn't working docker-compose-v2 Docker Compose v2 labels Aug 4, 2024
@felixfontein
Copy link
Collaborator

Thanks for the report! Can you provide the version of the Docker Compose plugin running on the target? (docker compose version should print it.)

The task is failing because Compose reports an error (it returns a non-zero exit code):

 prometheus Pulling 
 prometheus Pulled 
network internet-monitoring-front-tier was found but has incorrect label com.docker.compose.network set to "internet-monitoring-front-tier"

If you run docker compose up (with the appropriate parameters) manually you should get the same error message. It sounds to me like a network used by Compose was created before and with the wrong value for the label com.docker.compose.network.

@felixfontein
Copy link
Collaborator

I created a fix: #949. @serialscaresme I would really appreciate if you could provide the version of your Docker Compose plugin on the target so I can update that in the tests.

@serialscaresme
Copy link
Author

serialscaresme commented Aug 7, 2024 via email

@felixfontein
Copy link
Collaborator

No worries, thanks for writing back!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docker-compose-v2 Docker Compose v2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants