[Pdx-pm] Why did this "force install" fix Kwiki?

Keith Lofstrom keithl at kl-ic.com
Sat Nov 10 12:48:51 PST 2007

This morning, I woke to the news that my kwiki wikis were not working.  
When I accessed them, the browser coughed up (with appropriate Bill the
Cat "Ack Pft" hairball noises):

> ----------
> Software error:
> Undefined subroutine &Scalar::Util::weaken called at (eval 27) line 4.
>  at lib/Spoon/Base.pm line 89
> 	Spoon::Base::__ANON__('Undefined subroutine &Scalar::Util::weaken called at
> (eval 27...') called at (eval 27) line 4
> 	Spiffy::__ANON__('Kwiki::Hub=HASH(0x82bcc48)', 'Kwiki=HASH(0x827205c)')
> called at lib/Spoon/Boot/Base.pm line 26
> 	Spoon::Boot::Base::init('Kwiki::Boot::V1=HASH(0x8237bd0)') called at
> lib/Spoon/Boot/Base.pm line 9
> 	Spoon::Boot::Base::new('Kwiki::Boot::V1') called at lib/Kwiki/Boot.pm line
> 5
> 	Kwiki::Boot::boot('Kwiki::Boot') called at
> /home/www/dirvish/cgi-bin/kwiki/index.cgi line 4
> For help, please send mail to the webmaster (root at localhost), giving this
> error message and the time and date of the error.
> ----------

I found that some automated updates had touched Scalar/Util.pm on Nov 8, but
the actual text of the code had not changed from preceding backups.  (And yes,
when something breaks, it is great to have some previous backups to diff and
look for the changes that break things!)

I frobbed on the kwiki code for a while - it is difficult to tell from the error
message what the problem really was, except that kwiki could find the weaken
subroutine ( which was in /usr/lib/perl5/5.8.8/Scalar/Util.pm , where it 
belonged ).  The technique that actually fixed it was forced reloading of
the Scalar::Util and Spiffy modules :

perl -MCPAN -e shell
cpan> force install Spiffy
cpan> force install Scalar::Util
cpan> quit

I don't really understand why that worked, but it did.  The force
install of Spiffy may have been unnecessary.  Unforced install did not
update/repair/replace the code, just said it was up to date.  Which it
obviously wasn't, if a force install fixes things.

SO, THE QUESTIONS:  Next time this happens, what clues in the error
message will lead me more directly to a fix?  The "force install"
technique seems lame and cargo-cultish.  Is there a better way?   Is
there a collection of dimwit-level cookbook techniques I should be
following when kwiki emits stuff like this?

Or should I just move on, thank my lucky stars, and replace Kwiki with
Python-based MoinMoin when I get some time?  :-/

BTW, part of the reason I post this here is to make a public record of
the fix so Google can find it, and so other sufferers can find both the
fix and your outraged opinions of it ...


Keith Lofstrom          keithl at keithl.com         Voice (503)-520-1993
KLIC --- Keith Lofstrom Integrated Circuits --- "Your Ideas in Silicon"
Design Contracting in Bipolar and CMOS - Analog, Digital, and Scan ICs

More information about the Pdx-pm-list mailing list