Skip to content

aptpkg.origin.uri is None with Elbe 15.7 (and maybe others) #448

@opensource-mmo

Description

@opensource-mmo

We have run into a problem with Elbe 15.x (15.7 to be specific but the problem might be the same with earlier releases) where Elbe quits relatively early in dump_initvmpkgs.

We are trying to build an armhf rootfs on an x86_64 machine. This used to work just fine, as far as I can remember.

Here's the error we get (server names removed):

[CMD] /usr/sbin/chroot /var/cache/elbe/019aca71-6922-70c3-83db-b97e89e079bf/chroot dpkg --configure -a
[CMD] /usr/sbin/chroot /var/cache/elbe/019aca71-6922-70c3-83db-b97e89e079bf/chroot debconf-set-selections /var/cache/elbe/preseed.txt
[INFO]Keys imported
[CMD] reprepro --basedir /var/cache/elbe/019aca71-6922-70c3-83db-b97e89e079bf/repo export bookworm
Get:1 http://xxxxxxxx/xxxx stable InRelease [7582 B]
Hit http://xxxxxxxx/xxxx bookworm InRelease
Get:2 http://xxxxxxxx/xxxx stable InRelease [5946 B]
Get:3 http://xxxxxxxx/xxxx stable/main all Packages [9239 B]
Get:4 http://xxxxxxxx/xxxx stable/main armhf Packages [820 kB]
Get:5 http://xxxxxxxx/xxxx bookworm/main Sources [9494 kB]
Get:6 http://xxxxxxxx/xxxx bookworm/main Translation-en [6109 kB]
Get:7 http://xxxxxxxx/xxxx stable/main armhf Packages [16.3 kB]
[ERROR]Build failed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/elbepack/asyncworker.py", line 164, in execute
    self.project.build(skip_pkglist=False,
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
                       build_bin=self.build_bin,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^
                       build_sources=self.build_src,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                       skip_pbuild=self.skip_pbuilder)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/elbepack/elbeproject.py", line 594, in build
    self.install_packages(self.buildenv)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/elbepack/elbeproject.py", line 1013, in install_packages
    dump_initvmpkgs(self.xml)
    ~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/elbepack/dump.py", line 60, in dump_initvmpkgs
    xml.append_initvm_pkg(p)
    ~~~~~~~~~~~~~~~~~~~~~^^^
  File "/usr/lib/python3/dist-packages/elbepack/elbexml.py", line 461, in append_initvm_pkg
    self.append_pkg(aptpkg, 'initvmpkgs')
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/elbepack/elbexml.py", line 435, in append_pkg
    pak.et.set('uri', aptpkg.origin.uri)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/lxml/etree.pyx", line 851, in lxml.etree._Element.set
  File "src/lxml/apihelpers.pxi", line 595, in lxml.etree._setAttributeValue
  File "src/lxml/apihelpers.pxi", line 1528, in lxml.etree._utf8
TypeError: Argument must be bytes or unicode, got 'NoneType'

elbe control wait_busy Failed

The project will not be deleted from the initvm.
The files, that have been built, can be downloaded using:
elbe control get_files --output "/work/build/rootfs/elbe-build-20251128-123021" "/var/cache/elbe/019aca71-6922-70c3-83db-b97e89e079bf"

The project can then be removed using:
elbe control del_project "/var/cache/elbe/019aca71-6922-70c3-83db-b97e89e079bf" 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/elbepack/main.py", line 43, in main
    cmdmod.run_command(cmd_argv)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/elbepack/commands/initvm.py", line 51, in run_command
    args.func(args)
    ~~~~~~~~~^^^^^^
  File "/usr/lib/python3/dist-packages/elbepack/initvmaction.py", line 396, in _submit
    _submit_with_repodir_and_dl_result(initvm.control, xmlfile, cdrom, args)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/elbepack/initvmaction.py", line 98, in _submit_with_repodir_and_dl_result
    _submit_and_dl_result(control, preprocess_xmlfile, cdrom, args)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/elbepack/initvmaction.py", line 128, in _submit_and_dl_result
    raise with_cli_details(e, 133, textwrap.dedent(f"""
    ...<7 lines>...
        {prog} control del_project "{prjdir}" """))
  File "/usr/lib/python3/dist-packages/elbepack/initvmaction.py", line 125, in _submit_and_dl_result
    for msg in control.wait_busy(prjdir):
               ~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/usr/lib/python3/dist-packages/elbepack/soapclient.py", line 153, in wait_busy
    raise CliError(191, f'Project build was not successful, current status: {prj.status}')
elbepack.cli.CliError: Project build was not successful, current status: build_failed
Build failed!

The problem seems to be that Elbe updates the initvm's APT cache with armhf sources, and after that apt can no longer find the source URIs corresponding to packages installed in the initvm. Elbe wants to iterate over these, however, while the aptkg.origin.uri field for every single one of them is now "None". The first affected package is adduser.

Indeed, if we look at the adduser package (apt show adduser) in the initvm right after the build failure, we see:

Package: adduser
Version: 3.152
[...]
APT-Manual-Installed: yes
APT-Sources: /var/lib/dpkg/status

If we then run "apt update" in the initvm, apt show gives us a different output:

Package: adduser
Version: 3.152
[...]
APT-Manual-Installed: yes
APT-Sources: http://xxxxxxxx/xxxx trixie/main amd64 Packages

Similarly, apt list shows all packages as "[installed, local]" right after the build error but as "[installed]" or "[installed, automatic]" after re-running apt update.

As far as I can see, our elbe xml file looks innocent enough, so I really don't know what's wrong.

How can we solve this problem? Right now, we're unable to build a root file system.

Thanks and regards
Markus

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions