I have installed the module and configured all of the gateway setup needed. I have verified that system.twilio.getAccounts() returns as expected. (this is all within the Script Console)
When attempting to run .sendSms, .sendFreeformWhatsApp, or .sendWhatsAppTemplate I am getting errors starting with at jdk.proxy2/jdk.proxy2.$Proxy83.sendSms(Unknown Source).
Any strings, matching the account name or not, return the above the error.
When testing with non-string inputs for the accountName the error is as expected- NameError: name 'YouCantSeeMyAccountName' is not defined
Please advise if this could be a user error or bug. Thanks!
Can you attach your log files please?
File is to large for here. I will work on it. This did lead to me notice that the gateway logged that the designer was not in the correct mode. I changed to read/write and get the same error. Gateway log message is 'Handler for RPC call threw an exception'.
Can you copy just the full stacktrace of (any) logged messages on the gateway that correspond to you running the script?
WARN
route
30Jul2025 17:05:22
Handler for RPC call threw an exception
com.digitalpetri.ignition.twilio.common.rpc.TwilioRpc$TwilioRpcException: java.util.concurrent.ExecutionException: com.digitalpetri.ignition.twilio.common.util.TwilioAccountException: 'To' number cannot be a Short Code: +618562XXXX
at com.digitalpetri.ignition.twilio.rpc.TwilioRpcImpl.sendSms(TwilioRpcImpl.java:67)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.inductiveautomation.ignition.gateway.rpc.RpcDelegate$DelegateRpcHandler.handle(RpcDelegate.java:271)
at com.inductiveautomation.ignition.gateway.rpc.RpcRoutes.lambda$handle$1(RpcRoutes.java:199)
at com.inductiveautomation.ignition.gateway.rpc.RpcRoutes.safelyHandle(RpcRoutes.java:219)
at com.inductiveautomation.ignition.gateway.rpc.RpcRoutes.handle(RpcRoutes.java:198)
at com.inductiveautomation.ignition.gateway.dataroutes.Route.service(Route.java:361)
at com.inductiveautomation.ignition.gateway.dataroutes.RouteGroupImpl.service(RouteGroupImpl.java:120)
at com.inductiveautomation.ignition.gateway.dataroutes.RouteGroupCollectionServlet.serviceInternal(RouteGroupCollectionServlet.java:133)
at com.inductiveautomation.ignition.gateway.dataroutes.AbstractRouteGroupServlet.service(AbstractRouteGroupServlet.java:40)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
at org.eclipse.jetty.ee10.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1379)
at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736)
at org.eclipse.jetty.ee10.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1614)
at com.inductiveautomation.catapult.filters.GatewayFilter.doFilter(GatewayFilter.java:116)
at jakarta.servlet.http.HttpFilter.doFilter(HttpFilter.java:97)
at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:208)
at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586)
at org.eclipse.jetty.ee10.servlet.ServletHandler$MappedServlet.handle(ServletHandler.java:1547)
at org.eclipse.jetty.ee10.servlet.ServletChannel.dispatch(ServletChannel.java:819)
at org.eclipse.jetty.ee10.servlet.ServletChannel.handle(ServletChannel.java:436)
at org.eclipse.jetty.ee10.servlet.ServletHandler.handle(ServletHandler.java:464)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:575)
at org.eclipse.jetty.ee10.servlet.SessionHandler.handle(SessionHandler.java:717)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1060)
at org.eclipse.jetty.rewrite.handler.RewriteHandler$LastRuleHandler.handle(RewriteHandler.java:159)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:143)
at org.eclipse.jetty.server.Handler$Sequence.handle(Handler.java:805)
at org.eclipse.jetty.server.Handler$Sequence.handle(Handler.java:805)
at org.eclipse.jetty.server.Server.handle(Server.java:182)
at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:662)
at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:418)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:478)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:441)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.util.concurrent.ExecutionException: com.digitalpetri.ignition.twilio.common.util.TwilioAccountException: 'To' number cannot be a Short Code: +618562XXXX
at java.base/java.util.concurrent.FutureTask.report(Unknown Source)
at java.base/java.util.concurrent.FutureTask.get(Unknown Source)
at com.digitalpetri.ignition.twilio.accounts.TwilioAccount$ConnectedTwilioAccount.sendSms(TwilioAccount.java:701)
at com.digitalpetri.ignition.twilio.rpc.TwilioRpcImpl.sendSms(TwilioRpcImpl.java:63)
... 55 common frames omitted
Caused by: com.digitalpetri.ignition.twilio.common.util.TwilioAccountException: 'To' number cannot be a Short Code: +618562XXXX
at com.digitalpetri.ignition.twilio.accounts.TwilioAccount$ConnectedTwilioAccount.lambda$sendSms$10(TwilioAccount.java:697)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
... 1 common frames omitted
1 Like
Sorry, these aren't pretty. Cant a log download small enough.
com.digitalpetri.ignition.twilio.common.rpc.TwilioRpc$TwilioRpcException: java.util.concurrent.ExecutionException: com.digitalpetri.ignition.twilio.common.util.TwilioAccountException: Twilio could not find a Channel with the specified From address
at com.digitalpetri.ignition.twilio.rpc.TwilioRpcImpl.sendFreeformWhatsApp(TwilioRpcImpl.java:87)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.inductiveautomation.ignition.gateway.rpc.RpcDelegate$DelegateRpcHandler.handle(RpcDelegate.java:271)
at com.inductiveautomation.ignition.gateway.rpc.RpcRoutes.lambda$handle$1(RpcRoutes.java:199)
at com.inductiveautomation.ignition.gateway.rpc.RpcRoutes.safelyHandle(RpcRoutes.java:219)
at com.inductiveautomation.ignition.gateway.rpc.RpcRoutes.handle(RpcRoutes.java:198)
at com.inductiveautomation.ignition.gateway.dataroutes.Route.service(Route.java:361)
at com.inductiveautomation.ignition.gateway.dataroutes.RouteGroupImpl.service(RouteGroupImpl.java:120)
at com.inductiveautomation.ignition.gateway.dataroutes.RouteGroupCollectionServlet.serviceInternal(RouteGroupCollectionServlet.java:133)
at com.inductiveautomation.ignition.gateway.dataroutes.AbstractRouteGroupServlet.service(AbstractRouteGroupServlet.java:40)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
at org.eclipse.jetty.ee10.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1379)
at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736)
at org.eclipse.jetty.ee10.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1614)
at com.inductiveautomation.catapult.filters.GatewayFilter.doFilter(GatewayFilter.java:116)
at jakarta.servlet.http.HttpFilter.doFilter(HttpFilter.java:97)
at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:208)
at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586)
at org.eclipse.jetty.ee10.servlet.ServletHandler$MappedServlet.handle(ServletHandler.java:1547)
at org.eclipse.jetty.ee10.servlet.ServletChannel.dispatch(ServletChannel.java:819)
at org.eclipse.jetty.ee10.servlet.ServletChannel.handle(ServletChannel.java:436)
at org.eclipse.jetty.ee10.servlet.ServletHandler.handle(ServletHandler.java:464)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:575)
at org.eclipse.jetty.ee10.servlet.SessionHandler.handle(SessionHandler.java:717)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1060)
at org.eclipse.jetty.rewrite.handler.RewriteHandler$LastRuleHandler.handle(RewriteHandler.java:159)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:143)
at org.eclipse.jetty.server.Handler$Sequence.handle(Handler.java:805)
at org.eclipse.jetty.server.Handler$Sequence.handle(Handler.java:805)
at org.eclipse.jetty.server.Server.handle(Server.java:182)
at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:662)
at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:418)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:478)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:441)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.util.concurrent.ExecutionException: com.digitalpetri.ignition.twilio.common.util.TwilioAccountException: Twilio could not find a Channel with the specified From address
at java.base/java.util.concurrent.FutureTask.report(Unknown Source)
at java.base/java.util.concurrent.FutureTask.get(Unknown Source)
at com.digitalpetri.ignition.twilio.accounts.TwilioAccount$ConnectedTwilioAccount.sendFreeformWhatsApp(TwilioAccount.java:800)
at com.digitalpetri.ignition.twilio.rpc.TwilioRpcImpl.sendFreeformWhatsApp(TwilioRpcImpl.java:83)
... 55 common frames omitted
Caused by: com.digitalpetri.ignition.twilio.common.util.TwilioAccountException: Twilio could not find a Channel with the specified From address
at com.digitalpetri.ignition.twilio.accounts.TwilioAccount$ConnectedTwilioAccount.lambda$sendFreeformWhatsApp$14(TwilioAccount.java:796)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
... 1 common frames omitted
1 Like
Is this a north american number? I think you need to either drop the "+" or include the "1".
Yep! SMS sent as expected, + needed replaced with a 1.
Making the same update and re-testing sending WhatsApp is resulting in the same error as before.
from the script console output-
Java Traceback:
Traceback (most recent call last):
File "<input>", line 5, in <module>
at jdk.proxy2/jdk.proxy2.$Proxy83.sendFreeformWhatsApp(Unknown Source)
at com.digitalpetri.ignition.twilio.client.scripting.ScriptModule.onSendFreeformWhatsApp(ScriptModule.java:41)
at com.digitalpetri.ignition.twilio.common.scripting.AbstractTwilioScriptModule.sendFreeformWhatsApp(AbstractTwilioScriptModule.java:85)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
java.lang.reflect.UndeclaredThrowableException: java.lang.reflect.UndeclaredThrowableException
at org.python.core.Py.JavaError(Py.java:545)
at org.python.core.Py.JavaError(Py.java:536)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:192)
at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction.__call__(ScriptManager.java:563)
at org.python.core.PyObject.__call__(PyObject.java:512)
at org.python.core.PyObject.__call__(PyObject.java:517)
at org.python.pycode._pyx76.f$0(<input>:5)
at org.python.pycode._pyx76.call_function(<input>)
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1703)
at org.python.core.Py.exec(Py.java:1747)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:277)
at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:130)
at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$ConsoleWorker.doInBackground(JythonConsole.java:628)
at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$ConsoleWorker.doInBackground(JythonConsole.java:616)
at java.desktop/javax.swing.SwingWorker$1.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.desktop/javax.swing.SwingWorker.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.UndeclaredThrowableException
at jdk.proxy2/jdk.proxy2.$Proxy83.sendFreeformWhatsApp(Unknown Source)
at com.digitalpetri.ignition.twilio.client.scripting.ScriptModule.onSendFreeformWhatsApp(ScriptModule.java:41)
at com.digitalpetri.ignition.twilio.common.scripting.AbstractTwilioScriptModule.sendFreeformWhatsApp(AbstractTwilioScriptModule.java:85)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)
... 19 more
Caused by: com.inductiveautomation.ignition.common.rpc.proto.ProtoWrappedException: java.util.concurrent.ExecutionException: com.digitalpetri.ignition.twilio.common.util.TwilioAccountException: Twilio could not find a Channel with the specified From address
at com.digitalpetri.ignition.twilio.rpc.TwilioRpcImpl.sendFreeformWhatsApp(TwilioRpcImpl.java:87)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(:0)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(:0)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(:0)
at java.lang.reflect.Method.invoke(:0)
at com.inductiveautomation.ignition.gateway.rpc.RpcDelegate$DelegateRpcHandler.handle(RpcDelegate.java:271)
at com.inductiveautomation.ignition.gateway.rpc.RpcRoutes.lambda$handle$1(RpcRoutes.java:199)
at com.inductiveautomation.ignition.gateway.rpc.RpcRoutes.safelyHandle(RpcRoutes.java:219)
at com.inductiveautomation.ignition.gateway.rpc.RpcRoutes.handle(RpcRoutes.java:198)
at com.inductiveautomation.ignition.gateway.dataroutes.Route.service(Route.java:361)
at com.inductiveautomation.ignition.gateway.dataroutes.RouteGroupImpl.service(RouteGroupImpl.java:120)
at com.inductiveautomation.ignition.gateway.dataroutes.RouteGroupCollectionServlet.serviceInternal(RouteGroupCollectionServlet.java:133)
at com.inductiveautomation.ignition.gateway.dataroutes.AbstractRouteGroupServlet.service(AbstractRouteGroupServlet.java:40)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
at org.eclipse.jetty.ee10.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1379)
at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736)
at org.eclipse.jetty.ee10.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1614)
at com.inductiveautomation.catapult.filters.GatewayFilter.doFilter(GatewayFilter.java:116)
at jakarta.servlet.http.HttpFilter.doFilter(HttpFilter.java:97)
at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:208)
at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586)
at org.eclipse.jetty.ee10.servlet.ServletHandler$MappedServlet.handle(ServletHandler.java:1547)
at org.eclipse.jetty.ee10.servlet.ServletChannel.dispatch(ServletChannel.java:819)
at org.eclipse.jetty.ee10.servlet.ServletChannel.handle(ServletChannel.java:436)
at org.eclipse.jetty.ee10.servlet.ServletHandler.handle(ServletHandler.java:464)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:575)
at org.eclipse.jetty.ee10.servlet.SessionHandler.handle(SessionHandler.java:717)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1060)
at org.eclipse.jetty.rewrite.handler.RewriteHandler$LastRuleHandler.handle(RewriteHandler.java:159)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:143)
at org.eclipse.jetty.server.Handler$Sequence.handle(Handler.java:805)
at org.eclipse.jetty.server.Handler$Sequence.handle(Handler.java:805)
at org.eclipse.jetty.server.Server.handle(Server.java:182)
at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:662)
at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:418)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:478)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:441)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
at java.lang.Thread.run(:0)
Caused by: com.inductiveautomation.ignition.common.rpc.proto.ProtoWrappedException: com.digitalpetri.ignition.twilio.common.util.TwilioAccountException: Twilio could not find a Channel with the specified From address
at java.util.concurrent.FutureTask.report(:0)
at java.util.concurrent.FutureTask.get(:0)
at com.digitalpetri.ignition.twilio.accounts.TwilioAccount$ConnectedTwilioAccount.sendFreeformWhatsApp(TwilioAccount.java:800)
at com.digitalpetri.ignition.twilio.rpc.TwilioRpcImpl.sendFreeformWhatsApp(TwilioRpcImpl.java:83)
... 55 more
Caused by: com.digitalpetri.ignition.twilio.common.util.TwilioAccountException: Twilio could not find a Channel with the specified From address
at com.digitalpetri.ignition.twilio.accounts.TwilioAccount$ConnectedTwilioAccount.lambda$sendFreeformWhatsApp$14(TwilioAccount.java:796)
at java.util.concurrent.FutureTask.run(:0)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(:0)
at java.util.concurrent.ThreadPoolExecutor.runWorker(:0)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(:0)
... 1 more
Traceback (most recent call last):
File "<input>", line 5, in <module>
at jdk.proxy2/jdk.proxy2.$Proxy83.sendFreeformWhatsApp(Unknown Source)
at com.digitalpetri.ignition.twilio.client.scripting.ScriptModule.onSendFreeformWhatsApp(ScriptModule.java:41)
at com.digitalpetri.ignition.twilio.common.scripting.AbstractTwilioScriptModule.sendFreeformWhatsApp(AbstractTwilioScriptModule.java:85)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
java.lang.reflect.UndeclaredThrowableException: java.lang.reflect.UndeclaredThrowableException
Ok, I don't know enough about the WhatsApp stuff to give advice, but this seems like a configuration issue still. Something on the Twilio side maybe.
It's using the same Twilio account and from number, just with the different notification profiles.
When testing from the gateway web page the same notification profiles return status 'Evaluation Complete' in green with no gateway event in the logs.
I'll keep digging and follow up with any findings.
You might need some specific 'from' address format?
(No idea if we "should" be handling this for you)
We are prepending "whatsapp:" to both the "To" and "From" numbers. It's best to test system.twilio.sendWhatsAppTemplate()
first since sending a free form message requires the user to send a message to the Twilio application to open up a 24-hour window. Can you set twilio.RpcHandler
and twilio.ConnectedTwilioAccount
to TRACE when testing out template messages as well?
1 Like
Alternatively, you can shoot your Twilio account a WhatsApp message which will open up the 24-hour session window. From there, system.twilio.sendFreeformMessage()
should then work.
Working through some more testing I have some additional findings. (Also updated core version and module to Beta2)
Upon trial reset the Twilio account status was still in error on the gateway. Once I attempted an edit/save it went back to the Active state. In Beta 1 it would always show active regardless of the trial state. (unless bad credentials were input the first time)
Alarm Notification Profiles (gateway)- Specifically the Twilio WhatsApp Notification: The status indicators on this page appear to be inaccurate. I can input any value for the 'WhatsApp Service SID' and get an 'Active' green status.
I can now send a free form message without any errors. No responses at all, as if it's failing silently.
When attempting to send a Template I am getting an error: com.digitalpetri.ignition.twilio.common.util.TwilioAccountException: The Messaging Service Sid *1234567891023456789* is invalid.
This error happens no matter what value is gave for the message service Sid.
I also have a notification block in an alarm pipeline that does not appear to work as expected- When selecting the WhatsApp Notification profile it is populating the Template fields but does not populate the correct from number for the WhatsApp sender. The SMS Notification from number is the only available to select from the dropdown- Even though my WhatsApp sender has a different number.
Could input label text please be updated: Twilio's native interface is terrible enough, lots of jumping around. Could the titles and descriptions within Ignition Gateway be updated to more clearly indicate which information is needed, maybe more about where it comes from? We have the Twilio account info that has to be set up, Then WhatsApp info, and SMS info. Lots of account numbers to get from Twilio, it's not user friendly.
Example- It asks for my 'WhatsApp Service SID'. In Twilio/WhatsApp I have a WhatsApp Business Account ID, Meta Business Manger ID, SIDs and such for all of the numbers. Something to improve the clarity of which info is needed would be welcomed.
Thanks for reporting back. I'll try to replicate and investigate why the Twilio Account Status has suddenly changed upon Trial restart. Was the Twilio Account in an error state prior to the trial timer running out? Do you have any logs indicating why the account was in an error state?
Twilio Notification Profiles reflect the status of the Twilio Account associated with the Notification Profile. However, maybe there should be a check to validate the Messaging Service SID field follows the appropriate format and indicate some sort of configuration error if it's incorrect.
When trying to send a freeform message, can you look into the Twilio logs through the Twilio Console? In the left navigation bar, select the "Monitor" Tab. From there, do you see any errors under "Logs" -> "Errors" -> "Error logs" or under "Logs" -> "Messaging"?
The Messaging Service SID should be in the format of "MGxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" This can be found in the Twilio Console's left navigation bar under the Develop Tab. Select "Explore products" and select "Messaging." The left navigation bar should update and you'll want to select "Messaging" -> "Services." A list of your Messaging Services should be listed along side their SID. From here, you can also verify a Sender number is configured for your Messaging Service. Select your Messaging Service and select the "Sender Pool" option in the left navigation bar. The Sender should be of type "WhatsApp"
The "From Number" field is generating useable Numbers from the Twilio Account associated with the Notification Profile. Seems like the WhatsApp sender number isnât tied to the associated Twilio Account being used.
I agree. There can definitely be some improvement to help users identify what information from Twilio is needed for WhatsApp Notification Profiles. Let me know if there are any other fields that can be clarified as well.
This is related to the Twilio Account Sid you provided on the Twilio profile you created in the gateway, itâs specific the account or subaccount on Twilio. Each will have their own phone numbers on the Twilio side
Trial Reset
Was not in an error state prior - see below findings as well.
I did not notice any logs. The fault indicator illuded to an authentication issue. I am using a referenced secret for the Auth Token.
- I let the trial expire on my local machine then launched a designer. I have noticed that when launching the designer if the trial has expired the designer does not indicate so. I thought Beta2 fixed this, but I just experienced it again. Always seems to work fine if the trail expires when the designer is already open.
- Logged in and the Twilio Account shows that it is active, even with the Trial not reset.
- This means that the designer notification being âfixedâ and Twilio account status error were ONLY experienced on initial boot.
Alarm Notification Profiles
- Looks like for a Twilio SMS the status inheriting from the Twilio Account would be fine.
- In the case of the WhatsApp profile I do think the status should reflect authentication of the WhatsApp Service SID. It is very mis leading currently. If not able to fully âfixâ, please consider updating to âunknownâ instead of âactiveâ.
Free Form Messages
- Getting somewhere now! The errors I was seeing previously were vague. I now have an error that it is outside the time and a template needs to be used. I believe the root of the confusion was trying to push things through before Meta officially approved everything.
- Updateâ Works fine via the script once a window is opened.
Template WhatsApp Messages
- OK, Huge help! I was looking under Senders > WhatsApp senders. I tried it with the correct MG### and it processed without any errors in Ignition.
- My template is approved, still not sending. Looking into the Twilio errors and troubleshooting settings.
- Updateâ Not seeing any reason for the template not opening the session window. I sent from my device to open then tried the same script again: The template and freeform both went through perfectly. What else would keep the template message from starting the window?
- Update #2â Tested with a few different templates and a few different receivers. Same results for all. It all works once a window is opened. Every attempt to open a window with the message sends from Ignition without a problem but gets the Twilio Error 63016 - Failed to send freeform message because you are outside the allowed window. If you are using WhatsApp, please use a Message Template.
and this is using the script-
params = [ 'Test4you', 'BetaWhatsApp' ] system.twilio.sendWhatsAppTemplate('MyAccount', '1##########', 'MG################################', 'HXcb1da5b8a35fbd1f9580e2b94409232f', params)
Notification Block
- I can confirm with testing in the script console that using the SMS from number causes an error with the WhatsApp freeform script. The from number must be the WhatsApp sender number.
- That being said, since the block is pulling in the wrong number and does not allow me to enter one is it a safe bet that if I go test it, it will fail?
Thanks for the assistance. Iâll post more feedback as I have time.
Thanks for the additional info, Iâll investigate this trial error behavior on my end.
To clarify, sending a WhatsApp Template message will not open the 24-hour window. The User must send a message back to the Twilio WhatsApp Number in order to open the 24-hour window. However, even if the 24-hour window isnât open, WhatsApp Template messages should send without an issue. Iâm seeing a similar issue where a script isnât sending a WhatsApp Template message until I open the 24-hour window. If you go to the Twilio Console under Monitor â Logs â Messaging, do you see any failed message logs for your WhatsApp Template messages? There seems to be an issue here so Iâll further investigate whatâs happening.
It looks like youâre trying to send a WhatsApp Template Message in your script but Twilio is indicating itâs trying to send a freeform message which shouldnât be the case. Are you only trying to send only a template message in your script or are you also trying to send a freeform message as well? Can you also set the loggers âtwilio.ConnectedTwilioAccountâ and âtwilio.RpcHandlerâ set to TRACE?
If you canât get the correct number in the Notification Block, then this would fail. Can you try resetting your Gatewayâs Twilio Account to have it try and repopulate the Twilio Numbers associated with that account?
Ok, learning a lot here. Thank you for explanation- I can confirm the template does not open the window, but the reply back does open the window allowing the Free Form messages. As far as I can tell there are not any actual issues.
Digging deeper: The error 63016 error is returned when the Template is not approved by WhatsApp for the business initiated eligibility. Even if the WhatsApp Sender is approved. Now that the template is approved it sends as expected with that same script.
Iâll follow up on the Notification Block another time. Thanks for the support working through this!
Notification Block Troubleshooting Steps:
- Set the Twilio Account to Disabled in the gateway.
- Launched designer. Dropped a new Notification Block, no from numbers loaded.
- Trial ended, closed designer. Reset Trial.
- Enabled the Twilio Account. Launched designer.
- Dropped a new notification block and selected my WhatsApp Notification Profile.
- The only from number that populates is the SMS sender - Still not the WhatsApp sender #.