redhat-cop / infra.leapp

Collection of Ansible roles for automating RHEL in-place upgrades using Leapp.
MIT License
46 stars 37 forks source link

No flags tag in leapp-report.json #214

Closed thel0 closed 1 month ago

thel0 commented 1 month ago

Hello,

it's my first issue :) I have 2 bug with infraleapp. This is the first

infra.leapp

1.3.0 and 1.3.1

Ansible version:

ansible [core 2.16.6] config file = /home/thel/git/ansible/leapplab/ansible.cfg configured module search path = ['/home/thel/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/thel/ansible/lib/python3.11/site-packages/ansible ansible collection location = /home/thel/.ansible/collections:/usr/share/ansible/collections executable location = /home/thel/ansible/bin/ansible python version = 3.11.2 (main, May 2 2024, 11:59:08) [GCC 12.2.0] (/home/thel/ansible/bin/python) jinja version = 3.1.4 libyaml = True

first

The analyse playbook failed on

fatal: [centos]: FAILED! =>
  msg: |-
    The conditional check '(leapp_high_sev_as_inhibitors | default(false, true) | bool and item.severity == 'high') or 'inhibitor' in item.flags' failed. The error was: error while evaluating conditional ((leapp_high_sev_as_inhibitors | default(false, t
rue) | bool and item.severity == 'high') or 'inhibitor' in item.flags): 'dict object' has no attribute 'flags'. 'dict object' has no attribute 'flags'

    The error appears to be in '/home/thel/.ansible/collections/ansible_collections/infra/leapp/roles/parse_leapp_report/tasks/main.yml': line 21, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.

    The offending line appears to be:

    - name: Check for inhibitors
      ^ here

if I look for the flags tag in the file, it doesn't find any so item.flags is undefined. I think that's why it failed but i'm not an ansible expert :)

[root@centos leapp]# grep flags leapp-report.json
[root@centos leapp]# grep -c flags leapp-report.json
0
[root@centos leapp]# wc -l leapp-report.json
457 leapp-report.json

second

sometimes, it happened to me that a python error was displayed in the ripu.log file but the analysis playbook continued and generated the leap-report.txt/json file with a size of 0. It ended with success and "No inhibitor found" which was wrong . It would be good to test the size of the file because there is not necessary to looking for inhibitors if the file has a size of 0, because it will never find any

Sorry, i dont keep log for this problem. The next time, i will keep it

swapdisk commented 1 month ago

With regard to the first issue, you are correct that the "Check for inhibitors" task failed because there are no flags in your leapp-report.json file. That would seem to ultimately be an a leapp issue because every entry in a leapp-report.json normally includes a flags object even when there are no flags and it's just an empty list. I'm curious to see an example leapp-report.json and also leapp-preupgrade.log from one of these failures.

For the second issue, I'm surprised that the the job didn't fail at the "Leapp preupgrade report" task. That task uses failed_when: "'report has been generated' not in leapp.stdout" rather than checking rc, so maybe there's an issue there. Seeing both the ripu.log and the job log from the ansible play would be helpful in diagnosing this one further.

Please attach those files and let's see what we can figure out. Thanks!

djdanielsson commented 1 month ago

It sounds like the no flags might have been when the file was empty and if that is the case we want it to fail, just maybe with a better error message

thel0 commented 1 month ago

It sounds like the no flags might have been when the file was empty and if that is the case we want it to fail, just maybe with a better error message

Yes you are right. I resync my extras repository and i try with last leapp version (leapp 0.17) and all seem to be ok. With no inhibitor, the flags tag is defined in leapp file

thanks

thel0 commented 1 month ago

i can close this issue, old version of leapp was my problem . thanks