ikke-t / awx_pod

Ansible role to install Ansible AWX into pod using podman.
55 stars 19 forks source link

The error was: IndexError: list index out of range failed #31

Open ryannix123 opened 3 years ago

ryannix123 commented 3 years ago

I'm trying to make sense of this error that came back when I ran --check. I did install the role, and everything else passed. When I tried to simply run it without the check, I got the following back:

{"changed": false, "msg": "There was an issue creating /etc/containers/pods as requested: [Errno 13] Permission denied: b'/etc/containers/pods'", "path": "/etc/containers/pods"}

my.school.edu: ok=24 changed=15 unreachable=0 failed=1 skipped=22 rescued=0 ignored=0

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: IndexError: list index out of range failed: [my.school.edu] (item=docker.io/centos/postgresql-10-centos7) => {"ansible_loop_var": "item", "changed": false, "item": "docker.io/centos/postgresql-10-centos7", "module_stderr": "Shared connection to my.school.edu closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/home/sadmin/.ansible/tmp/ansible-tmp-1611157225.989815-8383-74977342539351/AnsiballZ_podman_image.py\", line 102, in \r\n _ansiballz_main()\r\n File \"/home/sadmin/.ansible/tmp/ansible-tmp-1611157225.989815-8383-74977342539351/AnsiballZ_podman_image.py\", line 94, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/home/sadmin/.ansible/tmp/ansible-tmp-1611157225.989815-8383-74977342539351/AnsiballZ_podman_image.py\", line 40, in invoke_module\r\n runpy.run_module(mod_name='ansible_collections.containers.podman.plugins.modules.podman_image', init_globals=None, run_name='main', alter_sys=True)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\r\n mod_name, mod_spec, pkg_name, script_name)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\r\n exec(code, run_globals)\r\n File \"/tmp/ansible_containers.podman.podman_image_payload_jos19ju3/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 774, in \r\n File \"/tmp/ansible_containers.podman.podman_image_payload_jos19ju3/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 769, in main\r\n File \"/tmp/ansible_containers.podman.podman_image_payload_jos19ju3/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 422, in init\r\n File \"/tmp/ansible_containers.podman.podman_image_payload_jos19ju3/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 470, in present\r\nIndexError: list index out of range\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} An exception occurred during task execution. To see the full traceback, use -vvv. The error was: IndexError: list index out of range failed: [my.school.edu] (item=docker.io/library/redis:latest) => {"ansible_loop_var": "item", "changed": false, "item": "docker.io/library/redis:latest", "module_stderr": "Shared connection to my.school.edu closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/home/sadmin/.ansible/tmp/ansible-tmp-1611157227.2906408-8383-29731479366832/AnsiballZ_podman_image.py\", line 102, in \r\n _ansiballz_main()\r\n File \"/home/sadmin/.ansible/tmp/ansible-tmp-1611157227.2906408-8383-29731479366832/AnsiballZ_podman_image.py\", line 94, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/home/sadmin/.ansible/tmp/ansible-tmp-1611157227.2906408-8383-29731479366832/AnsiballZ_podman_image.py\", line 40, in invoke_module\r\n runpy.run_module(mod_name='ansible_collections.containers.podman.plugins.modules.podman_image', init_globals=None, run_name='main', alter_sys=True)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\r\n mod_name, mod_spec, pkg_name, script_name)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\r\n exec(code, run_globals)\r\n File \"/tmp/ansible_containers.podman.podman_image_payload_6alqnlvb/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 774, in \r\n File \"/tmp/ansible_containers.podman.podman_image_payload_6alqnlvb/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 769, in main\r\n File \"/tmp/ansible_containers.podman.podman_image_payload_6alqnlvb/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 422, in init\r\n File \"/tmp/ansible_containers.podman.podman_image_payload_6alqnlvb/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 470, in present\r\nIndexError: list index out of range\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} An exception occurred during task execution. To see the full traceback, use -vvv. The error was: IndexError: list index out of range failed: [my.school.edu] (item=docker.io/ansible/awx:15.0.1) => {"ansible_loop_var": "item", "changed": false, "item": "docker.io/ansible/awx:15.0.1", "module_stderr": "Shared connection to my.school.edu closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/home/sadmin/.ansible/tmp/ansible-tmp-1611157228.1479769-8383-226359522185082/AnsiballZ_podman_image.py\", line 102, in \r\n _ansiballz_main()\r\n File \"/home/sadmin/.ansible/tmp/ansible-tmp-1611157228.1479769-8383-226359522185082/AnsiballZ_podman_image.py\", line 94, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/home/sadmin/.ansible/tmp/ansible-tmp-1611157228.1479769-8383-226359522185082/AnsiballZ_podman_image.py\", line 40, in invoke_module\r\n runpy.run_module(mod_name='ansible_collections.containers.podman.plugins.modules.podman_image', init_globals=None, run_name='main', alter_sys=True)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\r\n mod_name, mod_spec, pkg_name, script_name)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\r\n exec(code, run_globals)\r\n File \"/tmp/ansible_containers.podman.podman_image_payload_yvfmbauu/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 774, in \r\n File \"/tmp/ansible_containers.podman.podman_image_payload_yvfmbauu/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 769, in main\r\n File \"/tmp/ansible_containers.podman.podman_image_payload_yvfmbauu/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 422, in init\r\n File \"/tmp/ansible_containers.podman.podman_image_payload_yvfmbauu/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 470, in present\r\nIndexError: list index out of range\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} An exception occurred during task execution. To see the full traceback, use -vvv. The error was: IndexError: list index out of range failed: [my.school.edu] (item=docker.io/ansible/awx:15.0.1) => {"ansible_loop_var": "item", "changed": false, "item": "docker.io/ansible/awx:15.0.1", "module_stderr": "Shared connection to my.school.edu closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/home/sadmin/.ansible/tmp/ansible-tmp-1611157228.9885492-8383-54508390883228/AnsiballZ_podman_image.py\", line 102, in \r\n _ansiballz_main()\r\n File \"/home/sadmin/.ansible/tmp/ansible-tmp-1611157228.9885492-8383-54508390883228/AnsiballZ_podman_image.py\", line 94, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/home/sadmin/.ansible/tmp/ansible-tmp-1611157228.9885492-8383-54508390883228/AnsiballZ_podman_image.py\", line 40, in invoke_module\r\n runpy.run_module(mod_name='ansible_collections.containers.podman.plugins.modules.podman_image', init_globals=None, run_name='main', alter_sys=True)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\r\n mod_name, mod_spec, pkg_name, script_name)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\r\n exec(code, run_globals)\r\n File \"/tmp/ansible_containers.podman.podman_image_payload_empz_x89/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 774, in \r\n File \"/tmp/ansible_containers.podman.podman_image_payload_empz_x89/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 769, in main\r\n File \"/tmp/ansible_containers.podman.podman_image_payload_empz_x89/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 422, in init\r\n File \"/tmp/ansible_containers.podman.podman_image_payload_empz_x89/ansible_containers.podman.podman_image_payload.zip/ansible_collections/containers/podman/plugins/modules/podman_image.py\", line 470, in present\r\nIndexError: list index out of range\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

ikke-t commented 3 years ago

I haven't tried this role in ages. Is the my.school.edu your target host? I did recently just update the podman systemd role. Make sure you try this as root user, I have not tested multiple containers with rootless user. Also check the container images list. It complains about that index.

ryannix123 commented 3 years ago

Thank you for the quick response!

Correct, my.school.edu is the target host and the target account is not running as root.