You are here: Foswiki>Tasks Web>Item14315 (31 Jan 2018, GeorgeClark)Edit Attach

Item14315: ASSERT in Meta.pm when viewing prior revisions of topics with attachments.

pencil
Priority: Urgent
Current State: Closed
Released In: 2.1.3
Target Release: patch
Applies To: Engine
Component: PatternSkin, QUERY
Branches: master Release02x01 Item14288 Item14380 Item14537
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
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:

  1. The topicattachtables.pattern.tmpl was using QUERY to get the attachment count without specifying the rev. This caused two issues:
    1. The count was wrong for older rev's with fewer attachments
    2. It was reloading the current topic object with the latest rev.
  2. 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
 

ItemTemplate edit

Summary ASSERT in Meta.pm when viewing prior revisions of topics with attachments.
ReportedBy GeorgeClark
Codebase 2.1.3 beta2, 2.1.3 beta1, 2.1.2, 2.1.1, 2.1.0, trunk
SVN Range
AppliesTo Engine
Component PatternSkin, QUERY
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:54c394fad3a6 distro:e85d6378e992
TargetRelease patch
ReleasedIn 2.1.3
CheckinsOnBranches master Release02x01 Item14288 Item14380 Item14537
trunkCheckins
masterCheckins distro:54c394fad3a6 distro:e85d6378e992
ItemBranchCheckins distro:54c394fad3a6 distro:e85d6378e992
Release02x01Checkins distro:e85d6378e992
Release02x00Checkins
Release01x01Checkins
Topic revision: r8 - 31 Jan 2018, GeorgeClark
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