User Tools

Site Tools


wiki:ansible_troubleshooting

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
wiki:ansible_troubleshooting [2023/12/18 14:34] – created antisawiki:ansible_troubleshooting [2026/06/18 08:10] (current) – add ansible hangs antisa
Line 11: Line 11:
 Check the names in group_vars! They need to match the name of the group in the inventory file. Check the names in group_vars! They need to match the name of the group in the inventory file.
  
-====== Tested on ====== +===== AttributeError: module 'lib' has no attribute 'OpenSSL_add_all_algorithms' ===== 
-  * + 
 +Check versions of ansible and dependencies. This was caused by the upgraded cryptography package (and using the old ansible version - 2.9.27) which was being source from ''/usr/local/lib/python3.10/dist-packages/''. This fixed it: 
 + 
 +  sudo pip uninstall cryptography 
 + 
 +to uninstall from system directory and then run this (notice no sudo) to install it in user's directory ''/home/user/.local/lib/python3.10/site-packages'' 
 + 
 +  pip install cryptography==2.6.1 
 + 
 +Or just use a newer version of ansible which can use newer version of cryptography package. 
 + 
 +===== .local/bin/ansible: No such file or directory ===== 
 +Happened when pip installing 9.3.0 version over 2.9.27. 
 + 
 +Uninstall old version first 
 +  pip uninstall 2.9.27 
 + 
 +Make sure no ansible dirs are leftover: 
 + 
 +  ~$ ls /home/antisa/.local/lib/python3.10/site-packages/ansible* 
 +  ls: cannot access '/home/antisa/.local/lib/python3.10/site-packages/ansible*': No such file or directory 
 + 
 +Now install via pip  
 +  pip install ansible 
 + 
 +===== unsupported locale setting ===== 
 + 
 +  ERROR: Ansible could not initialize the preferred locale: unsupported locale setting 
 + 
 +This might happen when you ssh into a server which doesn't have your locale generated (the one you are using on your local machine) and you are forwarding the locale over ssh (see ''SendEnv'' and ''AcceptEnv'' in ssh_config and sshd_config on your machine and server respectively). 
 + 
 +Fix is to simply generate the locale: 
 +  vi /etc/locale.gen 
 +uncomment your locale e.g. 
 +  hr_HR.UTF-8 
 + 
 +Then run 
 +  locale-gen 
 + 
 + 
 +===== an unexpected keyword argument 'cert_file' ===== 
 +<code> 
 +[WARNING]: Skipping Galaxy server https://old-galaxy.ansible.com/. Got an unexpected error when getting available versions of 
 +collection community.docker: Unknown error when attempting to call Galaxy at 'https://old-galaxy.ansible.com/api': 
 +HTTPSConnection.__init__() got an unexpected keyword argument 'cert_file'. HTTPSConnection.__init__() got an unexpected keyword 
 +argument 'cert_file' 
 +ERROR! Unknown error when attempting to call Galaxy at 'https://old-galaxy.ansible.com/api': HTTPSConnection.__init__() got an unexpected keyword argument 'cert_file'. HTTPSConnection.__init__() got an unexpected keyword argument 'cert_file' 
 +</code> 
 + 
 +Try a different (newer) ansible version. 
 + 
 +===== "msg": "MODULE FAILURE: No start of json char found\nSee stdout/stderr for the exact error" ===== 
 + 
 +This is also possibly a mismatch with ansible versions and older python on target hosts. Try a different, older ansible version if running against older OS-es. 
 + 
 +===== couldn't resolve module/action 'community.libvirt.virt_install' ===== 
 +You have the module installed but it still returns a similar error might be because of an older version of plugin. Run this to update it: 
 + 
 +  ansible-galaxy collection install community.libvirt -U 
 + 
 +Now 2 versions are shown, ansible should use the newest one. 
 +  ansible-galaxy collection list |grep virt 
 +  community.libvirt                        2.0.0   
 +  community.libvirt                        1.2.0   
 + 
 +Check also if the ansible version itself is compatible with plugin, on plugin document page. 
 + 
 +===== ansible-playbook hangs on specific server ===== 
 + 
 +Check the ''ps'' output on the host where the ansible is being run from: 
 + 
 +  ps aux | grep ansible 
 + 
 +There should be an ssh command triggered where you should see the server hostname where the ansible is stuck on. Log into that server and check the ''ps'' again for any hanging processes.
  
 ====== See also ====== ====== See also ======
Line 20: Line 93:
 ====== References ====== ====== References ======
  
 +  * https://old.reddit.com/r/ansible/comments/1egtdg6/an_unknown_error_occurred_httpsconnection_init/
wiki/ansible_troubleshooting.1702910085.txt.gz · Last modified: by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki