Skip to content

Cannot open temporary file #244

Open
@henrylegrys

Description

@henrylegrys
SUMMARY

Terrible bug report incoming, apologies

fatal: [192.168.2.34]: FAILED! => {"changed": false, "err": "open /tmp/tmpz5eaqccd: no such file or directory\n", "msg": "docker stack up deploy command failed", "out": "", "rc": 1, "stderr": "open /tmp/tmpz5eaqccd: no such file or directory\n", "stderr_lines": ["open /tmp/tmpz5eaqccd: no such file or directory"], "stdout": "", "stdout_lines": []}

I'm not sure how this is happening but something appears to be going wrong with the script's mkstemp.
I haven't figured out a good way to debug whether the file is even created or not.

ISSUE TYPE
  • Bug Report
  • Support request
COMPONENT NAME

docker-stack

ANSIBLE VERSION
ansible [core 2.11.6]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/henry/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/henry/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/henry/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/henry/.local/bin/ansible
  python version = 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0]
  jinja version = 3.0.3
  libyaml = True
COLLECTION VERSION
# /home/henry/.local/lib/python3.8/site-packages/ansible_collections
Collection       Version
---------------- -------
community.docker 1.10.1

# /home/henry/.ansible/collections/ansible_collections
Collection       Version
---------------- -------
community.docker 2.0.1

(wait why are there two)

CONFIGURATION

[no output]

OS / ENVIRONMENT

local & remote version: Ubuntu 20.04.3 LTS (Focal Fossa) x86_64

STEPS TO REPRODUCE
  1. Attempt to run the below playbook (use a minimal docker-stack.yml)
  2. ???
  3. Problems occur
---
- name: Docker stack deploy
  tasks:
  - name: Install jsondiff
    pip:
      name: jsondiff
  - name: Install pyyaml
    pip:
      name: pyyaml
  - name: Read docker-stack
    include_vars:
      file: docker-stack.yml
      name: stack
  - name: Deploy stack
    community.docker.docker_stack:
      state: present
      name: consul
      compose:
      - "{{ stack }}"
EXPECTED RESULTS

Docker stack deploy completes successfully

ACTUAL RESULTS

Docker stack fails to deploy, because docker stack deploy -f /tmp/tmp716q8ixn cannot find the file specified

fatal: [192.168.2.34]: FAILED! => {
    "changed": false,
    "err": "open /tmp/tmp716q8ixn: no such file or directory\n",
    "invocation": {
        "module_args": {
            "absent_retries": 0,
            "absent_retries_interval": 1,
            "compose": [
                {
                    "networks": {
                        "hostnet": {
                            "external": true,
                            "name": "host"
                        }
                    },
                    "services": {
                        "consul": {
                            "command": "consul agent -server -config_dir /consul/config",
                            "deploy": {
                                "restart_policy": {
                                    "condition": "any"
                                }
                            },
                            "environment": {
                                "CONSUL_ALLOW_PRIVILEGED_PORTS": ""
                            },
                            "image": "consul:1.9.11",
                            "networks": [
                                "hostnet"
                            ],
                            "volumes": [
                                "/var/lib/consul:/consul/data",
                                "/etc/consul:/consul/config"
                            ]
                        }
                    },
                    "version": "3.6"
                }
            ],
            "name": "consul",
            "prune": false,
            "resolve_image": null,
            "state": "present",
            "with_registry_auth": false
        }
    },
    "msg": "docker stack up deploy command failed",
    "out": "",
    "rc": 1,
    "stderr": "open /tmp/tmp716q8ixn: no such file or directory\n",
    "stderr_lines": [
        "open /tmp/tmp716q8ixn: no such file or directory"
    ],
    "stdout": "",
    "stdout_lines": []
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions