mkosi icon indicating copy to clipboard operation
mkosi copied to clipboard

AttributeError: 'NoneType' object has no attribute 'strip'

Open gdamjan opened this issue 1 year ago • 1 comments

mkosi commit the issue has been seen with

c783b3b0718293387aa5c2b438fa17eebb84142b

Used host distribution

Fedora rawhide

Used target distribution

Debian 13 (trixie)

Linux kernel version used

6.9.1-arch1-1

CPU architectures issue was seen on

None

Unexpected behaviour you saw

Host is ArchLinux, mkosi is from latest main branch as of today.

Exception thrown when running mkosi build:

$ ~/src/mkosi/bin/mkosi build
…
AttributeError: 'NoneType' object has no attribute 'strip'

Used mkosi config

[Distribution]
Distribution=debian
Release=trixie

[Host]
ToolsTree=default
ToolsTreeDistribution=fedora
ToolsTreeRelease=rawhide
ToolsTreePackages=diffutils

[Output]
Format=disk

[Content]
Bootable=yes
Timezone=Etc/UTC
Locale=C
RootPassword=root
Packages=
        apt
        sudo
        ca-certificates
        linux-image-cloud-amd64
        systemd
        systemd-sysv
        systemd-boot
        systemd-resolved
        systemd-timesyncd
        systemd-cron
        dbus-broker
        openssh-server
        less
        vim
        iproute2
        curl

KernelCommandLine=console=tty0 console=ttyS0,115200n8 nvme_core.io_timeout=4294967295 rd.emergency=poweroff

mkosi output

Traceback (most recent call last):
  File "/home/damjan/src/mkosi/mkosi/run.py", line 60, in uncaught_exception_handler
    yield
  File "/home/damjan/src/mkosi/mkosi/run.py", line 101, in fork_and_wait
    target(*args, **kwargs)
  File "/home/damjan/src/mkosi/mkosi/__init__.py", line 4414, in run_sync
    context = Context(
              ^^^^^^^^
  File "/home/damjan/src/mkosi/mkosi/context.py", line 39, in __init__
    make_tree(
  File "/home/damjan/src/mkosi/mkosi/tree.py", line 48, in make_tree
    if statfs(path.parent, sandbox=sandbox) != "btrfs":
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/damjan/src/mkosi/mkosi/tree.py", line 25, in statfs
    ).stdout.strip()
             ^^^^^
AttributeError: 'NoneType' object has no attribute 'strip'

gdamjan avatar May 20 '24 17:05 gdamjan

switching back to the v22 tag, I get this output

$ ~/src/mkosi/bin/mkosi build
bwrap: line 1: bwrap: command not found
bwrap: line 1: bwrap: command not found
‣ "stat --file-system --format %T /home/damjan/.cache/mkosi/mkosi-workspacerl_ungsl" returned non-zero exit code 127.
bwrap: line 1: bwrap: command not found
bwrap: line 1: bwrap: command not found
‣ "rm -rf -- /home/damjan/.cache/mkosi/mkosi-workspacerl_ungsl" returned non-zero exit code 127.

so I guess the missing bwrap is not properly handled in both cases, only with main it fails worse.

gdamjan avatar May 21 '24 13:05 gdamjan

So just to clarify: The error goes away when you have bwrap installed? Yeah, we need to improve the error message there.

behrmann avatar May 22 '24 07:05 behrmann

So just to clarify: The error goes away when you have bwrap installed?

correct

gdamjan avatar May 22 '24 10:05 gdamjan