[Bug 2028092] [NEW] Multiple kernels kver_cmd to return an incoherent string

Peter Mattingly 2028092 at bugs.launchpad.net
Tue Jul 18 22:38:33 UTC 2023


Public bug reported:

Hello,

A customer had contacted with an issue related to this bug. Taking a
look at the stacktrace for the issue:

```
ls -la
total 16
drwxr-xr-x. 4 root root 4096 Feb 10 02:53 .
dr-xr-xr-x. 40 root root 4096 Feb 10 02:58 ..
drwxr-xr-x. 6 root root 4096 Feb 10 02:54 4.18.0-372.32.1.el8_6.x86_64
drwxr-xr-x. 6 root root 4096 Feb 10 02:49 4.18.0-372.9.1.el8.x86_64

<stack trace>
Running curthooks.builtin_curthooks...
Traceback (most recent call last):
File "/tmp/tmp1x5k7i8r/target/curtin/curtin-hooks", line 133, in <module>
main()
File "/tmp/tmp1x5k7i8r/target/curtin/curtin-hooks", line 129, in main
curthook(config, target, state)
File "/tmp/tmp1x5k7i8r/target/curtin/curtin-hooks", line 114, in curthook
curthooks.builtin_curthooks(cfg, target, state)
File "/curtin/curtin/commands/curthooks.py", line 1831, in builtin_curthooks
redhat_update_initramfs(target, cfg)
File "/curtin/curtin/commands/curthooks.py", line 1672, in redhat_update_initramfs
in_chroot.subp(dracut_cmd, capture=True)
File "/curtin/curtin/util.py", line 787, in subp
return subp(*args, **kwargs)
File "/curtin/curtin/util.py", line 275, in subp
return _subp(*args, **kwargs)
File "/curtin/curtin/util.py", line 139, in _subp
raise ProcessExecutionError(stdout=out, stderr=err,
curtin.util.ProcessExecutionError: Unexpected error while running command.
Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmp1x5k7i8r/target', 'dracut', '-f', '/boot/initramfs-4.18.0-372.9.1.el8.x86_644.18.0-372.32.1.el8_6.x86_64.img', '4.18.0-372.9.1.el8.x86_644.18.0-372.32.1.el8_6.x86_64']
Exit code: 1
Reason: -
Stdout: ''
Stderr: dracut: Cannot find module directory /lib/modules/4.18.0-372.9.1.el8.x86_644.18.0-372.32.1.el8_6.x86_64/
dracut: and --no-kernel was not specified
```

Then following the stack trace, this line in the source can be found:

```
kver_cmd = ['rpm', '-q', '--queryformat', '%{VERSION}-%{RELEASE}.%{ARCH}', 'kernel']
```

Then, if this command is run on a system with at leas two kernels
installed, the returned string is malformed:

```
rpm -q --queryformat='%{VERSION}-%{RELEASE}.%{ARCH}' kernel
4.18.0-477.10.1.el8_8.x86_64
```

Which causes an issue in the customer's use-case.

As this issue is time sensitive, would it be possible to request a
workaround while a fix is developed?

Thank you.

** Affects: curtin
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to curtin.
https://bugs.launchpad.net/bugs/2028092

Title:
  Multiple kernels kver_cmd to return an incoherent string

Status in curtin:
  New

Bug description:
  Hello,

  A customer had contacted with an issue related to this bug. Taking a
  look at the stacktrace for the issue:

  ```
  ls -la
  total 16
  drwxr-xr-x. 4 root root 4096 Feb 10 02:53 .
  dr-xr-xr-x. 40 root root 4096 Feb 10 02:58 ..
  drwxr-xr-x. 6 root root 4096 Feb 10 02:54 4.18.0-372.32.1.el8_6.x86_64
  drwxr-xr-x. 6 root root 4096 Feb 10 02:49 4.18.0-372.9.1.el8.x86_64

  <stack trace>
  Running curthooks.builtin_curthooks...
  Traceback (most recent call last):
  File "/tmp/tmp1x5k7i8r/target/curtin/curtin-hooks", line 133, in <module>
  main()
  File "/tmp/tmp1x5k7i8r/target/curtin/curtin-hooks", line 129, in main
  curthook(config, target, state)
  File "/tmp/tmp1x5k7i8r/target/curtin/curtin-hooks", line 114, in curthook
  curthooks.builtin_curthooks(cfg, target, state)
  File "/curtin/curtin/commands/curthooks.py", line 1831, in builtin_curthooks
  redhat_update_initramfs(target, cfg)
  File "/curtin/curtin/commands/curthooks.py", line 1672, in redhat_update_initramfs
  in_chroot.subp(dracut_cmd, capture=True)
  File "/curtin/curtin/util.py", line 787, in subp
  return subp(*args, **kwargs)
  File "/curtin/curtin/util.py", line 275, in subp
  return _subp(*args, **kwargs)
  File "/curtin/curtin/util.py", line 139, in _subp
  raise ProcessExecutionError(stdout=out, stderr=err,
  curtin.util.ProcessExecutionError: Unexpected error while running command.
  Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmp1x5k7i8r/target', 'dracut', '-f', '/boot/initramfs-4.18.0-372.9.1.el8.x86_644.18.0-372.32.1.el8_6.x86_64.img', '4.18.0-372.9.1.el8.x86_644.18.0-372.32.1.el8_6.x86_64']
  Exit code: 1
  Reason: -
  Stdout: ''
  Stderr: dracut: Cannot find module directory /lib/modules/4.18.0-372.9.1.el8.x86_644.18.0-372.32.1.el8_6.x86_64/
  dracut: and --no-kernel was not specified
  ```

  Then following the stack trace, this line in the source can be found:

  ```
  kver_cmd = ['rpm', '-q', '--queryformat', '%{VERSION}-%{RELEASE}.%{ARCH}', 'kernel']
  ```

  Then, if this command is run on a system with at leas two kernels
  installed, the returned string is malformed:

  ```
  rpm -q --queryformat='%{VERSION}-%{RELEASE}.%{ARCH}' kernel
  4.18.0-477.10.1.el8_8.x86_64
  ```

  Which causes an issue in the customer's use-case.

  As this issue is time sensitive, would it be possible to request a
  workaround while a fix is developed?

  Thank you.

To manage notifications about this bug go to:
https://bugs.launchpad.net/curtin/+bug/2028092/+subscriptions




More information about the foundations-bugs mailing list