This question about Using an extension: Task filed

can't uninstall faulty extension - better command-line docs needed

There's a lot of content here, both because I think I stumbled from one problem into another, and because I thought it might be useful. The basics:
  • debian 5.0 "lenny", apache 2.2.9-10+lenny9, libapache2-mod-fastcgi 2.4.6-1, perl 5.10.0-19lenny3
  • My first priority is to (know how to) safely uninstall an extension when /wiki/bin/configure is unreachable
  • My second priority is to improve (create?) documentation on the "command line interface" that is referenced at InstallationGuide but I couldn't find any sign of
  • Additionally, it looks like there may be some cleanup/bugfixes to be done with X509UserPlugin and possibly DEPENDENCIES info for TinyMCEPlugin and WysiwygPlugin - should this be split into a separate Question? or separate bug-tracking Task?
I've been testing X509UserPlugin, just to see if it would work at our site (we don't care to turn on SSLOptions +FakeBasicAuth which is listed as required). It never expanded the variables as advertised, so I figured it was time to uninstall.

Pointing my browser at https://TESTSITE/wiki/bin/configure (the URL works; used to install the plugin) gives:

Software error:

TemplateParser could not be loaded:Insecure dependency in require while running with -T switch at (eval 411) line 2.
BEGIN failed--compilation aborted at (eval 411) line 2.

Looking in the server's error logs, I see the following lines corresponding to that page load:

[Wed Apr 06 16:23:32 2011] [error] [client NNN.NN.NN.NNN] Unexpected errors attempting to determine version of dependency, referer: https://TESTSITE/wiki/bin/configure
[Wed Apr 06 16:23:32 2011] [error] [client NNN.NN.NN.NNN] Bareword "SystemWebName" not allowed while "strict subs" in use at /var/www/wiki/lib/Foswiki/Plugins/X509UserPlugin.pm line 217., referer: https://TESTSITE/wiki/bin/configure
[Wed Apr 06 16:23:32 2011] [error] [client NNN.NN.NN.NNN] Compilation failed in require at (eval 371) line 3., referer: https://TESTSITE/wiki/bin/configure
[Wed Apr 06 16:23:32 2011] [error] [client NNN.NN.NN.NNN] , referer: https://TESTSITE/wiki/bin/configure
[Wed Apr 06 16:23:32 2011] [error] [client NNN.NN.NN.NNN] Warning: TinyMCEPlugin has badly formatted date in DEPENDENCIES: 1.1.7, referer: https://TESTSITE/wiki/bin/configure
[Wed Apr 06 16:23:32 2011] [error] [client NNN.NN.NN.NNN] Warning: WysiwygPlugin has badly formatted date in DEPENDENCIES: 1.1.1, referer: https://TESTSITE/wiki/bin/configure
[Wed Apr 06 16:23:32 2011] [error] [client NNN.NN.NN.NNN] [Wed Apr  6 16:23:32 2011] configure: TemplateParser could not be loaded:Insecure dependency in require while running with -T switch at (eval 411) line 2., referer: https://TESTSITE/wiki/bin/configure
[Wed Apr 06 16:23:32 2011] [error] [client NNN.NN.NN.NNN] [Wed Apr  6 16:23:32 2011] configure: BEGIN failed--compilation aborted at (eval 411) line 2., referer: https://TESTSITE/wiki/bin/configure

The InstallationGuide only says "The web and command line interfaces can also be used to uninstall extensions" before launching into a technical discussion of what should happen behind the scenes. Specifically, there is no description or link to instructions of what the "command line interface(s)" actually are.

Searching the site, neither the "Command-line" nor "Tool scripts" sections of CommandAndCGIScripts say anything about how to manipulate extensions from the command line. Searching previous questions, I thought Question742's description of a ${PLUGIN_NAME} _installer script might help; a couple find commands later, I tried to run (as www-data):

/var/www/wiki/bin$ perl ../working/configure/pkgdata/X509UserPlugin_installer
************************************************************
Could not load /var/www/wiki/bin/tools/extender.pl
There was a file error: No such file or directory
(if this is a TWiki release prior to 4.2, you can download this
 file from: http://twiki.org/cgi-bin/view/Codev/ExtenderScript
 and place it in
 /var/www/wiki/bin/tools
 Create the directory if necessary).
************************************************************
Could not open file using open() either: No such file or directory

I could fall back on listing the contents of X509UserPlugin.tgz and deleting them from the foswiki installation, but (a) I'd like confirmation that I wouldn't be leaving lots of loose ends in other places, and (b) I'd prefer to know the Right Way to do this, hopefully one that doesn't have a chance of fat-fingering the deletion of important files, when I upgrade our live TWiki to foswiki.


I'm not sure what is going on here.

For the issue with the cli script installer, try running the X509UserPlugin _installer script from the root foswiki directory, not from bin. The extension installers are not documented as a command or cgi script, and as you note the InstallationGuide doesn't have sufficient detail. I'll add some information for the upcoming 1.1.3. The installer is self-documented. Run it with the "usage" operand:

perl working/configure/pkgdata/X509UserPlugin_installer usage

Usage as a custom installer:

       X509UserPlugin_installer -a -n -d -r -u -c install
       X509UserPlugin_installer -a -n uninstall
       X509UserPlugin_installer manifest
       X509UserPlugin_installer dependencies

Usage as a generic installer:

       tools/extension_installer X509UserPlugin -a -n -d -r -u -c install
       tools/extension_installer X509UserPlugin -a -n uninstall
       tools/extension_installer X509UserPlugin manifest
       tools/extension_installer X509UserPlugin dependencies

If command (install, uninstall ..) is not provided, default is to 
install the extension.

Operates on the directory tree below where it is run from,
so should be run from the top level of your Foswiki installation.

Depending upon your installation, you may need to execute perl directly
  perl tools/extension_installer ...   or
  perl X509UserPlugin_installer ...

"install" will check dependencies and perform any required
post-install steps.

"uninstall" will remove all files that were installed for
X509UserPlugin even if they have been locally modified.

-a means don't prompt for confirmation before resolving
   dependencies
-d means auto-download if -a (no effect if not -a)
-r means reuse packages on disc if -a (no effect if not -a)
-u means the archive has already been downloaded and unpacked
-n means don't write any files into my current install, just
   tell me what you would have done
-c means don't try to use CPAN to install missing libraries

"manifest" will generate a list of the files in the package on
standard output. The list is generated in the same format as
the MANIFEST files used by BuildContrib.

"dependencies" will generate a list of dependencies on standard
output.

Here is the uninstall run from the root of the Foswiki installation:

 perl working/configure/pkgdata/X509UserPlugin_installer uninstall
Do you want to use locally found installer scripts and archives to install X509UserPlugin and any dependencies.
If you reply n, then fresh copies will be downloaded from this repository.? [y/n] y
Package repository set to http://foswiki.org/pub/Extensions 

 ... locally found installer scripts and archives will be used if available
Using local /var/www/foswiki/trunk/core/working/configure/pkgdata/X509UserPlugin_installer, Size: 4631 Modified: Tue Dec 23 03:54:34 2008 for package manifest 


X509UserPlugin Installer
This installer must be run from the root directory of your Foswiki
installation.

    * The script will not do anything without asking you for
      confirmation first (unless you used -a).

    * You can abort the script at any point and re-run it later
    * If you answer 'no' to any questions you can always re-run
      the script again later

Backup saved into /var/www/foswiki/trunk/core/working/configure/backup/X509UserPlugin-backup-20110406-202418 
   Archived as /var/www/foswiki/trunk/core/working/configure/backup/X509UserPlugin-backup-20110406-202418.tgz 

*WARNING*  To uninstall X509UserPlugin, the following files will be deleted:
        simulated /var/www/foswiki/trunk/core/data/Sandbox/UserRegistration.txt
        simulated /var/www/foswiki/trunk/core/data/System/X509UserPlugin.txt
        simulated /var/www/foswiki/trunk/core/lib/Foswiki/LoginManager/X509Login.pm
        simulated /var/www/foswiki/trunk/core/lib/Foswiki/Plugins/X509UserPlugin.pm
        simulated /var/www/foswiki/trunk/core/lib/Foswiki/Plugins/X509UserPlugin/Config.spec
        simulated /var/www/foswiki/trunk/core/lib/Foswiki/Users/X509PasswdUser.pm
        simulated /var/www/foswiki/trunk/core/lib/Foswiki/Users/X509UserMapping.pm
        simulated /var/www/foswiki/trunk/core/lib/Foswiki/Users/X509UserMapping/Cert.pm
        simulated /var/www/foswiki/trunk/core/working/configure/pkgdata/X509UserPlugin_installer
Are you SURE you want to uninstall X509UserPlugin? [y/n] y
Running Pre-uninstall exit for X509UserPlugin ...

 removed 9 files
Running Post-uninstall exit for X509UserPlugin ...

 X509UserPlugin uninstalled

Regarding the insecure dependency when run from the web configure interface, what version of Perl are you using?

The "badly formatted dependencies" is because the Extensions are transitioning from a "date" version identifier to a major.minor.patch version format. It's a warning that will only occur if the installed extension uses a format that is different from the latest version.

I'm not sure what is going on with the taint error. The TemplateParser has been reworked a bit for the upcoming 1.1.3, so this may have been addressed. I've not run into the issue in my testing.

-- GeorgeClark - 07 Apr 2011


Perl version, as mentioned in first bullet: perl 5.10.0-19lenny3. perl -v returns: "This is perl, v5.10.0 built for i486-linux-gnu-thread-multi"

[edit:] Ah, I missed some of your response. Please hold while I try it...

...OK. So it succeeded, and I can now load /wiki/bin/configure. It complains *Error:* Foswiki::Plugins::X509UserPlugin is enabled in LocalSite.cfg but was not found in the path, so I went ahead and removed all lines matching X509UserPlugin from lib/LocalSite.cfg.

Feature request: make the advisory note that I saw when running X509UserPlugin _installer from the correct directory, namely
X509UserPlugin Installer
This installer must be run from the root directory of your Foswiki
installation.

also show when the script is called from the wrong working directory (as opposed to the error I quoted in my original request).

Unrelated feature request: Put fuller instructions in a more prominent place about how to subscribe to a Question you've asked. Ideally, the "edit done" page for the Support web, or perhaps just the page template, would have a link like "Subscribe to this page for updates", which would perhaps expand a twisty <div> containing the instructions to copy %WIKINAME%: %TOPIC% and then paste it into WebNotify...

I'm all set; only resetting to "Asked" because I wasn't sure if Answered would hide my feature requests from you.

-- ArthurProkosch - 07 Apr 2011

Thanks. I've opened a task and updated the message in the installer. Unfortunately this is a template file that is copied into the generated _installer file when the extension is released. So every extension will have to be updated to get the new message.

Good point about the subscribe to a topic. It happens automatically in the Tasks web for bug reports, but not here in the Support web. The next major version of Foswiki will include the SubscribePlugin which makes it easy to add a subscribe button to each topic. It's already installed here so it may just need some template updates to highlight the action - I've added the subscribe button.

Note that the InstallationGuide has already been updated with improved extension installation instructions - see http://trunk.foswiki.org/System/InstallationGuidePart2#Extensions.

-- GeorgeClark - 01 Aug 2011

QuestionForm edit

Subject Using an extension
Extension X509UserPlugin
Version Foswiki 1.1.2
Status Task filed
Related Topics Tasks.Item11014
Topic revision: r6 - 01 Aug 2011, GeorgeClark - This page was cached on 17 Jan 2018 - 01:15.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License