# Reporting - object has no attribute 'setReadTimeout'

**URL:** <https://forum.inductiveautomation.com/t/reporting-object-has-no-attribute-setreadtimeout/27681>\
**Category:** Ignition\
**Created:** [August 22, 2019, 7:25pm UTC](https://forum.inductiveautomation.com/t/reporting-object-has-no-attribute-setreadtimeout/27681 "2019-08-22T19:25:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hodgins.e](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@hodgins.e](https://forum.inductiveautomation.com/u/hodgins.e)\
**Post date:** [August 22, 2019, 7:25pm UTC](https://forum.inductiveautomation.com/t/reporting-object-has-no-attribute-setreadtimeout/27681/1 "2019-08-22T19:25:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![hodgins.e](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@hodgins.e](https://forum.inductiveautomation.com/u/hodgins.e)\
**Post date:** [August 28, 2019, 4:10pm UTC](https://forum.inductiveautomation.com/t/reporting-object-has-no-attribute-setreadtimeout/27681/2 "2019-08-28T16:10:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 28, 2019, 4:17pm UTC](https://forum.inductiveautomation.com/t/reporting-object-has-no-attribute-setreadtimeout/27681/3 "2019-08-28T16:17:59Z")

</div>

> [@hodgins.e](#):
>
> So, obviously setting the readTimeout for some reason can’t be called from a Gateway timer.

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.)

---

<div class="post-metadata">

**Author:** ![hodgins.e](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@hodgins.e](https://forum.inductiveautomation.com/u/hodgins.e)\
**Post date:** [August 28, 2019, 5:23pm UTC](https://forum.inductiveautomation.com/t/reporting-object-has-no-attribute-setreadtimeout/27681/4 "2019-08-28T17:23:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 28, 2019, 5:25pm UTC](https://forum.inductiveautomation.com/t/reporting-object-has-no-attribute-setreadtimeout/27681/5 "2019-08-28T17:25:09Z")

</div>

> [@hodgins.e](#):
>
> The first 2 are quick but the last one takes nearly an hour.

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.

---

<div class="post-metadata">

**Author:** ![hodgins.e](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@hodgins.e](https://forum.inductiveautomation.com/u/hodgins.e)\
**Post date:** [August 28, 2019, 6:20pm UTC](https://forum.inductiveautomation.com/t/reporting-object-has-no-attribute-setreadtimeout/27681/6 "2019-08-28T18:20:06Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/c16c93623b624548cf0ecafe264693b6343fd19b.png)

```auto

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)

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 28, 2019, 7:10pm UTC](https://forum.inductiveautomation.com/t/reporting-object-has-no-attribute-setreadtimeout/27681/7 "2019-08-28T19:10:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hodgins.e](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@hodgins.e](https://forum.inductiveautomation.com/u/hodgins.e)\
**Post date:** [August 28, 2019, 7:34pm UTC](https://forum.inductiveautomation.com/t/reporting-object-has-no-attribute-setreadtimeout/27681/8 "2019-08-28T19:34:29Z")

</div>

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