dhis2 / dhis2-server-tools

Tools to support installation and management of DHIS2
18 stars 18 forks source link

Error creating dhis2 containers #31

Open kvskoker opened 1 month ago

kvskoker commented 1 month ago

Hello Team,

I get an AttributeError when installing dhis with the dhis2-server-tools. I am using Ubuntu Server version 22.04

Kindly see error below:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'items'

fatal: [dhis]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3.10"}, "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible-tmp-1727907197.9246273-75158-219557328808449/AnsiballZ_lxd_container.py\", line 107, in \n _ansiballz_main()\n File \"/tmp/ansible-tmp-1727907197.9246273-75158-219557328808449/AnsiballZ_lxd_container.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/tmp/ansible-tmp-1727907197.9246273-75158-219557328808449/AnsiballZ_lxd_container.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.lxd_container', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.lxd_container', _modlib_path=modlib_path),\n File \"/usr/lib/python3.10/runpy.py\", line 224, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_community.general.lxd_container_payload_qznpc6fa/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/modules/lxd_container.py\", line 901, in \n File \"/tmp/ansible_community.general.lxd_container_payload_qznpc6fa/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/modules/lxd_container.py\", line 897, in main\n File \"/tmp/ansible_community.general.lxd_container_payload_qznpc6fa/ansible_community.general.lxd_container_payload.zip/ansible_collections/community/general/plugins/modules/lxd_container.py\", line 771, in run\nAttributeError: 'NoneType' object has no attribute 'items'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

Error-Installing-DHIS2
kvskoker commented 1 month ago

Update: I tried Ubuntu 20.04 and DHIS 2.40 and it worked fine but when I used Ubuntu 22.04 it did not work for either DHIS 2.40 or 2.41 versions.

tkipkurgat commented 1 month ago

Hello @kvskoker, Is the error occurring on Ubuntu 22.04 and not 20.04? Also, are you referring to the host or the container?

I will run my tests on 22.04 to check. The issue seems to be with the community.general modules, particularly the lxd_container module. I resolved it by upgrading the community.general collection.

You can upgrade by running: ansible-galaxy collection install community.general --upgrade I have also added this fix to the deploy.sh script.

tkipkurgat commented 1 month ago

Hello @kvskoker, Is the error on Ubuntu 22.04 and not 20.04 , I am going to run my tests on 22.04 and see how it goes. The errors were on community.general modules, where the module lxd_container is from, -- I did update community.general modules and the problem was fixed. you can upgrade with ansible-galaxy collection install community.general --upgrade

I have added the fix in deploy.sh script.