How to resolve the error "Error: creating hosts file for container" while running any job from Ansible Automation Platfrom GUI?

Solution Verified - Updated -

Environment

  • Red Hat® Ansible Automation Platform 2.x

Issue

  • Ansible Automation platform fails to run any job and throws the below error:

    Error: creating hosts file for container 93612238f606516785d97508a90a5b5b215d0c08dfc79f4cf25df1674a67310c: failed to create new hosts file: open /etc/hosts: permission denied
    

Resolution

  • Check and correct the permissions of /etc/hosts file. The default permission should be as follows:

    # ls -l /etc/hosts
    -rw-r--r--. 1 root root 158 Jun 23  2020 /etc/hosts
    

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments