Bug 1505 - centos 7迁移Anolis Os 8失败 Failed to apply yum adjustment.
Summary: centos 7迁移Anolis Os 8失败 Failed to apply yum adjustment.
Status: CONFIRMED
Alias: None
Product: Anolis OS 8
Classification: Anolis OS
Component: OsMigration (show other bugs) OsMigration
Version: ---
Hardware: x86_64 Linux
: P2-High S4-trivial
Target Milestone: ---
Assignee: yunqi-zwt
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-27 12:13 UTC by kai18338802505
Modified: 2022-07-15 17:08 UTC (History)
1 user (show)

See Also:


Attachments
dnf_transaction_check (1.37 MB, text/plain)
2022-06-27 12:13 UTC, kai18338802505
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kai18338802505 2022-06-27 12:13:53 UTC
Created attachment 310 [details]
dnf_transaction_check

第一次迁移前评估一切正常,升级脚本也执行正常,重启升级的时候突然进入GRUB,
重启后在执行,迁移评估报错

2022-06-27 11:43:32.235062 [ERROR] Actor: dnf_transaction_check
Message: Failed to apply yum adjustment. Message: Command ['systemd-nspawn', '--register=no', '--quiet', '-D', u'/var/lib/leapp/scratch/mounts/root_/system_overlay', '--bind=/etc/hosts:/etc/hosts', '--setenv=LEAPP_NO_RHSM=1', '--setenv=LEAPP_EXPERIMENTAL=0', '--setenv=LEAPP_COMMON_TOOLS=:/etc/leapp/repos.d/system_upgrade/el7toel8/tools', '--setenv=LEAPP_COMMON_FILES=:/etc/leapp/repos.d/system_upgrade/el7toel8/files', '--setenv=LEAPP_UNSUPPORTED=0', '--setenv=LEAPP_EXECUTION_ID=7ea0c5f3-ad70-42b5-b33c-e8c099e77abc', '--setenv=LEAPP_HOSTNAME=db1', '/bin/bash', '-c', u'/etc/leapp/repos.d/system_upgrade/el7toel8/tools/handleyumconfig'] failed with exit code 1.
Comment 1 yunqi-zwt alibaba_cloud_group 2022-06-30 14:49:08 UTC
1. > /etc/leapp/repos.d/system_upgrade/el7toel8/tools/handleyumconfig

这个里面的内容是什么?

2. uname -a 看下目前是在哪个内核?
Comment 2 kai18338802505 2022-07-04 12:06:43 UTC
(In reply to yunqi-zwt from comment #1)
> 1. > /etc/leapp/repos.d/system_upgrade/el7toel8/tools/handleyumconfig
> 
> 这个里面的内容是什么?
> 
> 2. uname -a 看下当前是在什么内核?

1.文件内容
#!/usr/bin/bash -e

# just in case of hidden files.. not sure why would someone do that, it's more
# like forgotten cache file possibility, but rather do that..
shopt -s dotglob

is_dir_empty() {
  test -z "$(ls -A $1)"
}

handle_dir() {
    # Move all files from $1 to $2 when the /etc/yum/$1 is not empty
    # Then remove the $1 directory and relink it to $2
    # param $1: dirname under /etc/yum path
    # param $2: dirname under /etc/dnf path
    if ! is_dir_empty "/etc/yum/$1"; then
        mv /etc/yum/$1/* /etc/dnf/$2/
    fi

    # FIXME: do not care whether these were already symlinks for now
    #        just remove it
    rm -rf /etc/yum/$1

    #relink
    ln -s ../dnf/$2 /etc/yum/$1

    return 0
}


# assume the directories are not removed by user..
handle_dir pluginconf.d plugins
handle_dir protected.d  protected.d
handle_dir vars var

2.内核版本
Linux db1 3.10.0-1160.66.1.el7.x86_64 #1 SMP Wed May 18 16:02:34 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

期间我升级过4版本的内核也不行
Comment 3 yunqi-zwt alibaba_cloud_group 2022-07-11 17:10:49 UTC
dnf_transaction_check 报错这个应该只是 迁移工具的bug,既然迁移工具执行已经成功了,但是reboot后进入grub ,更可能的问题可能是 迁移后的kernel不支持在你的机型上面运行,譬如,是否是驱动问题。
能否贴一下你的环境的硬件信息?譬如
cpu,磁盘,网卡等型号信息。
Comment 4 kai18338802505 2022-07-11 17:16:48 UTC
(In reply to yunqi-zwt from comment #3)
> dnf_transaction_check
> 错了这个应该只是迁移的bug,但是迁移工具执行成功了,重启后进入grub,更有可能是迁移后的内核不支持在你的工具运行的例子,比如报是否是驱动问题。
> 可以贴一下你的环境的硬件信息吗?比如
> cpu,磁盘,网卡等型号信息。

这个是KVM虚拟环境,同一个配置的Centos7迁移成功了。有两台就是不行
Comment 5 kai18338802505 2022-07-11 17:17:48 UTC
(In reply to kai18338802505 from comment #4)
> (从评论#3回复yunqi-zwt )
> > dnf_transaction_check
> > 错了这个应该只是迁移的bug,但是迁移执行成功了,重启后进入g,更有可能是迁移后的内核工具不支持在你的工具运行的例子,比如报是否是驱动问题。
> > 可以贴一下你的环境的硬件信息吗?
> > cpu,磁盘,网卡等型号信息。
> 
> 这个是KVM虚拟环境,同一个配置的Centos7迁移成功了。有两台就是不行

都是同一个物理服务器上面
Comment 6 yunqi-zwt alibaba_cloud_group 2022-07-13 09:41:32 UTC
rpm -qa | grep kernel 
看下目前安装了有几个内核啊?

主要是想确认下导致你的环境进入grub 的那个龙蜥内核版本
Comment 7 kai18338802505 2022-07-15 17:08:12 UTC
(In reply to yunqi-zwt from comment #6)
> rpm -qa | grep 内核
> 看现在安装了有几个内核啊?
> 
> 主要是想确认下导致你的环境进入grub的那个龙的内核版本

服务器都是yum升级的最高版本7.9.默认是kernel-3.10.0-1160.66.1.el7.x86_64。内核没有做过特殊升级