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

Trying to pull image in compose with pull_policy never pull gives warning #911

Closed
richardwiden opened this issue Jul 5, 2024 · 5 comments · Fixed by #916
Closed

Trying to pull image in compose with pull_policy never pull gives warning #911

richardwiden opened this issue Jul 5, 2024 · 5 comments · Fixed by #916
Labels
docker-compose-v2 Docker Compose v2

Comments

@richardwiden
Copy link

SUMMARY

[WARNING]: Cannot parse event from line: ' Skipped'

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.docker.docker_compose_v2_pull

ANSIBLE VERSION
ansible [core 2.16.8]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/ricwi/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/ricwi/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.12.3 (main, Apr 10 2024, 05:33:47) [GCC 13.2.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION

# /home/ricwi/.ansible/collections/ansible_collections
Collection       Version
---------------- -------
community.docker 3.10.4 

# /usr/lib/python3/dist-packages/ansible_collections
Collection       Version
---------------- -------
community.docker 3.10.4 
CONFIGURATION
CONFIG_FILE() = /etc/ansible/ansible.cfg
EDITOR(env: EDITOR) = /usr/bin/nano
OS / ENVIRONMENT
STEPS TO REPRODUCE
- name: Pull compose
  community.docker.docker_compose_v2_pull:
    project_src: "/home/user/example"
services:
    bash:
        image: bash
        pull_policy: never
        restart: unless-stopped
EXPECTED RESULTS

No output or "done" or similar

ACTUAL RESULTS

[WARNING]: Cannot parse event from line: ' Skipped'


@felixfontein
Copy link
Collaborator

Which version of docker compose are you using? And can you please provide the full stdout output from the docker compose call (it's part of the task's return values)? Thanks.

@felixfontein felixfontein added the docker-compose-v2 Docker Compose v2 label Jul 5, 2024
@richardwiden
Copy link
Author

richardwiden commented Jul 5, 2024

There is no stdout only stderr

TASK [Pull compose] **************************************************************************************************************************************************************************
task path: /home/ricwi/ansible/ansible.yml:5
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: ricwi
<127.0.0.1> EXEC /bin/sh -c 'echo ~ricwi && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/ricwi/.ansible/tmp `"&& mkdir "` echo /home/ricwi/.ansible/tmp/ansible-tmp-1720184353.6289217-124277-138727847118580 `" && echo ansible-tmp-1720184353.6289217-124277-138727847118580="` echo /home/ricwi/.ansible/tmp/ansible-tmp-1720184353.6289217-124277-138727847118580 `" ) && sleep 0'
Using module file /home/ricwi/.ansible/collections/ansible_collections/community/docker/plugins/modules/docker_compose_v2_pull.py
<127.0.0.1> PUT /home/ricwi/.ansible/tmp/ansible-local-124127dihcucpb/tmpnr9rkxwf TO /home/ricwi/.ansible/tmp/ansible-tmp-1720184353.6289217-124277-138727847118580/AnsiballZ_docker_compose_v2_pull.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/ricwi/.ansible/tmp/ansible-tmp-1720184353.6289217-124277-138727847118580/ /home/ricwi/.ansible/tmp/ansible-tmp-1720184353.6289217-124277-138727847118580/AnsiballZ_docker_compose_v2_pull.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/ricwi/.ansible/tmp/ansible-tmp-1720184353.6289217-124277-138727847118580/AnsiballZ_docker_compose_v2_pull.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/ricwi/.ansible/tmp/ansible-tmp-1720184353.6289217-124277-138727847118580/ > /dev/null 2>&1 && sleep 0'
[WARNING]: Cannot parse event from line: 'bash_1 Skipped'. Please report this at https://github.com/ansible-
collections/community.docker/issues/new?assignees=&labels=&projects=&template=bug_report.md
ok: [localhost] => {
    "actions": [
        {
            "id": "bash_2",
            "status": "Pulling",
            "what": "service"
        }
    ],
    "changed": false,
    "invocation": {
        "module_args": {
            "api_version": "auto",
            "ca_path": null,
            "check_files_existing": true,
            "cli_context": null,
            "client_cert": null,
            "client_key": null,
            "definition": null,
            "docker_cli": null,
            "docker_host": "unix:///var/run/docker.sock",
            "env_files": null,
            "files": null,
            "policy": "always",
            "profiles": null,
            "project_name": "ansible",
            "project_src": "/home/ricwi/ansible",
            "tls": false,
            "tls_hostname": null,
            "validate_certs": false
        }
    },
    "stderr": " bash_1 Skipped \n bash_2 Pulling \n bash_2 Pulled \n",
    "stderr_lines": [
        " bash_1 Skipped ",
        " bash_2 Pulling ",
        " bash_2 Pulled "
    ]
}

but

docker-compose --version
Docker Compose version v2.16.0

reproducer:
~/ansible/playbook.yaml

---
- name: Test pause
  hosts: localhost
  tasks:
  - name: Pull compose
    community.docker.docker_compose_v2_pull:
      project_src: "{{ansible_env.HOME}}/ansible"
      project_name: ansible

~/ansible/compose.yaml

services:
  bash_1:
    pull_policy: never
    image: bash
  bash_2:
    pull_policy: always
    image: bash

@felixfontein
Copy link
Collaborator

Does docker compose version also show 2.16.0? (Note that the module requires version 2.18.0 or later; the module should not work when that also shows version 2.16.0.)

@richardwiden
Copy link
Author

docker compose version
Docker Compose version v2.28.1

@felixfontein
Copy link
Collaborator

#916 fixes this.

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

Successfully merging a pull request may close this issue.

2 participants