Reporting - object has no attribute 'setReadTimeout'

#1

I’m trying to send out a report using a Gateway Event Script Timer. In the script that gets called from the timer I have a call to system.util.setReadTimeout(6000000). If I call the script from say the script console in Designer it runs and I finally get an email with my report.

But looking at the wrapper.log file I see an exception for the timer:
`AttributeError: ‘com.inductiveautomation.ignition.common.script.Imm’ object has no attribute 'setReadTimeout’

For some reason the Gateway timer won’t work but seems to work elsewhere.

Also, the ridiculously high timeout is because for some reason the reports take a long time to complete. Kept getting read timeout errors otherwise. I use system.report.executeAndDistribute to send them. I loop through locations and populate system.report.executeAndDistribute with the parameters. I’ve only tried 3 locations so far and it takes about 1/2hr to see them get to my email.

My SQL calls aren’t too lengthy either. But one table might have 1000’s of rows (5 columns). Wondering if maybe that’s the bottleneck/issue?

0 Likes

#2

I removed system.util.setReadTimeout call from the script and now the Gateway timer works. So, obviously setting the readTimeout for some reason can’t be called from a Gateway timer. And my reports actually come through.

My only issue is it takes a long time for the reports to come through. Close to 1hr for 3 reports to show up in my email…not sure why. The first 2 are quick but the last one takes nearly an hour.

0 Likes

#3

Well, it can’t be called from a gateway timer because it doesn’t exist in the gateway. That’s a timeout setting for a client making a request to the gateway, so it doesn’t make sense in gateway context. (And the manual clearly says it is applicable to Client Scope.)

0 Likes

#4

lol, yup. Figured that out.

Unfortunately the Reporting Module simply takes too long for what I want it to do. The report isn’t even that complex… I may have to look for an alternative way to do reporting.

0 Likes

#5

Get a gateway thread dump during that time. I’m obviously biased, but I would say it’s much more like the bottleneck is something like retrieving data from the database than the actual report generation code.

0 Likes

#6

That was my suspicion. And it could very well be. But using the parameters (the report that takes a really long time) I can see the preview in less 30 seconds but sending takes ~45min.

How do I get a gateway thread dump? I re-ran it again and check the gateway. I have this thread. i think that’s the one…CPU % seems high.


Thread [webserver-341206] id=341206, (RUNNABLE)
  java.desktop@11.0.3/sun.font.SunLayoutEngine.shape(Native Method)
  java.desktop@11.0.3/sun.font.SunLayoutEngine.layout(Unknown Source)
  java.desktop@11.0.3/sun.font.GlyphLayout$EngineRecord.layout(Unknown Source)
  java.desktop@11.0.3/sun.font.GlyphLayout.layout(Unknown Source)
  java.desktop@11.0.3/sun.font.ExtendedTextSourceLabel.createGV(Unknown Source)
  java.desktop@11.0.3/sun.font.ExtendedTextSourceLabel.getGV(Unknown Source)
  java.desktop@11.0.3/sun.font.ExtendedTextSourceLabel.createLogicalBounds(Unknown Source)
  java.desktop@11.0.3/sun.font.ExtendedTextSourceLabel.getAdvance(Unknown Source)
  java.desktop@11.0.3/java.awt.font.TextLine.init(Unknown Source)
  java.desktop@11.0.3/java.awt.font.TextLine.<init>(Unknown Source)
  java.desktop@11.0.3/java.awt.font.TextLine.fastCreateTextLine(Unknown Source)
  java.desktop@11.0.3/java.awt.font.TextLayout.fastInit(Unknown Source)
  java.desktop@11.0.3/java.awt.font.TextLayout.<init>(Unknown Source)
  org.apache.poi.ss.util.SheetUtil.getCellWidth(SheetUtil.java:181)
  org.apache.poi.ss.util.SheetUtil.getCellWidth(SheetUtil.java:162)
  org.apache.poi.ss.util.SheetUtil.getColumnWidthForRow(SheetUtil.java:282)
  org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:235)
  org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:214)
  org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:2090)
  org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:2072)
  com.inductiveautomation.rm.out.RMExcelWriter.addRow(RMExcelWriter.java:367)
  com.inductiveautomation.rm.out.RMExcelWriter.appendTable(RMExcelWriter.java:341)
  com.inductiveautomation.rm.out.RMExcelWriter.getWorkbook(RMExcelWriter.java:158)
  com.inductiveautomation.rm.out.RMExcelWriter.getBytes(RMExcelWriter.java:96)
  com.inductiveautomation.rm.shape.RMDocument.getBytesExcel(RMDocument.java:738)
  com.inductiveautomation.reporting.gateway.actions.ReportActionUtils.getBytes(ReportActionUtils.java:41)
  com.inductiveautomation.reporting.gateway.actions.EmailAction.perform(EmailAction.java:54)
  com.inductiveautomation.reporting.gateway.scheduler.ReportSchedulerTask.reportAction(ReportSchedulerTask.java:322)
  com.inductiveautomation.reporting.gateway.scheduler.ReportSchedulerTask.runImmediate(ReportSchedulerTask.java:294)
  com.inductiveautomation.reporting.gateway.scheduler.ReportSchedulerTask.runImmediate(ReportSchedulerTask.java:262)
  com.inductiveautomation.reporting.gateway.ReportingGatewayHook$RPC.execute(ReportingGatewayHook.java:435)
  java.base@11.0.3/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  java.base@11.0.3/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  java.base@11.0.3/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  java.base@11.0.3/java.lang.reflect.Method.invoke(Unknown Source)
  app//com.inductiveautomation.ignition.gateway.servlets.gateway.functions.ModuleInvoke.invoke(ModuleInvoke.java:165)
  app//com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(Gateway.java:409)
  app//javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
  app//javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
  app//com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:86)
  app//org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852)
  app//org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)
  app//org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
  app//org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
  app//org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
  app//org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
  app//org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
  app//org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
  app//org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
  app//org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
  app//org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
  app//org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
  app//org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
  app//org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
  app//org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
  app//org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
  app//org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)
  app//org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:61)
  app//org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
  app//org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
  app//org.eclipse.jetty.server.Server.handle(Server.java:530)
  app//org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
  app//org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
  app//org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
  app//org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
  app//org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
  app//org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
  app//org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
  app//org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
  app//org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
  app//org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
  app//org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
  java.base@11.0.3/java.lang.Thread.run(Unknown Source)
0 Likes

#7

Huh, well, I stand corrected - at least based on that stack trace, the problem very much is in the actual report generation code. This might be worth getting in contact with support - reports definitely shouldn’t take more than a few minutes, at the absolute top end, to generate.

0 Likes

#8

okay sounds good, will probably contact support. Thank you!

0 Likes