You are here: Foswiki>Tasks Web>Item12592 (06 Nov 2018, MichaelDaum)Edit Attach

Item12592: Missing DBD::SQLite not detected by configure, breaks site

pencil
Priority: Urgent
Current State: Closed
Released In: 1.2.0
Target Release: n/a
Applies To: Engine
Component: PageCache
Branches: trunk
Reported By: GeorgeClark
Waiting For:
Last Change By: MichaelDaum
If DBD::SQLite.pm is missing, configure still permits the SQLite based page cache to be enabled, and the site then fails:

  • Configure should detect and display an error if the module required for a page cache is missing.
  • The site should gracefully fail. The Error routine uses the errstr variable which is undefined if the requested DBI is missing.

Use of uninitialized value $DBI::errstr in concatenation (.) or string at /usr/home/trunk.foswiki.org/core/lib/Foswiki/PageCache/DBI.pm line 85.
 at /usr/local/lib/perl5/5.16.2/CGI/Carp.pm line 379.
   CGI::Carp::realdie('Use of uninitialized value $DBI::errstr in concatenation (.) ...') called at /usr/local/lib/perl5/5.16.2/CGI/Carp.pm line 468
   CGI::Carp::die('Use of uninitialized value $DBI::errstr in concatenation (.) ...') called at /usr/home/trunk.foswiki.org/core/lib/AssertOn.pm line 14
   Assert::__ANON__('Use of uninitialized value $DBI::errstr in concatenation (.) ...') called at /usr/home/trunk.foswiki.org/core/lib/Foswiki/PageCache/DBI.pm line 85
   Foswiki::PageCache::DBI::__ANON__('Error::Simple=HASH(0xcc7ad8)', 'SCALAR(0x732f68)') called at /usr/local/lib/perl5/site_perl/5.16.2/Error.pm line 343
   eval {...} called at /usr/local/lib/perl5/site_perl/5.16.2/Error.pm line 333
   Error::subs::run_clauses('HASH(0xcc6630)', 'install_driver(SQLite) failed: Can\'t locate DBD/SQLite.pm in...', undef, 'ARRAY(0xcc7898)') called at /usr/local/lib/perl5/site_perl/5.16.2/Error.pm line 430
   Error::subs::try('CODE(0xcc6408)', 'HASH(0xcc6630)') called at /usr/home/trunk.foswiki.org/core/lib/Foswiki/PageCache/DBI.pm line 92
   Foswiki::PageCache::DBI::init('Foswiki::PageCache::DBI::SQLite=HASH(0x6a9e30)') called at /usr/home/trunk.foswiki.org/core/lib/Foswiki/PageCache/DBI/SQLite.pm line 41
   Foswiki::PageCache::DBI::SQLite::new('Foswiki::PageCache::DBI::SQLite') called at /usr/home/trunk.foswiki.org/core/lib/Foswiki.pm line 1794
   Foswiki::new('Foswiki', undef, 'Foswiki::Request=HASH(0xafb290)', 'HASH(0xaf7a28)') called at /usr/home/trunk.foswiki.org/core/lib/Foswiki/UI.pm line 315
   Foswiki::UI::__ANON__() called at /usr/local/lib/perl5/site_perl/5.16.2/Error.pm line 419
   eval {...} called at /usr/local/lib/perl5/site_perl/5.16.2/Error.pm line 411
   Error::subs::try('CODE(0x619cd0)', 'HASH(0xb20f50)') called at /usr/home/trunk.foswiki.org/core/lib/Foswiki/UI.pm line 446
   Foswiki::UI::_execute('Foswiki::Request=HASH(0xafb290)', 'CODE(0x6783a8)', 'view', 1) called at /usr/home/trunk.foswiki.org/core/lib/Foswiki/UI.pm line 278
   Foswiki::UI::handleRequest('Foswiki::Request=HASH(0xafb290)') called at /usr/home/trunk.foswiki.org/core/lib/Foswiki/Engine/CGI.pm line 43
   Foswiki::Engine::CGI::run('Foswiki::Engine::CGI=HASH(0x8252a0)') called at /home/trunk.foswiki.org/core/bin/view line 29.


I've checked in fixes for this - avoids the crash when the module is missing, and checks the dependencies in bin/configure.

Michael, I wasn't sure how to check for DBI::Generic. Is there any such thing as DBD::Generic? Any suggestions on how that should be checked?

Also I've assumed that any Foswiki::PageCache::DBI::* will have a corresponding DBD::*, or if the module is Foswiki::PageCache::Someother::Module, then it should just check that Someother::Module exists.

In the meantime, we need Babar or someone to install DBD::SQLite on foswiki.org

-- GeorgeClark - 05 Oct 2013

No, there's no such thing as DBD::Generic. The Foswiki::PageCache::DBI::Generic class covers any other database driver that can be configured using the generic DBI interface. That is it does not require any specific page cache adapter or initializer like the existing Foswiki::PageCache::DBI::Generic::* classes.

I am not sure how to protect the admin from crashing the site by choosing a missing database driver. How do other systems deal with it?

-- MichaelDaum - 08 Oct 2013

No idea. I guess I'm more concerned with preventing what we ran into on trunk, a perl upgrade lost the driver, and the site was down. I've covered the common cased I think, so it's probably not worth going that much further with this. I don't know how DBI::Generic gets used, so no idea how to check. Unless you have some ideas for further checks, I can probably close this.

-- GeorgeClark - 08 Oct 2013

Yes, please let's close this one. It will always be possible to shoot ones own foot using configure.

As far as I know, the problems you ran into - not being able to run the cpan installer - were mostly homemade the way foswiki.org is set up in a jail without a possibility to compile or install missing requirements.

-- MichaelDaum - 09 Oct 2013
Topic revision: r10 - 06 Nov 2018, MichaelDaum
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