Ubuntu 20.04.3 自动安装时嵌入用户数据崩溃(我找到了解决方法)

Ubuntu 20.04.3 自动安装时嵌入用户数据崩溃(我找到了解决方法)

我正在尝试创建嵌入 autoinstall-user-data 的修改版 Ubuntu 20.04.3 ISO 映像。但安装程序一直崩溃。

用户数据 YAML 是从手动安装的 Ubuntu 服务器保存的(来自 /var/log/installer/autoinstall-user-data)。我不得不从这个 YAML 中删除几个部分,以使自动安装通过一些失败。但我被安装程序崩溃问题困住了。在我使用安装程序崩溃转储进行故障排除后,我发现安装程序正在寻找“cdrom:/dists/focal/main/binary-amd64/Packages”,但我只在该路径中看到 Packages.gz。

为了修复此问题,我成功尝试了这个解决方法:在生成自定义 ISO 之前,将提取的“Packages”文件放在 ISO 中的路径“/dists/focal/main/binary-amd64/”下。同时将“Packages.gz”保留在 ISO 中。这解决了问题。

显然,这看起来像是 Subiquity 或 ISO 映像打包的一个错误。我提供了日志和崩溃转储供您调查。

以下是一些附加信息:

我在控制台和 subuigity-server-info.log 中看到了这一点:

2022-02-22 09:34:34,416 INFO aiohttp.access:206  [22/Feb/2022:09:34:23 +0000] "GET /meta/status?cur=%22WAITING%22 HTTP/1.1" 200 418 "-" "Python/3.6 aiohttp/3.7.4.post0"
2022-02-22 09:34:34,418 INFO root:39 start: subiquity/Meta/status_GET:
2022-02-22 09:36:13,650 ERROR root:39 finish: subiquity/Install/install/curtin_install/cmd-install/stage-curthooks/001-configure-apt/cmd-in-target: FAIL: curtin command in-target
2022-02-22 09:36:13,650 ERROR root:39 finish: subiquity/Install/install/curtin_install/cmd-install/stage-curthooks/001-configure-apt: FAIL: running '/snap/subiquity/2651/bin/subiquity-configure-apt /snap/subiquity/2651/usr/bin/python3 true'
2022-02-22 09:36:13,650 ERROR root:39 finish: subiquity/Install/install/curtin_install/cmd-install/stage-curthooks: FAIL: configuring installed system
2022-02-22 09:36:14,461 ERROR root:39 finish: subiquity/Install/install/curtin_install: FAIL: Command '['systemd-cat', '--level-prefix=false', '--identifier=subiquity_log.2706', '/snap/subiquity/2651/usr/bin/python3', '-m', 'curtin', '--showtrace', '-c', '/var/log/installer/subiquity-curtin-install.conf', 'install']' returned non-zero exit status 3.
2022-02-22 09:36:14,462 INFO subiquitycore.common.errorreport:407 saving crash report 'install failed crashed with CalledProcessError' to /var/crash/1645522574.462125301.install_fail.crash
2022-02-22 09:36:14,462 ERROR root:39 finish: subiquity/Install/install: FAIL: Command '['systemd-cat', '--level-prefix=false', '--identifier=subiquity_log.2706', '/snap/subiquity/2651/usr/bin/python3', '-m', 'curtin', '--showtrace', '-c', '/var/log/installer/subiquity-curtin-install.conf', 'install']' returned non-zero exit status 3.
2022-02-22 09:36:14,462 INFO root:39 start: subiquity/ErrorReporter/1645522574.462125301.install_fail/add_info:
2022-02-22 09:36:14,463 ERROR subiquity.server.server:336 top level error
Traceback (most recent call last):
  File "/snap/subiquity/2651/lib/python3.6/site-packages/subiquity/server/controllers/cmdlist.py", line 104, in _run
    await Install.install_task
  File "/snap/subiquity/2651/lib/python3.6/site-packages/subiquitycore/context.py", line 148, in decorated_async
    return await meth(self, **kw)
  File "/snap/subiquity/2651/lib/python3.6/site-packages/subiquity/server/controllers/install.py", line 222, in install
    await self.curtin_install(context=context)
  File "/snap/subiquity/2651/lib/python3.6/site-packages/subiquitycore/context.py", line 148, in decorated_async
    return await meth(self, **kw)
  File "/snap/subiquity/2651/lib/python3.6/site-packages/subiquity/server/controllers/install.py", line 194, in curtin_install
    cp = await arun_command(self.logged_command(curtin_cmd), check=True)
  File "/snap/subiquity/2651/lib/python3.6/site-packages/subiquitycore/utils.py", line 85, in arun_command
    raise subprocess.CalledProcessError(proc.returncode, cmd)
subprocess.CalledProcessError: Command '['systemd-cat', '--level-prefix=false', '--identifier=subiquity_log.2706', '/snap/subiquity/2651/usr/bin/python3', '-m', 'curtin', '--showtrace', '-c', '/var/log/installer/subiquity-curtin-install.conf', 'install']' returned non-zero exit status 3.
2022-02-22 09:36:14,463 ERROR subiquity.server.server:336 top level error
Traceback (most recent call last):
  File "/snap/subiquity/2651/lib/python3.6/site-packages/subiquity/server/controllers/reboot.py", line 54, in _run

我在崩溃转储中看到了这一点:

Err:4 file:/cdrom focal/main amd64 Packages
   File not found - /cdrom/dists/focal/main/binary-amd64/Packages (2: No such file or directory)

我在‘/boot/grub/grub.cfg’、‘/isolinux/txt.cfg’、‘/boot/grub/loopback.cfg’中使用了以下内核参数:

linux   /casper/vmlinuz   quiet    autoinstall ds=nocloud\;s=/cdrom/nocloud/ fsck.mode=skip   ---

#cloud-config
autoinstall:
  apt:
    geoip: true
    preserve_sources_list: false
    primary:
    - arches: [amd64, i386]
      uri: http://in.archive.ubuntu.com/ubuntu
    - arches: [default]
      uri: http://ports.ubuntu.com/ubuntu-ports
  identity: {hostname: ubuntu1, password: ,
    realname: Govind A, username: bma}
  keyboard: {layout: us, toggle: null, variant: ''}
  locale: en_US.UTF-8
  network:
    ethernets:
      eno1: {dhcp4: true}
    version: 2
  snaps:
    - name: go
      channel: 1.14/stable
      classic: true
  ssh:
    allow-pw: true
    authorized-keys: []
    install-server: true
  storage:
    config:
    - {ptable: gpt, serial: 3333333333333333333333333333334, wwn: '0x6666666666666666666666666',
      path: /dev/sdb, wipe: superblock, preserve: false, name: '', grub_device: false,
      type: disk, id: disk-sdb}
    - {device: disk-sdb, size: 536870912, wipe: superblock, flag: boot, number: 1,
      preserve: false, grub_device: true, type: partition, id: partition-0}
    - {fstype: fat32, volume: partition-0, preserve: false, type: format, id: format-0}
    - {device: disk-sdb, size: 1073741824, wipe: superblock, flag: '', number: 2,
      preserve: false, grub_device: false, type: partition, id: partition-1}
    - {fstype: ext4, volume: partition-1, preserve: false, type: format, id: format-1}
    - {device: disk-sdb, size: 117841068032, wipe: superblock, flag: '', number: 3,
      preserve: false, grub_device: false, type: partition, id: partition-2}
    - name: ubuntu-vg
      devices: [partition-2]
      preserve: false
      type: lvm_volgroup
      id: lvm_volgroup-0
    - {name: ubuntu-lv, volgroup: lvm_volgroup-0, size: 58919485440B, wipe: superblock,
      preserve: false, type: lvm_partition, id: lvm_partition-0}
    - {fstype: ext4, volume: lvm_partition-0, preserve: false, type: format, id: format-2}
    - {path: /, device: format-2, type: mount, id: mount-2}
    - {path: /boot, device: format-1, type: mount, id: mount-1}
    - {path: /boot/efi, device: format-0, type: mount, id: mount-0}
  version: 1

相关内容