Project

General

Profile

Actions

Bug #5561

closed

Got a SQL error when click TPC workflows or TPC link on sanparks skin

Added by Jing Tao over 12 years ago. Updated over 12 years ago.

Status:
Resolved
Priority:
Normal
Category:
metacat
Target version:
Start date:
12/02/2011
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
5561

Description

Clicked TPC status, I saw:

knb 20111202-10:30:51: [ERROR]: DBQuery.createResultDocument - SQL Error: The column index is out of range: 17, number of columns: 16. [edu.ucsb.nceas.metacat.DBQuery] on tomcat log.

Clicked TPC Workflows, I saw:
knb 20111202-10:31:36: [ERROR]: DBQuery.createResultDocument - SQL Error: The column index is out of range: 23, number of columns: 22. [edu.ucsb.nceas.metacat.DBQuery]

Actions #1

Updated by Jing Tao over 12 years ago

actually, it is not only for the sanpark skin. This query will cause same issue:

<pathquery version="1.2">
<querytitle>Untitled-Search-1</querytitle>
<returndoctype>eml://ecoinformatics.org/eml-2.0.0</returndoctype>
<returndoctype>eml://ecoinformatics.org/eml-2.0.1</returndoctype>
<returndoctype>eml://ecoinformatics.org/eml-2.1.0</returndoctype>
<returnfield>dataset/title</returnfield>
<returnfield>originator/individualName/surName</returnfield>
<returnfield>keyword</returnfield>
<returnfield>/eml/@packageId</returnfield>
<returnfield>/eml/dataset/access/@authSystem</returnfield>
<returnfield>/eml/dataset/access/@order</returnfield>
<querygroup operator="INTERSECT">
<queryterm searchmode="contains" casesensitive="false">
<value>%</value>
<pathexpr>title</pathexpr>
</queryterm>
</querygroup>
</pathquery>

Actions #2

Updated by Jing Tao over 12 years ago

i added a printStatckTrace statement and it gave me this:
at org.postgresql.core.v3.SimpleParameterList.bind(SimpleParameterList.java:38)
at org.postgresql.core.v3.SimpleParameterList.setStringParameter(SimpleParameterList.java:72)
at org.postgresql.jdbc2.AbstractJdbc2Statement.bindString(AbstractJdbc2Statement.java:2029)
at org.postgresql.jdbc2.AbstractJdbc2Statement.setString(AbstractJdbc2Statement.java:1159)
at org.postgresql.jdbc2.AbstractJdbc2Statement.setString(AbstractJdbc2Statement.java:1149)
at edu.ucsb.nceas.metacat.DBQuery.setPreparedStatementValues(DBQuery.java:1481)
at edu.ucsb.nceas.metacat.DBQuery.addReturnfield(DBQuery.java:1279)
at edu.ucsb.nceas.metacat.DBQuery.handleSubsetResult(DBQuery.java:951)
at edu.ucsb.nceas.metacat.DBQuery.findResultDoclist(DBQuery.java:852)
at edu.ucsb.nceas.metacat.DBQuery.createResultDocument(DBQuery.java:523)
at edu.ucsb.nceas.metacat.DBQuery.findDocuments(DBQuery.java:400)
at edu.ucsb.nceas.metacat.DBQuery.findDocuments(DBQuery.java:314)
at edu.ucsb.nceas.metacat.MetacatHandler.handleSQuery(MetacatHandler.java:491)
at edu.ucsb.nceas.metacat.MetaCatServlet.handleGetOrPost(MetaCatServlet.java:856)
at edu.ucsb.nceas.metacat.MetaCatServlet.doPost(MetaCatServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)

Actions #3

Updated by Jing Tao over 12 years ago

Okay. It turned out the query on comment 2 does work.

Actions #4

Updated by Jing Tao over 12 years ago

The pathquery doesn't work:
<pathquery version='1.2'><returndoctype>http://www.kepler-project.org/kar-2.0.0&lt;/returndoctype&gt;&lt;returndoctype&gt;http://www.kepler-project.org/kar-2.1.0&lt;/returndoctype&gt;&lt;returnfield&gt;karEntry/karEntryXML/entity/@name&lt;/returnfield&gt;&lt;returnfield&gt;karEntry/karEntryXML/entity/property[@name='KeplerDocumentation']/property[@name='author']/configure&lt;/returnfield&gt;&lt;returnfield&gt;karEntry/karEntryXML/entity/property[@name='KeplerDocumentation']/property[@name='description']/configure&lt;/returnfield&gt;&lt;returnfield&gt;karEntry/karEntryXML/entity/property[@name='KeplerDocumentation']/property[@name='createDate']/configure&lt;/returnfield&gt;&lt;returnfield&gt;karEntry/karEntryXML/entity/property[@name='KeplerDocumentation']/property[@name='workflowId']/configure&lt;/returnfield&gt;&lt;returnfield&gt;mainAttributes/lsid&lt;/returnfield&gt;&lt;returnfield&gt;karEntry/karEntryXML/entity/property[@name='entityId']/@value&lt;/returnfield&gt;&lt;returnfield&gt;karEntry/karEntryXML/property[@name='WorkflowRun']/@class&lt;/returnfield&gt;&lt;querygroup operator='INTERSECT'></querygroup></pathquery>

It also has some warning:
02 Dec 15:59:16 WARN [metacat.QueryTerm] - predicate2SQL():
02 Dec 15:59:16 WARN [metacat.QueryTerm] - Invalid or unsupported predicate: @name=''KeplerDocumentation''
02 Dec 15:59:16 WARN [metacat.QueryTerm] - predicate2SQL():
02 Dec 15:59:16 WARN [metacat.QueryTerm] - Invalid or unsupported predicate: @name=''KeplerDocumentation''
02 Dec 15:59:16 WARN [metacat.QueryTerm] - predicate2SQL():
02 Dec 15:59:16 WARN [metacat.QueryTerm] - Invalid or unsupported predicate: @name=''KeplerDocumentation''
02 Dec 15:59:16 WARN [metacat.QueryTerm] - predicate2SQL():
02 Dec 15:59:16 WARN [metacat.QueryTerm] - Invalid or unsupported predicate: @name=''KeplerDocumentation''
02 Dec 15:59:16 WARN [metacat.QueryTerm] - predicate2SQL():
02 Dec 15:59:16 WARN [metacat.QueryTerm] - Invalid or unsupported predicate: @name=''entityId''
02 Dec 15:59:16 WARN [metacat.QueryTerm] - predicate2SQL():
02 Dec 15:59:16 WARN [metacat.QueryTerm] - Invalid or unsupported predicate: @name=''WorkflowRun''

Actions #5

Updated by Jing Tao over 12 years ago

The sql statement is:
select xml_nodes.docid, xml_index.path, xml_nodes.nodedata, xml_nodes.parentnodeid, xml_nodes.nodetype FROM xml_index, xml_nodes WHERE ( (xml_index.nodeid=xml_nodes.parentnodeid AND xml_index.path IN ( ?, ? , ? ) AND xml_nodes.nodetype = 'TEXT')) AND xml_nodes.docid in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) UNION select xml_nodes.docid, ? as path, xml_nodes.nodedata, xml_nodes.parentnodeid, xml_nodes.nodetype from xml_nodes where AND xml_nodes.docid in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) UNION select xml_nodes.docid, ? as path, xml_nodes.nodedata, xml_nodes.parentnodeid, xml_nodes.nodetype from xml_nodes where AND xml_nodes.docid in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) UNION select xml_nodes.docid, ? as path, xml_nodes.nodedata, xml_nodes.parentnodeid, xml_nodes.nodetype from xml_nodes where AND xml_nodes.docid in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) UNION select xml_nodes.docid, ? as path, xml_nodes.nodedata, xml_nodes.parentnodeid, xml_nodes.nodetype from xml_nodes where AND xml_nodes.docid in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) UNION select xml_nodes.docid, ? as path, xml_nodes.nodedata, xml_nodes.parentnodeid, xml_nodes.nodetype from xml_nodes where AND xml_nodes.docid in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) UNION select xml_nodes.docid, ? as path, xml_nodes.nodedata, xml_nodes.parentnodeid, xml_nodes.nodetype from xml_nodes where AND xml_nodes.docid in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)

Actions #6

Updated by Jing Tao over 12 years ago

The parameterValues is:
[karEntry/karEntryAttributes/tpcStatus, mainAttributes/lsid, karEntry/karEntryAttributes/Name, karEntry/karEntryXML/property[@name=''WorkflowRun'']/property[@name=''user'']/@value, karEntry, karEntryXML, property, karEntry/karEntryXML/property[@name=''WorkflowRun'']/property[@name=''description'']/@value, karEntry, karEntryXML, property, karEntry/karEntryXML/property[@name=''WorkflowRun'']/property[@name=''startTime'']/@value, karEntry, karEntryXML, property, karEntry/karEntryXML/property[@name=''WorkflowRun'']/property[@name=''workflowLSID'']/@value, karEntry, karEntryXML, property, karEntry/karEntryXML/property[@name=''WorkflowRun'']/property[@name=''workflowName'']/@value, karEntry, karEntryXML, property, karEntry/karEntryXML/property[@name=''WorkflowRun'']/@class, karEntry, karEntryXML, property, 6838.64, 6838.75, 6838.87, 6838.99, 6915.11, 6952.11, 6952.23, 6952.35, 6952.47, 6952.59, 6952.71, 6952.83, 6952.95, 6952.107, 6952.122, 6952.134, 6952.146, 6952.158, 6952.170, 6952.182, 6952.194, 6952.206, 6952.227, 6952.228, 7182.29, 7182.41, 7182.53, 7182.84, 7182.96, 7182.108, 7182.120, 7182.132, 7182.144, 7182.156, 7182.177, 7182.178, 7182.199, 7182.202, 7182.216, 7182.233, 7182.242, 7182.252, 7182.273, 7182.274, 7182.288, 7182.300, 7182.312, 7182.324, 7182.336, 7182.357, 7182.358, 7182.381, 7182.382, 7182.396, 7182.408, 7182.420, 7182.432, 7182.444, 7182.456, 7182.468, 7182.480, 7182.492, 7182.512, 7182.513, 7182.529, 7182.539, 7182.559, 7182.561, 7182.575, 7182.587, 7182.599, 7182.611, 7182.623, 7182.635, 7182.647, 7182.659, 7338.11, 7338.24, 7338.37, 7363.12, 7363.23, 7363.30, 7363.37, 7363.44, 7363.51, 7363.63, 7363.75, 7363.95, 7363.107, 7363.119, 7428.11, 7428.24, 7428.36, 7428.48, 7428.60, 7428.72, 7428.84, 7428.96, 7428.108, 7428.120, 7428.137, 7428.144, 7428.156, 7428.168, 7428.180, 7428.192, 7428.204, 7428.216, 7428.228, 7428.240, 7428.252, 7428.264, 7428.279, 7428.292, 7428.305, 7428.321, 7428.339, 7428.352, 7428.367, 7447.11, 7447.23, 7447.39, 7447.51, 7448.14, 7448.26, 7455.11, 7455.27, 7455.43, 7455.64, 7455.65, 7455.84, 7464.11, 7464.29, 7464.36, 7464.84, 7464.96, 7464.118, 7464.137, 7464.149, 7464.161, 7464.173, 7464.185, 7464.224, 7464.236, 7464.261, 7464.278, 7464.291, 7464.303, 7464.315, 7464.328, 7504.11, 7504.24, 7504.36, 7504.48, 7504.61, 7504.74, 7504.87, 7504.99, 7504.111, 7504.123, 7504.135, 7643.20, 7643.32, 7643.45, 7643.57, 7643.69, 7643.81, 7643.93, 7643.105, 7643.117, 7643.129, 7643.141, 7643.153, 7859.11, 7859.23, 7859.35, 7859.47, 7859.71, 7859.83, 7859.95, 7859.107, 7859.119, 7859.131, 7859.143, 7859.155, 7859.167, 7859.179, 7859.191, 7859.215, 8465.26]

Actions #7

Updated by ben leinfelder over 12 years ago

One problem was that the predicate expression was incorrectly escaping the predicate quotes -- now that they are prepared statement parameters, all the escaping is done for us.

Another problem was that when I took out the use of docid values directly in the sql, I neglected to put their values in the parameter value list in the correct location (and in some cases they were completely omitted) -- this should be fixed now and docid values are in the list for each and every place holder (?).

Jing -- please update and try on your system. I only used one document (karxml from your server, docid=6838.47.1)
Thanks!

Actions #8

Updated by Jing Tao over 12 years ago

Hi, Ben:

I just tried and the sql error has gone. Thanks!

However, it seems that all worklfow and run kar files are shown on the workflow link, nothing is on the workflow run link. Maybe this is because the predicate expression issue you mentioned. I am going to take a look.

Actions #9

Updated by ben leinfelder over 12 years ago

Jing says it's fixed!

Actions #10

Updated by Redmine Admin over 11 years ago

Original Bugzilla ID was 5561

Actions

Also available in: Atom PDF