You are here: Foswiki>Tasks Web>Item9016 (19 Nov 2012, MichaelDaum)Edit Attach

Item9016: DBCacheContrib causes crash in RcsFile.pm when rest script run

pencil
Priority: Urgent
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: DBCacheContrib
Branches:
Reported By: GeorgeClark
Waiting For:
Last Change By: MichaelDaum
It appears that DBCacheContrib interprets the rest/MultiTopicSave as if it were a call to the MultiTopicSave web and attempts to list all the topics in that web.

 rest: getTopicNames failed to open /var/lib/foswiki/data/MultiTopicSavePlugin,
 rest: This is how we got here!,
 rest:  at /var/lib/foswiki/lib/Foswiki/Store/RcsFile.pm line 254,
 rest: Foswiki::Store::RcsFile::getTopicNames('Foswiki::Store::RcsWrap=HASH(0x9518148)') called at /var/lib/foswiki/lib/Foswiki/Store.pm line 1645,
 rest: Foswiki::Store::getTopicNames('Foswiki::Store=HASH(0x8866420)', 'MultiTopicSavePlugin') called at /var/lib/foswiki/lib/Foswiki/Func.pm line 1179,
 rest: Foswiki::Func::getTopicList('MultiTopicSavePlugin') called at /var/lib/foswiki/lib/Foswiki/Contrib/DBCacheContrib.pm line 594,
 rest: Foswiki::Contrib::DBCacheContrib::_updateCache('Foswiki::Plugins::DBCachePlugin::WebDB=HASH(0x952f920)', 'MultiTopicSavePlugin') called at /var/lib/foswiki/lib/Foswiki/Contrib/DBCacheContrib.pm line 48

There are several issues here
  • Func::getTopicList should not attempt to list a missing web
  • Store::getTopicNames should not use an invalid file handle if called with a invalid webname
  • DBCacheContrib should not interpret the rest script as containing a web/topic string.

Opening this as a Engine bug although it needs fixes in multiple places.

-- GeorgeClark - 13 May 2010

On the internals; I don't agree, it's not the job of Func to nursemaid extension authors. The caller should check that the web exists before attempting to list it.

MultiTopicSave is nothing to do with DBCacheContrib..... I assume you meant to target MultiTopicSavePlugin

No, intention was to target the Cache. I suspect that Any extension that implements a rest handler using the rest/function/verb syntax will cause DBCacheContrib to crash because it assumes that the function is actually a web, and the verb is a topic. Which from what I understand of rest, is never the case.

-- GeorgeClark - 30 May 2010

The issues rather are:

  • any url to foswiki is separated into three parts: (1) a script handler, (2) a web name and (3) a topic name; this also holds for the rest handler and obviously is in conflict with the way the rest handler is scheduled using a rest/plugin/endpoint triplet ... awkwardness in foswiki core

  • DBCacheContrib is trying to generate caches for non-existing webs ... not critical but annoying

  • RcsFile is trying to open a non-existing directory and dies ... critical

None of them are related to MultiTopicSavePlugin. You can work around this issue by providing an extra topic url param to the rest handler to specify the web-topic name where the handler is to be executed. This is a Best Practice for each rest handler for the reason mentioned above.

But that's only a work-around. In any case RcsFile must never die that way even when called with invalid parameter. Not sure if this error pertains in foswiki/trunk. Can anybody using MultiTopicSavePlugin + DBCacheContrib test this on trunk, please? If it still crashes RcsFile, make this bug Urgent on trunk.

-- MichaelDaum - 31 May 2010

As nobody seemed to care, I'm setting this waiting for Kenneth, who wrote MultiTopicSavePlugin. Kenneth, if you do not use DBCacheContrib, then I guess we should simply close that.

-- OlivierRaginel - 04 Jun 2011
 

ItemTemplate edit

Summary DBCacheContrib causes crash in RcsFile.pm when rest script run
ReportedBy GeorgeClark
Codebase 1.0.9
SVN Range
AppliesTo Extension
Component DBCacheContrib
Priority Urgent
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r10 - 19 Nov 2012, 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