This question about Installation of Foswiki, Configuration: Task filed

FoswikiAuxMuteOut

Hi,

I am trying to install Foswiki on Windows 10.,Foswiki release is : 2.1.3, I was trying to configure Mail by going to url /foswiki/bin/configure ,

clicking on to Mail -> Basic Settings & Auto-Configure.

When I click on to autoconfigure button in Webmaster Email, I am getting below error:


Failed to load wizard Foswiki::Configure::Wizards::AutoConfigureEmail: Can't locate Foswiki/Aux/MuteOut.pm in @INC (you may need to install the Foswiki::Aux::MuteOut module) (@INC contains: C:/www/foswiki/lib C:/Perl64/site/lib C:/Perl64/lib . C:/www/foswiki/lib/CPAN/lib) at C:/www/foswiki/lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm line 17.

at C:/www/foswiki/lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm line 17.<br /> Foswiki::Configure::Wizards::AutoConfigureEmail::BEGIN() called at C:/www/foswiki/lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm line 17<br /> eval {...} called at C:/www/foswiki/lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm line 17<br /> require Foswiki/Configure/Wizards/AutoConfigureEmail.pm called at (eval 685) line 2<br /> eval 'require Foswiki::Configure::Wizards::AutoConfigureEmail' called at C:/www/foswiki/lib/Foswiki/Configure/Wizard.pm line 57<br /> Foswiki::Configure::Wizard::loadWizard("AutoConfigureEmail", HASH(0x38cfec8)) called at C:/www/foswiki/lib/Foswiki/Configure/Query.pm lin

Could you please suggest how to rectify this issue?

-- FahadOzair - 08 Oct 2017

I'm not sure what is going on here. What version and distribution of Perl is installed? Strawberry? ActiveState? Also what web server are you running.

Please make sure that C:/www/foswiki/lib/Foswiki/Aux/MuteOut.pm exists. It is shipped with Foswiki, so it should exist.

-- GeorgeClark - 09 Oct 2017

Thanks a lot for your reply. Please find below the details: Perl 5, version - 24, subversion - 1 (ActiveState) Running on Apache/2.4.25 (Win 64) I did not find Aux Folder within "C:/www/foswiki/lib/Foswiki/". It seems this folder was missing from the Foswiki release which I have downloaded. Let me try to download latest Foswiki release and see if this folder exists in that. Will copying "Aux/MuteOut.pm" from latest release be sufficient or do I need to execute some command after copying it.

-- FahadOzair - 10 Oct 2017

I downloaded Foswiki-2.1.4.zip from foswiki.org, but when I try to unzip it , I am getting below error C:\Foswiki-2.1.4.zip: Cannot create Foswiki-2.1.4\lib\Foswiki\Aux\MuteOut.pm ! The system cannot find the path specified.

-- FahadOzair - 10 Oct 2017

That is really strange. Is there any chance your local system or anti-virus is blocking creation of that directory or path? I've unzipped the file here and it expands fine:

 unzip ../building/Foswiki-2.1.4.zip 
Archive:  ../building/Foswiki-2.1.4.zip
   creating: Foswiki-2.1.4/
   creating: Foswiki-2.1.4/pub/
...
  inflating: Foswiki-2.1.4/lib/Foswiki/Serialise.pm  
   creating: Foswiki-2.1.4/lib/Foswiki/Aux/
  inflating: Foswiki-2.1.4/lib/Foswiki/Aux/MuteOut.pm  
  inflating: Foswiki-2.1.4/lib/Foswiki/Attrs.pm  
  inflating: Foswiki-2.1.4/lib/Foswiki/MetaCache.pm  
...

Did any other files during the unzip fail to expand? You can try manually downloading Aux\MuteOut.pm from https://raw.githubusercontent.com/foswiki/distro/FoswikiRelease02x01x04/core/lib/Foswiki/Aux/MuteOut.pm

-- GeorgeClark - 10 Oct 2017

Googled it out and found we can not create any folder by name "AUX" in Windows. I think this is the reason why unzipping was getting failed and hence unable to place MuteOut.pm file in this directory.

Any suggestions on this. Do I need to change the folder name Aux to something different and change in all the files where ever referenced.

-- FahadOzair - 11 Oct 2017

Yikes. You can tell that we don't do windows much here. That file was added in Foswiki 2.1.3. It's only used in 1 place that I can find: lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm. So you could rename it to Auxil, and then in 2 files, you need to change all ::Aux to ::Auxil

Here is the "diff" of the changes:

  • lib\Foswiki\Auxil\MuteOut.pm
--- a/core/lib/Foswiki/Auxil/MuteOut.pm
+++ b/core/lib/Foswiki/Auxil/MuteOut.pm
@@ -1,12 +1,12 @@
 # See bottom of file for license and copyright information
 
-package Foswiki::Aux::MuteOut;
+package Foswiki::Auxil::MuteOut;
 use strict;
 use warnings;
 
 =begin TML
 
----+!! Package Foswiki::Aux::MuteOut
+---+!! Package Foswiki::Auxil::MuteOut
 
 Very simplistic redirection of STDERR/STDOUT.
 
@@ -16,7 +16,7 @@ Simply avoid any output:
 
-use Foswiki::Aux::MuteOut;
+use Foswiki::Auxil::MuteOut;
 
 sub proc {
     my ($dir) = @_;
@@ -25,7 +25,7 @@ sub proc {
     print STDERR "RC=", $rc;
 }
 
-my $mute = Foswiki::Aux::MuteOut->new;
+my $mute = Foswiki::Auxil::MuteOut->new;
 
 # Nothing will be displayed by proc()
 $mute->exec(\&proc, "/etc");
@@ -34,7 +34,7 @@ $mute->exec(\&proc, "/etc");
 Capture output into files:
 
-my $capture = Foswiki::Aux::MuteOut->new(
+my $capture = Foswiki::Auxil::MuteOut->new(
     outFile => 'stdout.txt',
     errFile => 'stderr.txt',
 );
@@ -63,18 +63,18 @@ sub new {
       ( defined $params{errFile} ) ? $params{errFile} : File::Spec->devnull;
 
     unless ( open $oldOut, ">&", STDOUT ) {
-        Foswiki::Aux::Dependencies::_msg( "Cannot dup STDOUT: " . $! );
+        Foswiki::Auxil::Dependencies::_msg( "Cannot dup STDOUT: " . $! );
         return undef;
     }
     unless ( open $oldErr, ">&", STDERR ) {
-        Foswiki::Aux::Dependencies::_msg( "Cannot dup STDERR: " . $! );
+        Foswiki::Auxil::Dependencies::_msg( "Cannot dup STDERR: " . $! );
         return undef;
     }
     unless ( open STDOUT, ">", $outFile ) {
-        Foswiki::Aux::Dependencies::_msg( "Failed to redirect STDOUT: " . $! );
+        Foswiki::Auxil::Dependencies::_msg( "Failed to redirect STDOUT: " . $! );
     }
     unless ( open STDERR, ">", $errFile ) {
-        Foswiki::Aux::Dependencies::_msg( "Failed to redirect STDERR: " . $! );
+        Foswiki::Auxil::Dependencies::_msg( "Failed to redirect STDERR: " . $! );
     }
 
     my $obj = bless {
@@ -110,10 +110,10 @@ sub DESTROY {
     my $this = shift;
 
     unless ( open STDOUT, ">&", $this->{oldOut} ) {
-        Foswiki::Aux::Dependencies::_msg( "Failed to restore STDOUT: " . $! );
+        Foswiki::Auxil::Dependencies::_msg( "Failed to restore STDOUT: " . $! );
     }
     unless ( open STDERR, ">&", $this->{oldErr} ) {
-        Foswiki::Aux::Dependencies::_msg( "Failed to restore STDERR: " . $! );
+        Foswiki::Auxil::Dependencies::_msg( "Failed to restore STDERR: " . $! );
     }
 }
 

  • lib\Foswiki\Configure\Wizards\AutoConfigureEmail.pm
diff --git a/core/lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm b/core/lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm
index 4f7903f..fdb33e0 100644
--- a/core/lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm
+++ b/core/lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm
@@ -14,7 +14,7 @@ use strict;
 use warnings;
 
 use Foswiki::Configure::Wizard ();
-use Foswiki::Aux::MuteOut      ();
+use Foswiki::Auxil::MuteOut      ();
 use File::Temp                 ();
 
 our @ISA = ('Foswiki::Configure::Wizard');
@@ -114,7 +114,7 @@ sub _muteExec {
 
     {
         # Don't try to capture STDERR on FastCGI systems. it won't work.
-        my $muter = Foswiki::Aux::MuteOut->new(
+        my $muter = Foswiki::Auxil::MuteOut->new(
             outFile  => $outFile,
             errFile  => $errFile,
             reporter => $reporter,

Changing this to needing follow-up in tasks.

-- GeorgeClark - 11 Oct 2017

Created Tasks.Item14515 Thanks for the report and the solution!

-- GeorgeClark - 11 Oct 2017

Once again Thanks a lot for your Help and Support. I changed the folder name to Auxil and made the necessary changes in both the files as suggested. Now I am not getting this Error message and it seems to be working fine.

-- FahadOzair - 12 Oct 2017
 

QuestionForm edit

Subject Installation of Foswiki, Configuration
Extension
Version Foswiki 2.1.3
Status Task filed
Related Topics Tasks.Item14515
Topic revision: r8 - 12 Oct 2017, FahadOzair
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