kisslinux / kiss

KISS Linux - Package Manager
https://kisslinux.github.io
MIT License
464 stars 62 forks source link

Weird cache directory errors. #218

Closed dylanaraps closed 3 years ago

dylanaraps commented 3 years ago

-> git Checking that manifest is valid
-> git Checking that all dependencies are installed
-> git Checking for package conflicts
/usr/bin/kiss: line 822: can't create /root/.cache/kiss/proc/1260/build/1260-m: nonexistent directory
grep: /root/.cache/kiss/proc/1260/build/1260-c: No such file or directory
-> git Installing package
-> git Verifying installation
-> git Installed successfully
-> musl Checking that manifest is valid
-> musl Checking that all dependencies are installed
-> musl Checking for package conflicts
/usr/bin/kiss: line 822: can't create /root/.cache/kiss/proc/1260/build/1260-m: nonexistent directory
grep: /root/.cache/kiss/proc/1260/build/1260-c: No such file or directory
-> musl Installing package
-> musl Verifying installation
-> musl Installed successfully```
dylanaraps commented 3 years ago

The most obvious cause is that $mak_dir ceases to exist though this implies that pkg_clean was executed early.

dylanaraps commented 3 years ago

Already fixed in master.

dylanaraps commented 3 years ago

It lives!

dylanaraps commented 3 years ago

More logs:

/usr/bin/kiss: line 933: can't create /root/.cache/kiss/proc/813465/build/v: nonexistent directory
/usr/bin/kiss: line 1442: can't create /root/.cache/kiss/proc/1370977/build/m: nonexistent directory

Also, I'm still trying to find a reliable way to reproduce this. I can sometimes make the error occur in a chroot but it's quite random.

dylanaraps commented 3 years ago

This should fix the issue.

https://github.com/kisslinux/kiss/commit/b1332a309afa5ad2e200f36b1d0749a69e12a46a

dilyn-corner commented 3 years ago

I can almost always get this to reproduce in a fresh chroot after updating kiss. You can probably do it right now too; download kiss-chroot-2021.7-6.tar.xz, chroot in, clone the repo, kiss u. See the following:

-> kiss Building package (1/1)
-> kiss Extracting sources
-> kiss Starting build
-> kiss Successfully built package
-> kiss Stripping binaries and libraries
-> kiss Generating manifest
-> kiss looking for dependencies (using readelf)
-> kiss Generating manifest
-> kiss Generating etcsums
-> kiss Creating tarball
-> kiss Successfully created tarball
-> Install built packages? [kiss] 
-> Continue?: Press Enter to continue or Ctrl+C to abort 

-> kiss Checking if manifest valid
-> kiss Checking if package installable
-> kiss Checking for package conflicts
-> kiss Installing package (kiss@5.5.2-2.tar.gz)
-> kiss Installed successfully
-> kiss Checking if manifest valid
-> kiss Checking if package installable
-> kiss Checking for package conflicts
/usr/bin/kiss: line 954: can't create /root/.cache/kiss/proc/8012/build/cf_m: nonexistent directory
grep: /root/.cache/kiss/proc/8012/build/cf: No such file or directory
-> kiss Installing package (kiss@5.5.2-2.tar.gz)
/usr/bin/kiss: line 1441: can't create /root/.cache/kiss/proc/8012/build/m: nonexistent directory

SOMETIMES, it's a different error - a syntax error, although the syntax error it complains about varies by update. That one is a bit tougher.

Error does NOT seem to happen in the case where first you nab kiss from its repo, swap that for /usr/bin/kiss, MODIFY the source/version of kiss in repo/core to be git+https://github.com/kisslinux/kiss, and then update. If you instead swap kiss and then just go straight to a kiss u, the same error occurs. So it looks like it may indeed be fixed in master.

dylanaraps commented 3 years ago

It gets weirder. If you add an ls -ld "$mak_dir" to the code (right before the offending line) the first error goes away.

-> kiss Checking if manifest valid
-> kiss Checking if package installable
-> kiss Checking for package conflicts
drwxr-xr-x    3 root     root          4096 Jul 16 04:35 /root/.cache/kiss/proc/3145/build
-> kiss Installing package (kiss@5.5.2-2.tar.gz)
-> kiss Installed successfully
-> kiss Checking if manifest valid
-> kiss Checking if package installable
-> kiss Checking for package conflicts
ls: /root/.cache/kiss/proc/3145/build: No such file or directory

But! It truly doesn't seem to exist in the second iteration.

dylanaraps commented 3 years ago

OK. That error (updating kiss) has been solved. I think I know what the issue is as well.

dylanaraps commented 3 years ago

Pushed another potential fix. Now, the cache directory is only cleaned in the top-level process and not any children spawned by it. Let me know if you can still reproduce (my reliable test case now has no errors).

dylanaraps commented 3 years ago

Please try the latest master. I pushed a series of commits (and fixed unrelated bugs too).

dylanaraps commented 3 years ago

I discovered and fixed many errors within our temporary directory/file handling and can no longer reproduce this (even unreliably).

Let me know if there are still issues.

dylanaraps commented 3 years ago

Please reopen if the issue still occurs.

dylanaraps commented 3 years ago

Pushed a new package manager release, please try it out.

dilyn-corner commented 3 years ago

It... SEEMS fixed. :)