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

Removing curl is not enough to remove libcurl.a #20

Open
lalmeras opened this issue Feb 3, 2018 · 6 comments
Open

Removing curl is not enough to remove libcurl.a #20

lalmeras opened this issue Feb 3, 2018 · 6 comments

Comments

@lalmeras
Copy link

lalmeras commented Feb 3, 2018

Your role triggers an error at second run here because removing curl package does not remove libcurl.a file (first run install conda, uninstall curl conda package, let libcurl.a, then second run fails because libcurl.a is still here, so curl conda package uninstall is triggered again and fail because this package is not installed).

Removing libcurl may be a better choice (and also remove curl).

Error at second run:

TASK [andrewrothstein.anaconda : update conda pkgs...] ************************************************************************************************************************************************************
changed: [jupyter.lxc]

TASK [andrewrothstein.anaconda : remove conda-curl since it conflicts with the system curl] ***********************************************************************************************************************
fatal: [jupyter.lxc]: FAILED! => {"changed": true, "cmd": ["/usr/local/anaconda/bin/conda", "remove", "-y", "curl"], "delta": "0:00:01.138967", "end": "2018-02-03 16:01:53.361129", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2018-02-03 16:01:52.222162", "stderr": "\nPackagesNotFoundError: The following packages are missing from the target environment:\n  - curl", "stderr_lines": ["", "PackagesNotFoundError: The following packages are missing from the target environment:", "  - curl"], "stdout": "Solving environment: ...working... failed", "stdout_lines": ["Solving environment: ...working... failed"]}
	to retry, use: --limit @/home/lalmeras/git/log/jupyter.retry
@andrewrothstein
Copy link
Owner

this part about conda-curl is so janky. I wonder why the Continuum folks haven't fixed it.

I just installed the role on my desktop. Ran it multiple times without issue. I see the removal of the conda package and the corresponding removal of libconda.a. Subsequent runs register this task as "ok".

Can you explain to me how you see /usr/local/anaconda/bin/libcurl.a present after removing the conda-curl Anaconda package?

@jelinekb
Copy link

jelinekb commented Feb 6, 2018

+1 Same error as above. I do not have /usr/local/anaconda/bin/libcurl.a after running. New at ansible, so not sure what other information I can provide to be helpful.

fatal: [localhost]: FAILED! => {
    "changed": true, 
    "cmd": [
        "/usr/local/anaconda/bin/conda", 
        "remove", 
        "-y", 
        "curl"
    ], 
    "delta": "0:00:00.990368", 
    "end": "2018-02-05 23:17:30.008441", 
    "invocation": {
        "module_args": {
            "_raw_params": "/usr/local/anaconda/bin/conda remove -y curl", 
            "_uses_shell": false, 
            "chdir": null, 
            "creates": null, 
            "executable": null, 
            "removes": "/usr/local/anaconda/lib/libcurl.a", 
            "stdin": null, 
            "warn": true
        }
    }, 
    "msg": "non-zero return code", 
    "rc": 1, 
    "start": "2018-02-05 23:17:29.018073", 
    "stderr": "\nPackagesNotFoundError: The following packages are missing from the target environment:\n  - curl", 
    "stderr_lines": [
        "", 
        "PackagesNotFoundError: The following packages are missing from the target environment:", 
        "  - curl"
    ], 
    "stdout": "Solving environment: ...working... failed", 
    "stdout_lines": [
        "Solving environment: ...working... failed"
    ]
}

@lalmeras
Copy link
Author

lalmeras commented Feb 6, 2018

On my side, libcurl.a is from libcurl package, and removing curl package do not remove libcurl, hence my bug. Do you have a libcurl package on your side ? Is it removed ?

@jelinekb if you manually remove libcurl package (/usr/local/anaconda/bin/conda remove -y libcurl), next ansible run should be ok.

@bilsch
Copy link

bilsch commented Feb 7, 2018

yea I ran into the same issue. Have to remove curl and libcurl then the playbook is less angry

@andrewrothstein
Copy link
Owner

What version of Anaconda are you using? I use docker to test my roles on fresh installations and for the latest with Python 3 removing the curl module does the deed. It looks like the curl package depends on the libcurl package. Are you subsequently adding a package that has a libcurl dependency? Really wish there was a conda Ansible module to idempotently ensure both the curl and libcurl packages are absent.

@mathiaHT
Copy link

Hello,
I m using the role with ansible 2.9.7 on vagrant with ubuntu/bionic64.

It also fails at this tasks but because module distutils.spawn is missing:

The full traceback is:
Traceback (most recent call last):
  File "/home/vagrant/.ansible/tmp/ansible-tmp-1589126021.76-11272-80941276865077/AnsiballZ_conda.py", line 102, in <module>
    _ansiballz_main()
  File "/home/vagrant/.ansible/tmp/ansible-tmp-1589126021.76-11272-80941276865077/AnsiballZ_conda.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/vagrant/.ansible/tmp/ansible-tmp-1589126021.76-11272-80941276865077/AnsiballZ_conda.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible.modules.conda', init_globals=None, run_name='__main__', alter_sys=True)
  File "/usr/lib/python3.6/runpy.py", line 205, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_conda_payload_6sq8n7a6/ansible_conda_payload.zip/ansible/modules/conda.py", line 73, in <module>
ModuleNotFoundError: No module named 'distutils.spawn'
fatal: [localhost]: FAILED! => {
    "changed": false, 
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/vagrant/.ansible/tmp/ansible-tmp-1589126021.76-11272-80941276865077/AnsiballZ_conda.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/home/vagrant/.ansible/tmp/ansible-tmp-1589126021.76-11272-80941276865077/AnsiballZ_conda.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/vagrant/.ansible/tmp/ansible-tmp-1589126021.76-11272-80941276865077/AnsiballZ_conda.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.conda', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.6/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/lib/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_conda_payload_6sq8n7a6/ansible_conda_payload.zip/ansible/modules/conda.py\", line 73, in <module>\nModuleNotFoundError: No module named 'distutils.spawn'\n", 
    "module_stdout": "", 
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", 
    "rc": 1
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants