This question about Installation of Foswiki: Task filed

getting error when running configure.pl on windows 7 with IIS running Acttivperl

I am getting error
print() on closed filehandle $fh at lib/Foswiki/Configure/Checker.pm line 374.

For help, please send mail to this site's webmaster, giving this error message and the time and date of the error.

[Wed Apr 10 16:57:47 2013] configure.pl: print() on closed filehandle $fh at lib/Foswiki/Configure/Checker.pm line 374.

I am running active state perl 5.16.3 on windows 7 with IIIS 7.5. perl is confifured to run on IIS.

Pls can you help me fix this.

Thanks,

Sudhakaran

-- SudhakaranPackianathan - 10 Apr 2013


That code is testing to make sure Foswiki can successfully create and write to a file in each directory where the running system will need to create files. For some reason the open of the file didn't succeed, but also didn't fail, so the checker crashed when it wrote to the closed file. We can't really tell which location can't be written to without a full trace showing which checker called that utility function. It looks like it's called in 3 places:
Checkers/BasicSanity.pm:        my $errs = $this->checkCanCreateFile( $this->{LocalSiteDotCfg} );
Checkers/Log/Dir.pm:    my $e = $this->checkCanCreateFile("$ld/tmp.log");
Checkers/MaxLSCBackups.pm:    my $err = $this->checkCanCreateFile($lscBackup);

These check that:
  • Configure will be able to write the LocalSite.cfg when you click save
  • Foswiki will be able to write log files
  • Configure will be able to save a configuration backup when updating a config file
If this doesn't provide any hints, you could either add some print statements to Checker.pm before the open to print out the name of the file it's about to test to STDERR, or possibly change the "return" to "die" on the open to better trap the failure.

-- GeorgeClark - 10 Apr 2013

You've discovered a bug in lib/Foswiki/Configure/Checker.pm In the following block of code, the || return 'Could not ... should change to or return 'Could not ... in two places, as shown below. ( the || changes to or )

    my $txt1 = "test 1 2 3";
    open my $fh, '>', $name
      or return 'Could not create test file ' . $name . ':' . $!;
    print $fh $txt1;
    close($fh);
    open my $in_file, '<', $name
      or return 'Could not read test file ' . $name . ':' . $!;
    my $txt2 = <$in_file>;
    close($in_file);
    unlink $name if ( -e $name );

-- GeorgeClark - 10 Apr 2013
 

QuestionForm edit

Subject Installation of Foswiki
Extension
Version Foswiki 1.1.8
Status Task filed
Related Topics Tasks.Item12471
Topic revision: r2 - 10 Apr 2013, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy