Hi,
I'm using Ansible to automatically install an application into a conda env.
I created user pmapp.
It has a /home/pmapp directory
I installed Miniconda as root in /opt/miniconda
The ansible process put some files in .ansible directory
I'm running the command "conda init bash" as this user, in its home.
I'm trying to understand this following stack trace.
I see a sudo in it.
Why would conda trigger a sudo command as I'm running it as a non sudoer user?
Did I forgot something?
The goal is to make multi user install of Conda.
fatal: [ansible-dev2]: FAILED! => changed=false
module_stderr: |-
Shared connection to ansible-dev2 closed.
module_stdout: |-
[sudo] Mot de passe de pmapp:
{"changed": true, "end": "2019-10-22 15:38:02.307227", "stdout": "[y/N]: ",
"cmd": "/opt/miniconda/bin/conda init bash",
"failed": true,
"delta": "0:05:40.400706",
"stderr": "\n# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<\n\n Traceback (most recent call last):\n
File \"/opt/miniconda/lib/python3.7/site-packages/conda/exceptions.py\", line 1074, in __call__\n
return func(*args, **kwargs)\n
File \"/opt/miniconda/lib/python3.7/site-packages/conda/cli/main.py\", line 84, in _main\n
exit_code = do_call(args, p)\n
File \"/opt/miniconda/lib/python3.7/site-packages/conda/cli/conda_argparse.py\", line 82, in do_call\n
exit_code = getattr(module, func_name)(args, parser)\n
File \"/opt/miniconda/lib/python3.7/site-packages/conda/cli/main_init.py\", line 51, in execute\n
anaconda_prompt, args.reverse)\n
File \"/opt/miniconda/lib/python3.7/site-packages/conda/core/initialize.py\", line 120, in initialize\n
run_plan_elevated(plan2)\n
File \"/opt/miniconda/lib/python3.7/site-packages/conda/core/initialize.py\", line 690, in run_plan_elevated\n
stdin=stdin\n
File \"/opt/miniconda/lib/python3.7/site-packages/conda/gateways/subprocess.py\", line 85, in subprocess_call\n
output=formatted_output)\n
subprocess.CalledProcessError: Command '['sudo', '/opt/miniconda/bin/python', '-m', 'conda.core.initialize']' returned non-zero exit status
1.\n\n`$ /opt/miniconda/bin/conda init bash`\n\n environment variables:\n
CIO_TEST=<not set>\n
CONDA_ROOT=/opt/miniconda\n
PATH=/sbin:/bin:/usr/sbin:/usr/bin\n
REQUESTS_CA_BUNDLE=<not set>\n
SSL_CERT_FILE=<not set>\n
SUDO_COMMAND=/bin/sh -c echo BECOME-SUCCESS-ykiojdbsynzuedngxuhulitiadpsufpo ;\n
https_proxy=
http://proxy.in.***.fr:8080\n
http_proxy=
http://proxy.in.***.fr:8080 /usr/bin/python\n
/var/tmp/ansible-tmp-1571751141.6-36379704861635/AnsiballZ_command.py\n
SUDO_GID=1000\n
SUDO_UID=1000\n
SUDO_USER=ansible\n
http_proxy=<set>\n
https_proxy=<set>\n\n
active environment : None\n
user config file : /home/pmapp/.condarc\n
populated config files : \n
conda version : 4.7.12\n
conda-build version : not installed\n
python version : 3.7.4.final.0\n virtual packages : \n
base environment : /opt/miniconda (read only)\n
channel URLs :
https://repo.anaconda.com/pkgs/main/linux-64\n https://repo.anaconda.com/pkgs/main/noarch\n https://repo.anaconda.com/pkgs/r/linux-64\n https://repo.anaconda.com/pkgs/r/noarch\n package cache : /opt/miniconda/pkgs\n
/home/pmapp/.conda/pkgs\n
envs directories : /home/pmapp/.conda/envs\n
/opt/miniconda/envs\n
platform : linux-64\n
user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.4 Linux/3.10.0-957.1.3.el7.x86_64 rhel/7.7 glibc/2.17\n
UID:GID : 1001:1001\n
netrc file : None\n
offline mode : False\n\n\nAn unexpected error has occurred. Conda has prepared the above report.\n\nIf submitted, this report will be used by core maintainers to improve\nfuture releases of conda.\nWould you like conda to send this report to the core maintainers?\n\n\nTimeout reached. No report sent.", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "/opt/miniconda/bin/conda init bash", "removes": null, "argv": null, "warn": true, "chdir": "/home/pmapp", "stdin_add_newline": true, "stdin": null}}, "start": "2019-10-22 15:32:21.906521", "warnings": ["Module remote_tmp /home/pmapp/.ansible/tmp did not exist and was created with a mode of 0700, this may cause issues when running as another user. To avoid this, create the remote_tmp dir with the correct permissions manually"], "msg": "non-zero return code"}
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
rc: 1