kraker / ansible-role-jenkins

Ansible Role - Jenkins CI
MIT License
0 stars 0 forks source link

zypper lock bug #2

Open kraker opened 1 year ago

kraker commented 1 year ago

If pipelining=false in ansible.cfg then community.general.zypper module will sometimes fail after installing the Jenkins repository because zypper won't be able to achieve a lock. The following error is generated:

TASK [kraker.jenkins : Ensure Jenkins is installed.] ****************************************************
task path: /home/akraker/ansible-lab/roles/kraker.jenkins/tasks/setup-Suse.yml:39
fatal: [labelakb1.nimbl.lab]: FAILED! => {
    "changed": false,
    "cmd": [
        "/usr/bin/zypper",
        "--quiet",
        "--non-interactive",
        "--xmlout",
        "--disable-repositories",
        "search",
        "--type",
        "package",
        "--match-exact",
        "--details",
        "--installed-only",
        "jenkins"
    ],
    "invocation": {
        "module_args": {
            "allow_vendor_change": false,
            "clean_deps": false,
            "disable_gpg_check": false,
            "disable_recommends": true,
            "extra_args": null,
            "extra_args_precommand": null,
            "force": false,
            "force_resolution": false,
            "name": [
                "jenkins"
            ],
            "oldpackage": false,
            "replacefiles": false,
            "state": "present",
            "type": "package",
            "update_cache": false
        }
    },
    "msg": "Zypper run command failed with return code 7.",
    "rc": 7,
    "stderr": "",
    "stderr_lines": [],
    "stdout": "<?xml version='1.0'?>\n<stream>\n<prompt id=\"23\">\n<text>Ask PackageKit to quit?</text>\n<option value=\"yes\" desc=\"\"/>\n<option default=\"1\" value=\"no\" desc=\"\"/>\n</prompt>\n<message type=\"error\">System management is locked by the application with pid 28666 (/usr/lib/packagekitd).\nClose this application before trying again.</message>\n</stream>\n",
    "stdout_lines": [
        "<?xml version='1.0'?>",
        "<stream>",
        "<prompt id=\"23\">",
        "<text>Ask PackageKit to quit?</text>",
        "<option value=\"yes\" desc=\"\"/>",
        "<option default=\"1\" value=\"no\" desc=\"\"/>",
        "</prompt>",
        "<message type=\"error\">System management is locked by the application with pid 28666 (/usr/lib/packagekitd).",
        "Close this application before trying again.</message>",
        "</stream>"
    ]
}

This error occurs even when the envar is a reasonable amount such as: ZYPPER_LOCK_TIMEOUT=20

The work-around is to set pipelineing=true in ansible.cfg.

github-actions[bot] commented 12 months ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.