lkrg-org / lkrg

Linux Kernel Runtime Guard
https://lkrg.org
Other
403 stars 72 forks source link

mkosi-mainline E: Tried to extract package, but file already exists. Exit... #303

Closed solardiz closed 4 months ago

solardiz commented 4 months ago

It worked a few days ago (at least under my personal GitHub account), but is failing now:

https://github.com/lkrg-org/lkrg/actions/runs/8039334225/job/21956293753

I: Chosen extractor for .deb packages: dpkg-deb
I: Extracting base-files...
E: Tried to extract package, but file already exists. Exit...
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.10/dist-packages/mkosi/__main__.py", line 45, in <module>
    main()
  File "/usr/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/usr/local/lib/python3.10/dist-packages/mkosi/__main__.py", line 41, in main
    run_verb(a)
  File "/usr/local/lib/python3.10/dist-packages/mkosi/__init__.py", line 8254, in run_verb
    manifest = build_stuff(config)
  File "/usr/local/lib/python3.10/dist-packages/mkosi/__init__.py", line 7550, in build_stuff
    image = build_image(state)
  File "/usr/local/lib/python3.10/dist-packages/mkosi/__init__.py", line 7270, in build_image
    install_distribution(state, cached_tree)
  File "/usr/local/lib/python3.10/dist-packages/mkosi/__init__.py", line 2979, in install_distribution
    install(state)
  File "/usr/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/usr/local/lib/python3.10/dist-packages/mkosi/__init__.py", line 2666, in install_ubuntu
    install_debian_or_ubuntu(state)
  File "/usr/local/lib/python3.10/dist-packages/mkosi/__init__.py", line 2535, in install_debian_or_ubuntu
    run(cmdline)
  File "/usr/local/lib/python3.10/dist-packages/mkosi/backend.py", line 860, in run
    return subprocess.run(cmdline, check=check, stdout=stdout, stderr=stderr, env={**os.environ, **env}, **kwargs)
  File "/usr/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['debootstrap', '--variant=minbase', '--include=ca-certificates', '--merged-usr', '--components=universe,main', '--arch=amd64', 'noble', '/var/tmp/mkosi-u1qyvp2t/root', 'http://archive.ubuntu.com/ubuntu']' returned non-zero exit status 1.

Maybe this is something temporarily that will resolve on its own, or maybe we need to fix it, @vt-alt.

solardiz commented 4 months ago

I tried re-running the job and it failed again exactly the same.

vt-alt commented 4 months ago

It seems that these issues (with old mkosi and diverging Ubuntu's debootstrap) become more and more complicated (to debug).

solardiz commented 4 months ago

@vt-alt Any chance you'd fix this now, as I am about to merge lots of changes and make a release? Thank you!

vt-alt commented 4 months ago

Are you hurrying? I thought it's waitable until weekend.

They started to prepare mainline kernels for an upcoming release, and debootstrap is missing it's script.

E: No such script: /usr/share/debootstrap/scripts/noble

I don't yet know how to properly install it. [Maybe some update channel could be added to the system (which is on jammy). We need to find this out.]

solardiz commented 4 months ago

I'm hurrying to release 0.9.8, which I intend to do today or tomorrow. It would be great to have CI fully working at release time, but not strictly necessary.

vt-alt commented 4 months ago

We need debootstrap (1.0.134) and it's not available via jammy-proposed repo. I think we can use Ubuntu's debootstrap git repo and install it into /usr/local/bin. Already tested it to work manually.

It could be cloned with --depth 1 into /debootstrap (so we don't need to set DEBOOTSTRAP_DIR) and then symlinked into /usr/local/bin (if it's first in PATH (untested).

solardiz commented 4 months ago

we can use Ubuntu's debootstrap git repo

Great. Are you going to send a PR implementing this? Thank you!

vt-alt commented 4 months ago

I'm hurrying to release 0.9.8, which I intend to do today or tomorrow.

This is curiously quick.

solardiz commented 4 months ago

Thank you for fixing this so quickly, @vt-alt! I am releasing 0.9.8 now.

vt-alt commented 4 months ago

Btw, why don't you make github release with at least short description. I think they are useful for user visibility.