LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-16-2019, 09:06 PM   #1
HQuest
LQ Newbie
 
Registered: Jan 2018
Location: 2001:470:c2d0::/56
Distribution: Anyone that I can interface with
Posts: 15

Rep: Reputation: Disabled
slackpkg/pkgtools upgrade issue on -current


Bug report: When the disk is full and slackpkg tries to upgrade a package that fails one of its internal steps, it still reports upgrade as successful:

Code:
+==============================================================================
| Upgrading kernel-modules-4.19.82-x86_64-1 package using ./kernel-modules-4.19.84-x86_64-2.txz
+==============================================================================
Pre-installing package kernel-modules-4.19.84-x86_64-2...
cp: error writing '/var/lib/pkgtools/scripts/kernel-modules-4.19.84-x86_64-2': No space left on device
Removing package: kernel-modules-4.19.82-x86_64-1-upgraded-2019-11-17,00:56:54
sort: write failed: 'standard output': No space left on device
sort: write error
sort: write failed: 'standard output': No space left on device
sort: write error
sort: fflush failed: 'standard output': No space left on device
sort: write error
sort: write failed: 'standard output': No space left on device
sort: write error
comm: file 1 is not in sorted order
comm: input is not in sorted order
comm: file 1 is not in sorted order
comm: input is not in sorted order
comm: write error
Verifying package kernel-modules-4.19.84-x86_64-2.txz.
Unable to install ./kernel-modules-4.19.84-x86_64-2.txz:  tar archive is corrupt (tar returned error code 2)
Package kernel-modules-4.19.82-x86_64-1 upgraded with new package ./kernel-modules-4.19.84-x86_64-2.txz.

Last edited by HQuest; 11-19-2019 at 06:26 PM.
 
Old 11-16-2019, 10:28 PM   #2
USUARIONUEVO
Senior Member
 
Registered: Apr 2015
Posts: 1,270

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
No space left on device
 
Old 11-17-2019, 06:49 AM   #3
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Slackware
Posts: 2,032
Blog Entries: 5

Rep: Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205
I think the OP is querying if the kernel has actually been upgraded and/or why slackpkg reports such if it hasn't been due to the root partition being full.

Last edited by Lysander666; 11-17-2019 at 06:52 AM.
 
Old 11-19-2019, 01:06 PM   #4
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 498

Rep: Reputation: 240Reputation: 240Reputation: 240
All bets off with a full disk

Quote:
Originally Posted by HQuest View Post
When the disk is full ...
Linux may be different, but my experience with Unix-like operating systems over the years has taught me not to troubleshoot with a full disk. The failure symptoms are typically inaccurate and won't lead you to a solution.

You should resolve the full disk problem before rerunning the slackpkg process(es).

Last edited by TracyTiger; 11-19-2019 at 01:09 PM.
 
1 members found this post helpful.
Old 11-19-2019, 02:41 PM   #5
drgibbon
Member
 
Registered: Nov 2014
Distribution: Slackware64 14.2
Posts: 520

Rep: Reputation: 342Reputation: 342Reputation: 342Reputation: 342
Quote:
Originally Posted by HQuest View Post
When the disk is full and slackpkg tries to upgrade a package that fails one of its internal steps, it still reports upgrade as successful
It seems to me that OP is giving a bug report, not looking for an explanation or troubleshooting advice.
 
1 members found this post helpful.
Old 11-19-2019, 06:20 PM   #6
HQuest
LQ Newbie
 
Registered: Jan 2018
Location: 2001:470:c2d0::/56
Distribution: Anyone that I can interface with
Posts: 15

Original Poster
Rep: Reputation: Disabled
Well, seems I should definitely word better my post. Yes, this was supposed to be a bug report. Yes, I know one should not run on full disks but incidents happens - just as it happened on this test setup, a process stored some large amount of data and died, but the OS was still alive and kicking, with room just enough to run the slackpkg tool and download a few files.

As I (poorly) wrote, even while the disk was full and clearly errors were reported by multiple commands through the upgrade process, it was still reported as a successful upgrade. Which should not, for many reasons, ranging from a novice user not sure what the impact of a half upgrade could bring, to someone not paying attention in full, or with automated scripts calling these apps in between.

So that’s the story. Yes, housekeeping is still a thing on any OS (which cron is already taking care of mine), but some sanity checks at tools so critical as system upgrades can make a difference on how robust or how amateur is the distribution.

And yes, I likely got sidetracked during OP and didn’t wrote much more details, as I just did it again on this one.

Last edited by HQuest; 11-19-2019 at 06:23 PM.
 
1 members found this post helpful.
Old 11-19-2019, 10:18 PM   #7
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 3,529

Rep: Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886
Well, the problem is that (from my experience anyways) a unix system with a full filesystem will be insane. You won't know what successfully made it to disk and what didn't.

If you use LVM and have multiple logical volumes, it could very well be the case that some (or most) of the upgrade made it but other important bits did not.

Been there, done that, bought the T-shirt, and bought an additional number of T-shirts (to my chagrin).

The fix is to reinstall the software that you thought you were upgrading, after you've ensured that there's plenty of room for the updates.

If English is your native language, you should be a little less insulting the next time you post.
Quote:
[...] how robust or how amateur is the distribution.
 
1 members found this post helpful.
Old 11-19-2019, 11:02 PM   #8
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 6,279

Rep: Reputation: 4028Reputation: 4028Reputation: 4028Reputation: 4028Reputation: 4028Reputation: 4028Reputation: 4028Reputation: 4028Reputation: 4028Reputation: 4028Reputation: 4028
Am I missing something? Is it not reasonable to expect that upgradepkg not report that an upgrade occurred when there were several errors during the upgrade process? Just because we've gone years and/or decades without this issue being brought up doesn't mean that it shouldn't be considered a bug.

Quote:
Originally Posted by HQuest View Post
Code:
Package kernel-modules-4.19.82-x86_64-1 upgraded with new package ./kernel-modules-4.19.84-x86_64-2.txz.
This final output of upgradepkg is a little deceiving considering how many errors were thrown during the upgrade process. Even saying something like "There were errors during the process. Upgrade may have failed." or something seems better than just saying "old-package upgraded with new package".

Yes, it is obviously better to not have a full system partition, but error messages that cover various issues like filling up the partition (many have had that rogue logfile get spammed and fill their filesystem) seem better than just saying "keep enough space on your system" and you won't run into the problem you just did.
 
6 members found this post helpful.
Old 11-19-2019, 11:28 PM   #9
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware, Proxmox, Debian, CentOS
Posts: 1,328

Rep: Reputation: Disabled
Code:
Unable to install ./kernel-modules-4.19.84-x86_64-2.txz:  tar archive is corrupt (tar returned error code 2)
Package kernel-modules-4.19.82-x86_64-1 upgraded with new package ./kernel-modules-4.19.84-x86_64-2.txz.
I agree this is an informational bug. The Unable to install message is from installpkg and the upgraded with new package message is from upgradepkg.

While the stdout provides plenty of clues, after the Unable to install message, the process should terminate with no additional messages or present a different message rather than upgraded with new package.

Past my bed time, but perhaps something like:

Code:
--- installpkg	2016-03-19 14:45:39.000000000 -0500
+++ installpkg.new	2019-11-19 22:22:08.881476067 -0600
@@ -378,9 +378,9 @@
   cat $package | $packagecompression -dc | dd 2> $TMP/tmpsize$$ | $TAR tf - 1> $TMP/tmplist$$ 2> /dev/null
   TARERROR=$?
   if [ ! "$TARERROR" = "0" ]; then
-    EXITSTATUS=1 # tar file corrupt
+    EXITSTATUS=1 # Unable to extract the tar archive
     if [ "$MODE" = "install" ]; then
-      echo "Unable to install $package:  tar archive is corrupt (tar returned error code $TARERROR)"
+      echo "Unable to install $package:  Unable to extract the tar archive (tar returned error code $TARERROR)"
     fi
     rm -f $TMP/tmplist$$ $TMP/tmpsize$$
     continue
Code:
--- upgradepkg	2015-10-01 12:55:34.000000000 -0500
+++ upgradepkg.new	2019-11-19 22:24:52.360432298 -0600
@@ -335,10 +335,16 @@
   # shift location, so we should always reinstall as the final step:
   if [ ! "$NOT_PARANOID" = "true" ]; then
     /sbin/installpkg $INCOMINGDIR/$NNAME
+    INSTALLPKG_EXITSTATUS=$?
   fi
 
-  echo "Package $OLD upgraded with new package $INCOMINGDIR/$NNAME."
-  ERRCODE=0
+  if [ $INSTALLPKG_EXITSTATUS -eq 0 ]; then
+    echo "Package $OLD upgraded with new package $INCOMINGDIR/$NNAME."
+    ERRCODE=0
+  else
+    echo "There was an error installing $INCOMINGDIR/$NNAME."
+    ERRCODE=1
+  fi
 done
 
 if [ ! "$DRY_RUN" = "true" ]; then
 
6 members found this post helpful.
Old 11-20-2019, 08:31 AM   #10
HQuest
LQ Newbie
 
Registered: Jan 2018
Location: 2001:470:c2d0::/56
Distribution: Anyone that I can interface with
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Richard Cranium View Post
The fix is to reinstall the software that you thought you were upgrading, after you've ensured that there's plenty of room for the updates.
If the fix is to ensure there's room for updates (and we are in an agreement in here) because the root cause was a full volume, and one or more intermediate processes failed, why the tool still reported success, then? That looks like a bug to me (and not a cosmetic one since files were modified on the disk). More so as each and every scripts and commands returns an exit code one should use to ensure no failure in the entire process chain is reported as "all good".

Adding to the fact Slackware's original package management was never the most robust of its features (no dependency check, no automatic download and no pre-requisites verification), this (and likely other scenarios as well) was an incident just waiting to happen.

Thanks @upnort for taking your time to look at the code.

And @Richard, improve your angry management skills, then thank me later.
 
Old 11-20-2019, 11:29 AM   #11
Jan K.
Member
 
Registered: Apr 2019
Location: Esbjerg
Distribution: slackware...
Posts: 127

Rep: Reputation: 50
Quote:
Originally Posted by HQuest View Post
If the fix is to ensure there's room for updates (and we are in an agreement in here) because the root cause was a full volume, and one or more intermediate processes failed, why the tool still reported success, then? That looks like a bug to me (and not a cosmetic one since files were modified on the disk). More so as each and every scripts and commands returns an exit code one should use to ensure no failure in the entire process chain is reported as "all good".
You can see the fix above posted by upnort. Not a check for required disc space, but a clean script exit.

Read the code...

Quote:
Originally Posted by HQuest View Post
Adding to the fact Slackware's original package management was never the most robust of its features (no dependency check, no automatic download and no pre-requisites verification), this (and likely other scenarios as well) was an incident just waiting to happen.
Through +30 years never allowed free disc space to dive below 25% disc size, so such an "incident" has never occured.

Btw. Slackware package management I would very much like to *not* dependency check or auto-download anything. If Slackware did this, it would in my book violate the basic philosophy of the distro...

Just get a new disc and - Voila!

Thanks for the bug report!
 
1 members found this post helpful.
Old 11-20-2019, 01:24 PM   #12
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware, Proxmox, Debian, CentOS
Posts: 1,328

Rep: Reputation: Disabled
Friendly reminder, my patch is not robust and only addresses the immediate quirk of the OP. There are three additional places where installpkg is run in upgradepkg. In installpkg there are four additional places where EXITSTATUS= is used, which affects how upgradepkg might be patched with more informational or technically correct messages. A robust patch would evaluate all of those instances.

Adding informational or technically correct messages does not include any kind of sanity check for disk space. I think a basic sanity check would be useful -- that way the script terminates without all of the stderr spew shared by the OP.

Last edited by upnort; 11-20-2019 at 01:26 PM.
 
2 members found this post helpful.
Old 11-20-2019, 11:06 PM   #13
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 3,529

Rep: Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886
Quote:
Originally Posted by HQuest View Post
And @Richard, improve your angry management skills, then thank me later.
That's Mr. Cranium to you, fourth-point-of-contact.
 
Old 11-21-2019, 11:02 AM   #14
HQuest
LQ Newbie
 
Registered: Jan 2018
Location: 2001:470:c2d0::/56
Distribution: Anyone that I can interface with
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Jan K. View Post
Through +30 years never allowed free disc space to dive below 25% disc size, so such an "incident" has never occured.
"Through my +30 years flying my plane never crashed." That's how all these arguments about "do proper maintenance" sounds like. Yet, planes do crash, and their makers look at all the small details so one failed part doesn't cause the entire plane to crash "successfully".

Sorry for reporting what I thought would be a bug and causing this whole confusion. Enjoy your days.

Last edited by HQuest; 11-21-2019 at 11:10 AM.
 
1 members found this post helpful.
Old 11-21-2019, 11:33 AM   #15
drgibbon
Member
 
Registered: Nov 2014
Distribution: Slackware64 14.2
Posts: 520

Rep: Reputation: 342Reputation: 342Reputation: 342Reputation: 342
Quote:
Originally Posted by HQuest View Post
Sorry for reporting what I thought would be a bug and causing this whole confusion. Enjoy your days.
Some of the responses were a bit odd, but no need to apologize, thanks for posting it. Take care.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackpkg upgrade-all returns 'no packages to upgrade' after slackpkg-update has downloaded files san2ban Slackware 8 11-01-2019 06:44 AM
Curious: pkgtools Directories and SymlLnks with pkgtools-15.0-noarch-20.txz on Thu Jun 21 22:58:42 UTC 2018 kjhambrick Slackware 4 06-23-2018 02:16 AM
[SOLVED] slackpkg 2.82.1 (slackware 14.2) and newest pkgtools zerouno Slackware 7 06-22-2018 10:04 AM
[SOLVED] dialog screen mangled when running slackpkg or pkgtools as root (but not sbopkg) Paulo2 Slackware 25 04-21-2018 03:04 PM
Slackpkg and pkgtools md5sum error piratesmack Slackware 3 04-16-2009 08:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration