LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 08:06 PM   #1
HQuest
Member
 
Registered: Jan 2018
Location: 2001:470:c2d0::/56
Distribution: Anyone that I can interface with
Posts: 87

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 05:26 PM.
 
Old 11-16-2019, 09:28 PM   #2
USUARIONUEVO
Senior Member
 
Registered: Apr 2015
Posts: 2,335

Rep: Reputation: 930Reputation: 930Reputation: 930Reputation: 930Reputation: 930Reputation: 930Reputation: 930Reputation: 930
No space left on device
 
Old 11-17-2019, 05:49 AM   #3
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Ubuntu, Debian, Slackware
Posts: 2,178
Blog Entries: 6

Rep: Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470
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 05:52 AM.
 
Old 11-19-2019, 12:06 PM   #4
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273
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 12:09 PM.
 
1 members found this post helpful.
Old 11-19-2019, 01:41 PM   #5
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,220

Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
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, 05:20 PM   #6
HQuest
Member
 
Registered: Jan 2018
Location: 2001:470:c2d0::/56
Distribution: Anyone that I can interface with
Posts: 87

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 05:23 PM.
 
1 members found this post helpful.
Old 11-19-2019, 09:18 PM   #7
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
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, 10:02 PM   #8
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
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, 10:28 PM   #9
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
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, 07:31 AM   #10
HQuest
Member
 
Registered: Jan 2018
Location: 2001:470:c2d0::/56
Distribution: Anyone that I can interface with
Posts: 87

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, 10:29 AM   #11
Jan K.
Member
 
Registered: Apr 2019
Location: Esbjerg
Distribution: Windows 7...
Posts: 773

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
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, 12:24 PM   #12
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
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 12:26 PM.
 
2 members found this post helpful.
Old 11-20-2019, 10:06 PM   #13
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
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, 10:02 AM   #14
HQuest
Member
 
Registered: Jan 2018
Location: 2001:470:c2d0::/56
Distribution: Anyone that I can interface with
Posts: 87

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 10:10 AM.
 
1 members found this post helpful.
Old 11-21-2019, 10:33 AM   #15
drgibbon
Senior Member
 
Registered: Nov 2014
Distribution: Slackware64 15.0
Posts: 1,220

Rep: Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942Reputation: 942
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



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 05: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 01:16 AM
[SOLVED] slackpkg 2.82.1 (slackware 14.2) and newest pkgtools zerouno Slackware 7 06-22-2018 09:04 AM
[SOLVED] dialog screen mangled when running slackpkg or pkgtools as root (but not sbopkg) Paulo2 Slackware 25 04-21-2018 02:04 PM
Slackpkg and pkgtools md5sum error piratesmack Slackware 3 04-16-2009 07:18 PM

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

All times are GMT -5. The time now is 04:42 AM.

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
Open Source Consulting | Domain Registration