HistorianModule, The query did not return the expected dataset.Problem: Invalid number of columns

Hi Guys,

Getting error with Historian Module , while creating easy chart for the tags. Just few tags are having this issues. IOException in RemoteTagHistoryQueryExecutor.readColumnData(RemoteTagHistoryQueryExecutor.java:120)

Not sure what is causing this exceptions for few of the tags

java.lang.Exception: Error running query:
TagHistory(paths=[histprov:Ignition_Remote_IO_3:/prov:Ignition_Remote_IO_Gateway:/tag:PWC2/HRSG/2A/IP DRUM FW FLOW, histprov:Ignition_Remote_IO_3:/prov:Ignition_Remote_IO_Gateway:/tag:PWC2/HRSG/2A/HP DRUM FW FLOW], start=Wed Jun 15 11:15:00 EDT 2022, end=Wed Jun 15 11:25:59 EDT 2022, flags=0)@0ms
On: ATestDrum.Root Container.Easy Chart
	at com.inductiveautomation.factorypmi.application.gateway.QueryManager$QueryExecutor.run(QueryManager.java:311)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: The query did not return the expected dataset. Problem: Invalid number of columns
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:351)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:325)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.runTagHistoryQuery(GatewayInterface.java:780)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.runTagHistoryQuery(GatewayInterface.java:748)
	at com.inductiveautomation.factorypmi.application.gateway.GwiTagHistoryProvider.query(GwiTagHistoryProvider.java:16)
	at com.inductiveautomation.ignition.common.sqltags.history.cache.StandardCacheBucket.loadData(StandardCacheBucket.java:232)
	at com.inductiveautomation.ignition.common.sqltags.history.cache.StandardCacheBucket.getData(StandardCacheBucket.java:192)
	at com.inductiveautomation.ignition.common.sqltags.history.cache.SubCache$BucketHit.getData(SubCache.java:215)
	at com.inductiveautomation.ignition.common.sqltags.history.cache.SubCache.getData(SubCache.java:158)
	at com.inductiveautomation.ignition.common.sqltags.history.cache.TagHistoryCache.query(TagHistoryCache.java:273)
	at com.inductiveautomation.factorypmi.application.gateway.TagHistoryQuery.execute(TagHistoryQuery.java:34)
	at com.inductiveautomation.factorypmi.application.gateway.QueryManager$Query.execute(QueryManager.java:668)
	at com.inductiveautomation.factorypmi.application.gateway.QueryManager$QueryExecutor.run(QueryManager.java:308)
	... 1 more
Caused by: java.io.IOException: The query did not return the expected dataset. Problem: Invalid number of columns
	at com.inductiveautomation.ignition.gateway.sqltags.history.distributed.RemoteTagHistoryQueryExecutor.readColumnData(RemoteTagHistoryQueryExecutor.java:120)
	at com.inductiveautomation.ignition.gateway.sqltags.history.distributed.RemoteTagHistoryQueryExecutor.initialize(RemoteTagHistoryQueryExecutor.java:106)
	at com.inductiveautomation.ignition.gateway.sqltags.history.query.HistoryWriter.initLoader(HistoryWriter.java:141)
	at com.inductiveautomation.ignition.gateway.sqltags.history.query.HistoryWriter.execute(HistoryWriter.java:211)
	at com.inductiveautomation.ignition.gateway.sqltags.history.TagHistoryManagerImpl.queryHistory(TagHistoryManagerImpl.java:555)
	at com.inductiveautomation.ignition.gateway.tags.model.ProjectDefaultTagManagerFacade.queryHistory(ProjectDefaultTagManagerFacade.java:440)
	at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.QueryTagHistory.invoke(QueryTagHistory.java:99)
	at com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(Gateway.java:431)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:86)
	at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
	at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1631)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at com.inductiveautomation.catapult.handlers.RemoteHostNameLookupHandler.handle(RemoteHostNameLookupHandler.java:121)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:322)
	at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:59)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:516)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
	at java.lang.Thread.run(null)

Ignition v8.1.17 (b2022051210)
Java: Azul Systems, Inc. 11.0.15

I have been seeing this error as well. Curious what could be causing this issue.

@Naveen_Batchu, are you developing a custom module? You created this topic in the Module Development category, and it’s not clear if that’s intentional.

@tmahaf, are you developing a custom module? If not, you definitely should take your question to Support (https://support.inductiveautomation.com), rather than tagging random forum members who aren’t IA employees :slight_smile:

Yes, i have created custom historian module, currently getting this issues with some of that tags. Not sure why only few tags are having this issue rest of the tags i can see the easy chart.

So, all I can really say is that the check is failing because the number of columns returned doesn’t match the expected value. Your data is expected to have one timestamp column, and then a column per path. Figuring out which query causes the error would probably help a lot in figuring things out.