Priority: Urgent
Current State: Closed
Released In: 2.1.3
Target Release: patch
Recreated this on Foswiki-2.1.3-Beta2
- Create a topic in sandbox
- Upload an attachment
- Edit the topic and force a new revision.
Click history and attempt to view Rev 1. Foswiki Asserts:
Fails on both
PlainFile store and
RcsStore.
Assertion failed!
at /var/www/data/Foswiki-2.1.3-Beta2/lib/AssertOn.pm line 30.
Assert::ASSERT("") called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/Meta.pm line 444
Foswiki::Meta::load(Foswiki::Meta=HASH(0x4c09ce0)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/Macros/QUERY.pm line 45
Foswiki::QUERY(Foswiki=HASH(0x33e6970), Foswiki::Attrs=HASH(0x507a4a0), Foswiki::Meta=HASH(0x4c09ce0)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki.pm line 3549
Foswiki::_expandMacroOnTopicRendering(Foswiki=HASH(0x33e6970), "QUERY", "\"length(attachments[NOT lc(attr)=~'h'])\"", Foswiki::Meta=HASH(0x4c09ce0)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki.pm line 3411
Foswiki::_processMacros(Foswiki=HASH(0x33e6970), "<div class=\"foswikiAttachments foswikiFormStep\" style=\"overfl"..., CODE(0x3c284f8), Foswiki::Meta=HASH(0x4c09ce0), 15) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki.pm line 3429
Foswiki::_processMacros(Foswiki=HASH(0x33e6970), " %IF{\"\$raw='on'\" then='<div class=\"patternSigLine clear\"><spa"..., CODE(0x3c284f8), Foswiki::Meta=HASH(0x4c09ce0), 16) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki.pm line 3169
Foswiki::innerExpandMacros(Foswiki=HASH(0x33e6970), SCALAR(0x3c3fd58), Foswiki::Meta=HASH(0x4c09ce0)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki.pm line 3734
Foswiki::expandMacros(Foswiki=HASH(0x33e6970), " %IF{\"\$raw='on'\" then='<div class=\"patternSigLine clear\"><spa"..., Foswiki::Meta=HASH(0x4c09ce0)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/Meta.pm line 3359
Foswiki::Meta::expandMacros(Foswiki::Meta=HASH(0x4c09ce0), " %IF{\"\$raw='on'\" then='<div class=\"patternSigLine clear\"><spa"...) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/UI/View.pm line 481
Foswiki::UI::View::_prepare(" %IF{\"\$raw='on'\" then='<div class=\"patternSigLine clear\"><spa"..., Foswiki::Meta=HASH(0x4c09ce0), 0) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/UI/View.pm line 467
Foswiki::UI::View::view(Foswiki=HASH(0x33e6970)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/UI.pm line 374
Foswiki::UI::__ANON__() called at /usr/share/perl5/Error.pm line 416
eval {...} called at /usr/share/perl5/Error.pm line 408
Error::subs::try(CODE(0x259fb58), HASH(0x33e6370)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/UI.pm line 500
Foswiki::UI::_execute(Foswiki::Request=HASH(0x3c8e590), CODE(0x259fc90), "view", 1) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/UI.pm line 326
Foswiki::UI::handleRequest(Foswiki::Request=HASH(0x3c8e590)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/Engine/CGI.pm line 100
Foswiki::Engine::CGI::run(Foswiki::Engine::CGI=HASH(0x352ba60)) called at view line 28
at /var/www/data/Foswiki-2.1.3-Beta2/lib/AssertOn.pm line 30.
Assert::ASSERT("") called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/Meta.pm line 444
Foswiki::Meta::load(Foswiki::Meta=HASH(0x4c09ce0)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/Macros/QUERY.pm line 45
Foswiki::QUERY(Foswiki=HASH(0x33e6970), Foswiki::Attrs=HASH(0x507a4a0), Foswiki::Meta=HASH(0x4c09ce0)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki.pm line 3549
Foswiki::_expandMacroOnTopicRendering(Foswiki=HASH(0x33e6970), "QUERY", "\"length(attachments[NOT lc(attr)=~'h'])\"", Foswiki::Meta=HASH(0x4c09ce0)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki.pm line 3411
Foswiki::_processMacros(Foswiki=HASH(0x33e6970), "<div class=\"foswikiAttachments foswikiFormStep\" style=\"overfl"..., CODE(0x3c284f8), Foswiki::Meta=HASH(0x4c09ce0), 15) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki.pm line 3429
Foswiki::_processMacros(Foswiki=HASH(0x33e6970), " %IF{\"\$raw='on'\" then='<div class=\"patternSigLine clear\"><spa"..., CODE(0x3c284f8), Foswiki::Meta=HASH(0x4c09ce0), 16) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki.pm line 3169
Foswiki::innerExpandMacros(Foswiki=HASH(0x33e6970), SCALAR(0x3c3fd58), Foswiki::Meta=HASH(0x4c09ce0)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki.pm line 3734
Foswiki::expandMacros(Foswiki=HASH(0x33e6970), " %IF{\"\$raw='on'\" then='<div class=\"patternSigLine clear\"><spa"..., Foswiki::Meta=HASH(0x4c09ce0)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/Meta.pm line 3359
Foswiki::Meta::expandMacros(Foswiki::Meta=HASH(0x4c09ce0), " %IF{\"\$raw='on'\" then='<div class=\"patternSigLine clear\"><spa"...) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/UI/View.pm line 481
Foswiki::UI::View::_prepare(" %IF{\"\$raw='on'\" then='<div class=\"patternSigLine clear\"><spa"..., Foswiki::Meta=HASH(0x4c09ce0), 0) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/UI/View.pm line 467
Foswiki::UI::View::view(Foswiki=HASH(0x33e6970)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/UI.pm line 374
Foswiki::UI::__ANON__() called at /usr/share/perl5/Error.pm line 416
eval {...} called at /usr/share/perl5/Error.pm line 408
Error::subs::try(CODE(0x259fb58), HASH(0x33e6370)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/UI.pm line 500
Foswiki::UI::_execute(Foswiki::Request=HASH(0x3c8e590), CODE(0x259fc90), "view", 1) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/UI.pm line 326
Foswiki::UI::handleRequest(Foswiki::Request=HASH(0x3c8e590)) called at /var/www/data/Foswiki-2.1.3-Beta2/lib/Foswiki/Engine/CGI.pm line 100
Foswiki::Engine::CGI::run(Foswiki::Engine::CGI=HASH(0x352ba60)) called at view line 28.
Also happened on a fcgi system, after installing multiple versions of
PublishPlugin, access to old versions was causing the assert.
--
GeorgeClark - 31 Jan 2017
Not sure what's going on. It's failing on two test installs, one a git checkout, and the other an install of the beta. However it doesn't fail on trunk.foswiki.org. I still think we need to block the release for now.
--
GeorgeClark - 31 Jan 2017
Thanks to CDot for the description of the problem. Turns out multiple fixes were needed.
QUERY was doing a simple reload of an existing meta object to the current rev, if the "rev=" parameter was not provided. This triggered the ASSERT when the Load was issued against an already loaded object for a different rev. This could happen under a couple of conditions:
- The topicattachtables.pattern.tmpl was using QUERY to get the attachment count without specifying the rev. This caused two issues:
- The count was wrong for older rev's with fewer attachments
- It was reloading the current topic object with the latest rev.
- When QUERY was used to access
{ConfigKeys}
, it was also loading the current rev of the topic, which was completely unnecessary, and could also cause the assert.
Fix is:
- Pass the rev= URLPARAM to the QUERY macro in the attachtables. This fixes the attachment count when viewing old revisions, and avoids loading a new topic object.
- Change QUERY to load a new topic object, don't reload the existing object. This could cause all sorts of issues I suspect.
- Change QUERY to ignore the rev= parameter when querying
{ConfigKeys}
--
GeorgeClark - 31 Jan 2017