Error with MariaDB 10.1.41 (Debian 9.10): list of wikis not shown

mariadb
debian
#1

I just updated my Debian server on which XWiki is running to 9.10, and afterwards the list of wikis in the Wiki Index is empty. Instead an error message is shown in the log like:

2019-09-07 22:31:21,375 [https://wiki.green-meadows.de/xwiki/bin/get/WikiManager/WikisLiveTableResults?outputSyntax=plain&transprefix=platform.wiki.browse.&classname=XWiki.XWikiServerClass&collist=wikiprettyname%2Cdescription%2Cowner%2Cdoc.creationDate%2CmembershipType&queryFilters=currentlanguage%2Chidden&offset=1&limit=12&reqNo=4711&sort=description&dir=asc] WARN  o.h.u.JDBCExceptionReporter    - SQL Error: 1054, SQLState: 42S22 
2019-09-07 22:31:21,375 [https://wiki.green-meadows.de/xwiki/bin/get/WikiManager/WikisLiveTableResults?outputSyntax=plain&transprefix=platform.wiki.browse.&classname=XWiki.XWikiServerClass&collist=wikiprettyname%2Cdescription%2Cowner%2Cdoc.creationDate%2CmembershipType&queryFilters=currentlanguage%2Chidden&offset=1&limit=12&reqNo=4711&sort=description&dir=asc] ERROR o.h.u.JDBCExceptionReporter    - Unknown column 'dbstringli2_.XWL_ID' in 'where clause' 

This worked before with MariaDB 10.1.38. The XWiki version is 10.11.9, but I guess the problem does not depend on the XWiki version.

I will investigate further and let you know if I find out more, but for now I can only advise against updating your Debian servers to 9.10 (likely 10.1 has the same issue, but I have not tried this).

0 Likes

#2

After some debugging I am quite sure it is a bug in the version of MariaDB.

A workaround to prevent this error is to paste the following code into the velocity macro the page WikiManager.WikisLiveTableResultsMacros:

#macro(gridresultwithfilter_buildJSON $className $collist $filterfrom $filterwhere $filterParams $map)
  #gridresultwithfilter_buildQuery($className $collist $filterfrom $filterwhere $filterParams)
  #set($discard = $map.put('reqNo', $mathtool.toInteger($request.reqNo)))
  #gridresult_buildRowsJSON($map)
#end

This helps because it overwrites a macro from the livetable that also tries to fetch tags for the results (I did not check why), and the error comes out of the tag plugin:

Caused by: com.xpn.xwiki.XWikiException: Error number 0 in 3: Failed to get tag count for query [select elements(prop.list) from XWikiDocument as doc, BaseObject as tagobject, DBStringListProperty as prop, BaseObject as obj , LargeStringProperty prop_dtable  where tagobject.name=doc.fullName and tagobject.className='XWiki.TagClass' and tagobject.id=prop.id.id and prop.id.name='tags' and doc.translation=0 and obj.name=doc.fullName and obj.className = ? and doc.fullName <> ?  and obj.id=prop_dtable.id.id and prop_dtable.name = ?  and doc.name IN ('XWikiServerXwiki','XWikiServerTestwiki','XWikiServerMargarettingtye')], with parameters [[XWiki.XWikiServerClass, XWiki.XWikiServerClassTemplate, description]]
at com.xpn.xwiki.plugin.tag.TagQueryUtils.getTagCountForQuery(TagQueryUtils.java:133)
at com.xpn.xwiki.plugin.tag.TagPlugin.getTagCountForQuery(TagPlugin.java:293)
at com.xpn.xwiki.plugin.tag.TagPluginApi.getTagCountForQuery(TagPluginApi.java:157)
at sun.reflect.GeneratedMethodAccessor625.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
... 206 more

Of course this is not a fix, and the problem should reappear in other livetables. (The document index seems to work just fine, however.)

One can reproduce the issue with a minimal SQL for the XWiki DB like:

SELECT xwikilistitems.XWL_NAME
  FROM 
  xwikilists,
  xwikilistitems
  cross join xwikiobjects
  cross join xwikilargestrings
 WHERE 
   xwikilists.XWL_ID=xwikilistitems.XWL_ID 
LIMIT 1

which makes no sense whatever but also shows the error message Unknown column 'xwikilists.XWL_ID' in 'where clause'

Another reason why I think it is a MariaDB bug is that the following query:

SELECT a.id  FROM  a, b cross join c cross join d;

with some dummy tables containing just an id column also triggers an error with mariaDB 10.1.41, but not with 10.1.38

Edit: I send a bug report to the MariaDB issue tracker and downgraded my MariaDB server with:

# apt-get  install mariadb-server-10.1=10.1.37-0+deb9u1 mariadb-server-core-10.1=10.1.37-0+deb9u1
# apt-mark hold mariadb-server-10.1 mariadb-server-core-10.1 mariadb-server

I guess I will keep it that way instead of trying to work around the problem on the XWiki side, and I hope the issue will be fixed soon.

Edit 2: the MariaDB developers responded that my bug report was a duplicate and that the issue has been fixed in 10.1.42 (and all other affected versions). For the Debian distribution we probably have to wait until the next security update (at least for Debian9 aka stretch).

0 Likes

#3

Another possibility: looks like they provide various custom repositories which are probably more up to date than the standard Debian ones. See https://downloads.mariadb.org/mariadb/repositories/.

0 Likes