Bug 13852

Summary: Release notes buttons work but come up empty during installation
Product: Mageia Reporter: Dick Gevers <dvgevers>
Component: Release (media or process)Assignee: Anne Nicolas <ennael1>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: release_blocker CC: eeeemail, ennael1, pterjan, sysadmin-bugs, tmb, westel
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard: 5beta2
Source RPM: 1st built classical iso dtd 12.DEC.2014 CVE:
Status comment:
Attachments: directory of mounted media
waiting for release-notes..html
Logs during installation

Description Dick Gevers 2014-08-04 04:35:31 CEST
Description of problem:

During packages installation the button "Release Notes" brings up a blank screen devoid of content. Earlier places point to the current release notes, but here it does not. 

It pulls up a blank screen in the same way from 1/ "Details" screen, also from 2/ "No details (advertising)" screen.



Reproducible: 

Steps to Reproduce:
Dick Gevers 2014-08-04 04:42:55 CEST

Whiteboard: (none) => 5alpha2

Dick Gevers 2014-08-07 10:06:55 CEST

Hardware: i586 => All
Source RPM: 1st built 32 bits classical iso dtd 01.AUG.2014 => 2nd built 32 bits classical iso dtd 01.AUG.2014

claire robinson 2014-08-08 15:19:47 CEST

CC: (none) => eeeemail, ennael1

Comment 1 claire robinson 2014-08-08 15:20:36 CEST
Noticed in 3rd build too.
Manuel Hiebel 2014-09-14 21:38:25 CEST

Priority: Normal => release_blocker
Assignee: bugsquad => thierry.vignaud

Comment 2 Manuel Hiebel 2014-10-07 09:52:08 CEST
in the netinstall it works, to check on beta1

Keywords: (none) => NEEDINFO

Comment 3 Dick Gevers 2014-10-29 20:20:53 CET
Classical iso (64 bits) from build2 dtd 28.10.2014 still has it. (On real HW as per wiki (Notebook)).

Keywords: NEEDINFO => (none)
Source RPM: 2nd built 32 bits classical iso dtd 01.AUG.2014 => 2nd built classical iso dtd 28.OCT.2014
Whiteboard: 5alpha2 => 5beta1

Comment 4 Anne Nicolas 2014-11-27 00:03:13 CET
in ddebug.log we can see:

Cannot open /tmp/media/i586/release-notes..html: No such file or directory

Looks like bug is in any.pm in get_release_notes function. I'm not Perl fluent but I guess pb is there
Comment 5 Thierry Vignaud 2014-11-27 11:53:17 CET
I doubt that, the code hasn't changed for quite a long time and it works fine for netinstall => your ISO is not right.
I suggest that you compare it with eg mga4
Comment 6 Anne Nicolas 2014-11-28 18:19:50 CET
Using boot.iso and remote mirror, I get exactly the same behaviour, waiting for a file called "release-notes..html"
Adding screenshots to show the file is there.
Comment 7 Anne Nicolas 2014-11-28 18:22:06 CET
Created attachment 5656 [details]
directory of mounted media
Comment 8 Anne Nicolas 2014-11-28 18:23:24 CET
Created attachment 5657 [details]
waiting for release-notes..html
Comment 9 claire robinson 2014-11-28 18:49:57 CET
the ls -l in attachment 5656 [details] shows size 0 for a number of files there
Comment 10 claire robinson 2014-11-28 18:50:51 CET
Sorry, ignore that. I was looking at the wrong number!
Comment 11 Dick Gevers 2014-11-28 19:02:52 CET
I dont want to insult anyone, but:
...notes..html...
is not the same as:
...notes.html...

there being an extra dot in the filename.
Comment 12 Dick Gevers 2014-12-13 15:38:18 CET
Applies to 5beta2

Source RPM: 2nd built classical iso dtd 28.OCT.2014 => 1st built classical iso dtd 12.DEC.2014
Whiteboard: 5beta1 => 5beta2

Comment 13 Anne Nicolas 2014-12-14 23:00:56 CET
Created attachment 5707 [details]
Logs during installation

Getting some more messages here
Comment 14 Ben McMonagle 2014-12-15 08:08:46 CET
same error beta2-i586 dvd classic install

CC: (none) => westel

Comment 15 Pascal Terjan 2014-12-15 13:45:27 CET
Code is slightly strange as it builds both "release-notes$ext" and 'release-notes.' . $ext while $ext already contains a dot.

More strange is the list of those not being delimited but I keep getting surprised at what is valid perl...

    my $ext = $in->isa('interactive::gtk') ? '.html' : '.txt';
    my $separator = $in->isa('interactive::gtk') ? "\n\n" : '';

    my $release_notes = join($separator, grep { $_ } map {
        if ($::isInstall) {
            my $f = install::any::getFile_($::o->{stage2_phys_medium}, $_);
            $f && cat__($f);
        } else {
            my $file = $_;
            my $d = find { -e "$_/$file" } glob_("/usr/share/doc/*-release-*");
            $d && cat_("$d/$file");
        }
    } "release-notes$ext", 'release-notes.' . $ext);

CC: (none) => pterjan

Comment 16 Thierry Vignaud 2014-12-18 16:24:46 CET
We could remove the second element after last year Thomas' change:
http://gitweb.mageia.org/software/drakx/commit/perl-install/any.pm?id=f811629c672dc9b4c9e39b03cbfb7bde239126e8

That would remove the following warning:
Cannot open /tmp/media/i586/release-notes..html: No such file or directory

But if release notes window is empty, that means the file must be empty.

Component: Installer => Release (media or process)
Assignee: thierry.vignaud => ennael1
CC: (none) => sysadmin-bugs, tmb

Comment 17 Dick Gevers 2014-12-18 17:37:37 CET
@tv: the file is jot empty wgen the release notes button is used in the license acceptance screen.

But I notice TWO dots when you quote "cannot open .... release-notes..html"

After all when I look at comment 15 there is a dot after 'release-notes' AND - dot before 'html' , there normally are no 2 dots in a file name in the same position.
Comment 18 Anne Nicolas 2014-12-20 13:14:22 CET
(In reply to Thierry Vignaud from comment #16)
> We could remove the second element after last year Thomas' change:
> http://gitweb.mageia.org/software/drakx/commit/perl-install/any.
> pm?id=f811629c672dc9b4c9e39b03cbfb7bde239126e8
> 
> That would remove the following warning:
> Cannot open /tmp/media/i586/release-notes..html: No such file or directory
> 
> But if release notes window is empty, that means the file must be empty.

Releases Notes are printed properly in first step of installer. It fails *only* during packages installation. Checking release notes file in /tmp/image shows a non empty file. Also I can see a content using "cat" command
Comment 19 Anne Nicolas 2014-12-23 21:53:24 CET
Using Mageia 5 beta 2 iso, we have release_notes.html file in both places : 
/tmp and /tmp/image. The one in /tmp/image is ok. The one in /tmp is empty. That may be the pb.
Comment 20 Anne Nicolas 2014-12-23 21:58:53 CET
btw in any.pm we can see
sub run_display_release_notes {
    my ($release_notes) = @_;
    output('/tmp/release_notes.html', $release_notes);

so indeed there is a pb here.
Comment 21 Anne Nicolas 2015-01-04 00:19:11 CET
What about using rather:

sub run_display_release_notes {
    my ($release_notes) = @_;
    output('/tmp/image/release_notes.html', $release_notes);


tv ?
Comment 22 Pascal Terjan 2015-01-06 22:57:13 CET
This is wrong as the command it will then run (/usr/bin/display_release_notes.pl) expects it in /tmp/release_notes.html.

Looking at it again.

In the first step of the installer (acceptLicense) which is working, it calls:

    my $release_notes = get_release_notes($in);
[...]
    run_display_release_notes($release_notes)

get_release_notes reads it from $::o->{stage2_phys_medium}/release-notes.html (or .txt)

run_display_release_notes writes it into /tmp/release-notes.html and calls /usr/bin/display_release_notes.pl

During packages installation:

    state $release_notes ||= any::get_release_notes($o);
    my $rel_notes = gtknew('Button', text => N("Release Notes"),
                           clicked => sub { $show_release_notes = 1 });
[...]
            if_($release_notes, $rel_notes),
[...]
            # display release notes if requested, when not chrooted:
            if ($show_release_notes) {
                undef $show_release_notes;
                any::run_display_release_notes($release_notes);
                $w->flush;
            }

So, if the "Release Notes" button is displayed it means they are not empty...

Then any::run_display_release_notes writes them into /tmp/release-notes.html and calls /usr/bin/display_release_notes.pl

In both cases /tmp/release-notes.html is only written when pressing the button.

The only change slightly related I noticed is from before Mageia 4, but no obvious reason it would impact this problem:

-    system('/usr/bin/display_release_notes.pl');
+    run_program::raw({ detach => 1 }, '/usr/bin/display_release_notes.pl');

Was it working in Magaeia 4?
Comment 23 Pascal Terjan 2015-01-06 23:07:56 CET
I found https://rt.perl.org/Public/Bug/Display.html?id=123029 

And it seems to be the problem with our big state var:

$ perl -l -E 'sub { state $s; $s = "foo"x500; my $c = $s; print $s}->()'

$ perl -l -E 'sub { state $s; $s = "foo"; my $c = $s; print $s}->()'
foo
Comment 25 Pascal Terjan 2015-01-06 23:59:10 CET
perl with the patch and stage 2 uploaded
Comment 26 Anne Nicolas 2015-01-07 20:11:54 CET
Tested in temporary iso. Confirmed it's now fixed

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