Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

Instance creation fails if container already exists #22

Closed
ssbarnea opened this issue Nov 26, 2020 · 0 comments · Fixed by #23
Closed

Instance creation fails if container already exists #22

ssbarnea opened this issue Nov 26, 2020 · 0 comments · Fixed by #23
Assignees
Labels
bug This issue/PR relates to a bug.

Comments

@ssbarnea
Copy link
Member

ssbarnea commented Nov 26, 2020

As opposed to docker driver, podman one fails to create an instance if a containere with the same name already exists (not running, only existing).

The fact the original error is not visible even if user adds --debug -vvvv is only making the confusions worse. That error is visible only if user defines MOLECULE_NO_LOG=0.

failed: [localhost] (item={'started': 1, 'finished': 0, 'ansible_job_id': '702879129925.968834', 'results_file': '/home/ssbarnea/.ansible_async/702879129925.968834', 'changed': True, 'failed': False, 'item': {'image': 'docker.io/pycontribs/centos:8', 'name': 'instance', 'pre_build_image': True}, 'ansible_loop_var': 'item'}) => {
    "ansible_job_id": "702879129925.968834",
    "ansible_loop_var": "item",
    "attempts": 1,
    "changed": true,
    "cmd": [
        "podman",
        "run",
        "-d",
        "--name",
        "instance",
        "--hostname=instance",
        "docker.io/pycontribs/centos:8",
        "bash",
        "-c",
        "while true; do sleep 10000; done"
    ],
    "delta": "0:00:00.077548",
    "end": "2020-11-26 09:47:58.774634",
    "finished": 1,
    "invocation": {
        "module_args": {
            "_raw_params": "podman run -d --name \"instance\"                --hostname=instance    docker.io/pycontribs/centos:8 bash -c \"while true; do sleep 10000; done\"\n",
            "_uses_shell": false,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "warn": true
        }
    },
    "item": {
        "ansible_job_id": "702879129925.968834",
        "ansible_loop_var": "item",
        "changed": true,
        "failed": false,
        "finished": 0,
        "item": {
            "image": "docker.io/pycontribs/centos:8",
            "name": "instance",
            "pre_build_image": true
        },
        "results_file": "/home/ssbarnea/.ansible_async/702879129925.968834",
        "started": 1
    },
    "msg": "non-zero return code",
    "rc": 125,
    "start": "2020-11-26 09:47:58.697086",
    "stderr": "Error: error creating container storage: the container name \"instance\" is already in use by \"61394fc453737d29461ff2f4bd7af2419f52e28f5d5403042c8eda88dfae5c12\". You have to remove that container to be able to reuse that name.: that name is already in use",
    "stderr_lines": [
        "Error: error creating container storage: the container name \"instance\" is already in use by \"61394fc453737d29461ff2f4bd7af2419f52e28f5d5403042c8eda88dfae5c12\". You have to remove that container to be able to reuse that name.: that name is already in use"
    ],
    "stdout": "",
    "stdout_lines": []
}

Related: containers/podman#2553

@ssbarnea ssbarnea self-assigned this Nov 26, 2020
@ssbarnea ssbarnea added the bug This issue/PR relates to a bug. label Nov 26, 2020
@ssbarnea ssbarnea changed the title Instance creation fails if image already exists Instance creation fails if container already exists Nov 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant