leapp upgrade実行時エラーが発生：Message: DNF execution failed with non zero exit code.

leappでCentOS7をRocky Linux8へアップグレードする時、
leapp preupgradeのチェックOKがでしたが、leapp upgrade実行時エラーが発生してしまいました。
ログの抜粋は下記の通りです。
```
[root@as ~]# leapp upgrade
...
============================================================
                           ERRORS
============================================================

2024-06-03 10:47:52.063859 [ERROR] Actor: dnf_package_download
Message: DNF execution failed with non zero exit code.
STDOUT:
Last metadata expiration check: 0:01:24 ago on Thu Jun 03 10:44:59 2024.
Package python2-six-1.9.0-0.el7.noarch is already installed.
Dependencies resolved.

...

Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.

STDERR:
Failed to create directory /var/lib/leapp/el8userspace//sys/fs/selinux: Read-only file system
Failed to create directory /var/lib/leapp/el8userspace//sys/fs/selinux: Read-only file system
No matches found for the following disable plugin patterns: subscription-manager
Repository extras is listed more than once in the configuration
Warning: Package marked by Leapp to upgrade not found in repositories metadata: gpg-pubkey
RPM: warning: Generating 6 missing index(es), please wait...
Error: Transaction test error:
  file /usr/lib/python3.6/site-packages/__pycache__/six.cpython-36.opt-1.pyc from install of python3-six-1.11.0-8.el8.noarch conflicts with file from package python36-six-1.14.0-3.el7.noarch
  file /usr/lib/python3.6/site-packages/__pycache__/six.cpython-36.pyc from install of python3-six-1.11.0-8.el8.noarch conflicts with file from package python36-six-1.14.0-3.el7.noarch
  file /usr/lib/python3.6/site-packages/six.py from install of python3-six-1.11.0-8.el8.noarch conflicts with file from package python36-six-1.14.0-3.el7.noarch
  file /usr/lib/python3.6/site-packages/urllib3/__init__.py from install of python3-urllib3-1.24.2-7.el8.noarch conflicts with file from package python36-urllib3-1.25.6-2.el7.noarch
  file /usr/lib/python3.6/site-packages/urllib3/__pycache__/__init__.cpython-36.opt-1.pyc from install of python3-urllib3-1.24.2-7.el8.noarch conflicts with file from package python36-urllib3-1.25.6-2.el7.noarch
  file /usr/lib/python3.6/site-packages/urllib3/__pycache__/__init__.cpython-36.pyc from install of python3-urllib3-1.24.2-7.el8.noarch conflicts with file from package python36-urllib3-1.25.6-2.el7.noarch
...
  file /usr/lib/python3.6/site-packages/chardet/cli/__pycache__/chardetect.cpython-36.opt-1.pyc from install of python3-chardet-3.0.4-7.el8.noarch conflicts with file from package python36-chardet-3.0.4-1.el7.noarch
  file /usr/lib/python3.6/site-packages/chardet/cli/__pycache__/chardetect.cpython-36.pyc from install of python3-chardet-3.0.4-7.el8.noarch conflicts with file from package python36-chardet-3.0.4-1.el7.noarch
  file /usr/lib/python3.6/site-packages/chardet/cli/chardetect.py from install of python3-chardet-3.0.4-7.el8.noarch conflicts with file from package python36-chardet-3.0.4-1.el7.noarch
  file /usr/lib/python3.6/site-packages/requests/__init__.py from install of python3-requests-2.20.0-4.el8.noarch conflicts with file from package python36-requests-2.14.2-2.el7.noarch
  file /usr/lib/python3.6/site-packages/requests/__pycache__/__init__.cpython-36.opt-1.pyc from install of python3-requests-2.20.0-4.el8.noarch conflicts with file from package python36-requests-2.14.2-2.el7.noarch
  file /usr/lib/python3.6/site-packages/requests/__pycache__/__init__.cpython-36.pyc from install of python3-requests-2.20.0-4.el8.noarch conflicts with file from package python36-requests-2.14.2-2.el7.noarch
...
  file /usr/lib64/python3.6/site-packages/_yaml.cpython-36m-x86_64-linux-gnu.so from install of python3-pyyaml-3.12-12.el8.x86_64 conflicts with file from package python36-PyYAML-3.13-1.el7.x86_64
  file /usr/lib64/python3.6/site-packages/yaml/__init__.py from install of python3-pyyaml-3.12-12.el8.x86_64 conflicts with file from package python36-PyYAML-3.13-1.el7.x86_64
  file /usr/lib64/python3.6/site-packages/yaml/__pycache__/__init__.cpython-36.opt-1.pyc from install of python3-pyyaml-3.12-12.el8.x86_64 conflicts with file from package python36-PyYAML-3.13-1.el7.x86_64
...

============================================================
                       END OF ERRORS
============================================================


Debug output written to /var/log/leapp/leapp-upgrade.log

============================================================
                           REPORT
============================================================

A report has been generated at /var/log/leapp/leapp-report.json
A report has been generated at /var/log/leapp/leapp-report.txt

============================================================
                       END OF REPORT
============================================================

Answerfile has been generated at /var/log/leapp/answerfile
2024-06-03 10:47:52.575 ERROR    PID: 28176 leapp: Upgrade workflow failed, check log for details
```

# ログの分析
1. 「Message: DNF execution failed with non zero exit code.」はDNFコマンドでパッケージをインストールする時、エラーが発生しました。
2. 「python3-six-1.11.0-8.el8.noarch conflicts with file from package python36-six-1.14.0-3.el7.noarch」はパッケージの競合があって、インストールができなかったことが分かりました。
「python3-six-1.11.0-8.el8.noarch」は　Red Hat Enterprise Linux 8のプラットフォームのパッケージで、
後ろのパッケージ「python36-six-1.14.0-3.el7.noarch」はEL7のものです。
エラーの原因ではないかと思って、下記のコマンドで削除してみたら無事アップグレードできました。
```
[root@as ~]# yum remove -y python36-six python36-urllib3 python36-chardet python36-requests python36-PyYAML
[root@as ~]# leapp upgrade
...
DNF will only download packages, install gpg keys, and check the transaction.
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Complete!
====> * add_upgrade_boot_entry
        Add new boot entry for Leapp provided initramfs.
A reboot is required to continue. Please reboot your system.


Debug output written to /var/log/leapp/leapp-upgrade.log

============================================================
                           REPORT
============================================================

A report has been generated at /var/log/leapp/leapp-report.json
A report has been generated at /var/log/leapp/leapp-report.txt

============================================================
                       END OF REPORT
============================================================

Answerfile has been generated at /var/log/leapp/answerfile
```

アップグレードができましたら、削除したパッケージを再インストールすることを忘れないでください。