Bug 12160 - timezone %pretrans error script
Summary: timezone %pretrans error script
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: i586 Linux
Priority: release_blocker normal
Target Milestone: ---
Assignee: David Walser
QA Contact:
URL:
Whiteboard: 4RC
Keywords: NEEDINFO
: 12164 (view as bug list)
Depends on:
Blocks: 11704
  Show dependency treegraph
 
Reported: 2013-12-30 23:26 CET by Manuel Hiebel
Modified: 2014-01-09 22:57 CET (History)
2 users (show)

See Also:
Source RPM: timezone-6:2013i
CVE:
Status comment:


Attachments
capture of tty2 (2.66 KB, image/png)
2013-12-30 23:27 CET, Manuel Hiebel
Details
report.bug (144.50 KB, application/x-xz)
2014-01-01 17:15 CET, Manuel Hiebel
Details

Description Manuel Hiebel 2013-12-30 23:26:13 CET
Description of problem:

As this is shown as a popup in the installer => blocker

Reproducible: 

Steps to Reproduce:
Manuel Hiebel 2013-12-30 23:26:27 CET

Priority: Normal => release_blocker
Blocks: (none) => 11704

Comment 1 Manuel Hiebel 2013-12-30 23:27:41 CET
Created attachment 4690 [details]
capture of tty2

as install is still running, logs come latter if there is something interesting
Thierry Vignaud 2013-12-31 12:36:11 CET

CC: (none) => thierry.vignaud
Assignee: bugsquad => luigiwalser

Comment 2 Manuel Hiebel 2013-12-31 14:25:10 CET
*** Bug 12164 has been marked as a duplicate of this bug. ***

CC: (none) => dvgevers

Comment 3 Dick Gevers 2013-12-31 14:26:37 CET
:)

Log has:

* trans: scheduling update of timezone-2013i-1.mga4.i586 (id=1739, file=/tmp/image/media/core/timezone-2013i-1.mga4.i586.rpm)
* trans: scheduling update of libdrm_nouveau2-2.4.50-1.mga4.i586 (id=1560, file=/tmp/image/media/core/libdrm_nouveau2-2.4.50-1.mga4.i586.rpm)
* urpmi error: ERROR: 'script' failed for timezone-2013i-1.mga4.i586: 
* timezone not installed, %pretrans(timezone-6:2013i-1.mga4.i586) scriptlet failed, exit status 127
Comment 4 Manuel Hiebel 2013-12-31 14:27:30 CET
(In reply to Manuel Hiebel from comment #2)
> *** Bug 12164 has been marked as a duplicate of this bug. ***

I indeed forget to said for the step: 

Enable additional online media when iso has been seen: a limited number of packages starts to get installed.

certainly a missing require(pre)
Dick Gevers 2013-12-31 14:38:36 CET

URL: (none) => 4RC

Dick Gevers 2013-12-31 14:39:02 CET

URL: 4RC => (none)
Whiteboard: (none) => 4RC

Comment 5 David Walser 2014-01-01 00:23:44 CET
Nothing in this bug says what exactly's going wrong.  There's no reason that the %pretrans script in timezone should fail.  It's one command, protected by a test command, that should never fail anyway.
Comment 6 Thierry Vignaud 2014-01-01 13:53:45 CET
rm can fail.
And it has done as shown above.
Several time.

It can also be missing.
There's nothing preventing timezone to be installed before coreutils.
You're lacking a "Requires(post): coreutils"

Can reporters attach their whole /root/drakx/report.bug.xz in order to confirm?

Keywords: (none) => NEEDINFO

Comment 7 David Walser 2014-01-01 16:21:42 CET
rm -f should not fail, ever.  If it's missing, that would make sense.  rm is used in %pretrans, so it wouldn't be Requires(post).  Is there a such thing as Requires(pretrans) ?
Comment 8 Manuel Hiebel 2014-01-01 17:15:16 CET
Created attachment 4703 [details]
report.bug

Looks so for the coreutils not installed before.
Comment 9 David Walser 2014-01-09 21:13:12 CET
Should be fixed in timezone-2013i-2.mga4.

Now it tests for the existence of the directory before it tries to delete it, so if it's a fresh installation, it shouldn't exist, therefore not attempting to execute the rm command.  Previously it only tested that it wasn't a symlink, but that test returned true if it didn't exist at all.  Also fixed in Mageia 3 SVN.

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 10 Thierry Vignaud 2014-01-09 22:21:29 CET
You still lack a require...

Status: RESOLVED => UNCONFIRMED
Resolution: FIXED => (none)
Ever confirmed: 1 => 0

Comment 11 David Walser 2014-01-09 22:23:41 CET
(In reply to Thierry Vignaud from comment #10)
> You still lack a require...

On what?  coreutils shouldn't be needed now for new installs.

Status: UNCONFIRMED => RESOLVED
Resolution: (none) => FIXED

Comment 12 Thierry Vignaud 2014-01-09 22:54:11 CET
sight...

/me putting my rpm+urpmi maintainer hat.

That's pure non-sense.
urpmi orders packages installation (including splitting them in small transactions) according to their require/provides/conflicts tags

Beside that, their ordering is random in both:
- in the transaction (besides being ordered by their dependancies)
- between different transactions

eg, on two run of:
mkdir T2
urpmi.addmedia --urpmi-root T2 --distrib  /mageia/unstable/i586/
urpmi --urpmi-root T2 timezone --auto

one can get:
-installing perl-Carp-1.320.0-2.mga4.noarch.rpm perl-File-Sync-0.110.0-6.mga4.i586.rpm perl-base-5.18.1-3.mga4.i586.rpm libdb5.3-5.3.21-5.mga4.i586.rpm perl-Exporter-5.680.0-2.mga4.noarch.rpm libgdbm4-1.10-4.mga4.i586.rpm perl-5.18.1-3.mga4.i586.rpm libbzip2_1-1.0.6-4.mga4.i586.rpm from /mageia/unstable/i586/media/core/release
+installing libgdbm4-1.10-4.mga4.i586.rpm multiarch-utils-1.0.13-3.mga4.noarch.rpm libffi6-3.0.13-2.mga4.i586.rpm perl-base-5.18.1-3.mga4.i586.rpm libbzip2_1-1.0.6-4.mga4.i586.rpm perl-MDK-Common-1.2.29-4.mga4.noarch.rpm libpcre1-8.33-2.mga4.i586.rpm perl-File-Sync-0.110.0-6.mga4.i586.rpm from /mageia/unstable/i586/media/core/release
 Preparing...                     #############################################
-    11/32: libgdbm4              #############################################
-    12/32: libdb5.3              #############################################
-    13/32: perl                  #############################################
-    14/32: perl-base             #############################################
-    15/32: perl-Carp             #############################################
-    16/32: perl-Exporter         #############################################
-    17/32: perl-File-Sync        #############################################
-    18/32: libbzip2_1            #############################################
+    11/32: perl-base             #############################################
+    12/32: perl-File-Sync        #############################################
+    13/32: perl-MDK-Common       #############################################
+    14/32: multiarch-utils       #############################################
+    15/32: libpcre1              #############################################
+    16/32: libbzip2_1            #############################################
+    17/32: libffi6               #############################################
+    18/32: libgdbm4              #############################################

See, for the sames packages, the order differs between two runs.
The same is true, a package having very loose requires can end in any transaction after the last one that install its dependencies

So if you use use a coreutils command in some %scriptlet without any "Requires(%scriptlet): coreutils", installation will only work by chance.
But you CANNOT guaranty it'll work.

As in:

installing libpython2.7-2.7.5-11.mga4.i586.rpm libopenssl-engines1.0.0-1.0.1e-8.mga4.i586.rpm bash-completion-2.1-5.mga4.noarch.rpm timezone-2013i-1.mga4.i586.rpm python-2.7.5-11.mga4.i586.rpm libopenssl1.0.0-1.0.1e-8.mga4.i586.rpm from /mageia/unstable/i586/media/core/release
/var/tmp/rpm-tmp.EAsL5i: line 2: rm: command not found
error: %pretrans(timezone-6:2013i-1.mga4.i586) scriptlet failed, exit status 127
ERROR: 'script' failed for timezone-2013i-1.mga4.i586: 
Preparing...                     #############################################
    27/32: libopenssl1.0.0       #############################################
    28/32: libopenssl-engines1.0.0
                                 #############################################
    29/32: libpython2.7          #############################################
    30/32: python                #############################################
    31/32: bash-completion       #############################################
error: timezone-6:2013i-1.mga4.i586: install skipped

And yes this had already bitten quite a number of packagers in the years.
And yes you're just waiting for some random installation to fails on some poor users

Status: RESOLVED => REOPENED
Resolution: FIXED => (none)
Ever confirmed: 0 => 1

Comment 13 David Walser 2014-01-09 22:57:19 CET
As I already explained, the rm command from coreutils *will no longer be used* on new installations due to this change, so the Requires is not needed.

Status: REOPENED => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.