So I am new to dealing with Ignition and inherited this Ignition install from a former Engineer who set this up for the project before I started at my current company and he is no longer apart of the company.
So I am still new at troubleshooting Ignition issues. There are alarm scripts that send API get request and posts to another server when certain conditions happen. I noticed on of them did not trip over the weekend as expected. When I looked at the alarm setting this is what was showing.
When I loaded the code up into the script console in designer it ran just fine. So I attempted to trigger the code by setting a new alarm. It through this error again. I tried a few things with no success then got the idea to log into the gateway on the remote server and restart ignition. But I figure there is a better way to deal with this issue or does the Gateway need to be restarted on a scheduled basis?
Thanks in advanced for any help or advice
"Unable to GET" is unfortunately not much to go on at all. Are there any error messages in the general gateway logs?
Does this help this the error log pulled from the gateway:
If not let me know or more exactly what you looking for that would help!
It would be better to copy and paste the text and format it with the </>
button then pasting screenshots.
1 Like
Like this:
dispatcher 30Jan2023 10:43:05 ([default]BBW01_CombinedTags/BBW01_AccE_BM_VoltageSAvg, alarmActive) Error executing tag event script: java.io.IOException: java.io.IOException: Unable to GET https://api.<Omited due to confidential>
com.inductiveautomation.ignition.common.script.JythonExecException: java.io.IOException: java.io.IOException: Unable to GET https://api.<Omited due to confidential>
at org.python.core.Py.JavaError(Py.java:547)
at org.python.core.Py.JavaError(Py.java:538)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:192)
at org.python.core.PyObject.__call__(PyObject.java:422)
at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237)
at org.python.core.PyMethod.__call__(PyMethod.java:228)
at org.python.pycode._pyx56.getMachineIDs1$8(:60)
at org.python.pycode._pyx56.call_function()
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:134)
at org.python.core.PyFunction.__call__(PyFunction.java:416)
at org.python.pycode._pyx56.alarmActive$1(:99)
at org.python.pycode._pyx56.call_function()
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:306)
at org.python.core.PyFunction.function___call__(PyFunction.java:474)
at org.python.core.PyFunction.__call__(PyFunction.java:469)
at org.python.core.PyFunction.__call__(PyFunction.java:464)
at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:849)
at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:831)
at com.inductiveautomation.ignition.gateway.tags.scripting.TagScriptManagerImpl$FunctionInvokerImpl.run(TagScriptManagerImpl.java:530)
at com.inductiveautomation.ignition.gateway.tags.scripting.events.AbstractTagScript.invoke(AbstractTagScript.java:34)
at com.inductiveautomation.ignition.gateway.tags.scripting.TagScriptManagerImpl$Task.invoke(TagScriptManagerImpl.java:479)
at com.inductiveautomation.ignition.gateway.tags.scripting.TagScriptManagerImpl$TagScriptDispatcher.run(TagScriptManagerImpl.java:442)
at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:539)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
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)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.python.core.PyException: java.io.IOException: java.io.IOException: Unable to GET https://api.<Omited due to confidential>
... 31 common frames omitted
Caused by: java.io.IOException: Unable to GET https://api.<Omited due to confidential>
at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:103)
at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.get(JythonHttpClient.java:306)
at jdk.internal.reflect.GeneratedMethodAccessor48.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)
... 28 common frames omitted
Caused by: java.net.ConnectException: Cannot assign requested address
at java.net.http/jdk.internal.net.http.HttpClientImpl.send(Unknown Source)
at java.net.http/jdk.internal.net.http.HttpClientFacade.send(Unknown Source)
at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:101)
... 33 common frames omitted
Caused by: java.net.ConnectException: Cannot assign requested address
at java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Unknown Source)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(Unknown Source)
at java.net.http/jdk.internal.net.http.AsyncSSLConnection.connectAsync(Unknown Source)
at java.net.http/jdk.internal.net.http.Http2Connection.createAsync(Unknown Source)
at java.net.http/jdk.internal.net.http.Http2ClientImpl.getConnectionFor(Unknown Source)
at java.net.http/jdk.internal.net.http.ExchangeImpl.get(Unknown Source)
at java.net.http/jdk.internal.net.http.Exchange.establishExchange(Unknown Source)
at java.net.http/jdk.internal.net.http.Exchange.responseAsyncImpl0(Unknown Source)
at java.net.http/jdk.internal.net.http.Exchange.responseAsyncImpl(Unknown Source)
at java.net.http/jdk.internal.net.http.Exchange.responseAsync(Unknown Source)
at java.net.http/jdk.internal.net.http.MultiExchange.responseAsyncImpl(Unknown Source)
at java.net.http/jdk.internal.net.http.MultiExchange.lambda$responseAsyncImpl$7(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.uniHandle(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.uniHandleStage(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.handle(Unknown Source)
at java.net.http/jdk.internal.net.http.MultiExchange.responseAsyncImpl(Unknown Source)
at java.net.http/jdk.internal.net.http.MultiExchange.lambda$responseAsync0$2(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
at java.net.http/jdk.internal.net.http.HttpClientImpl$DelegatingExecutor.execute(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.completeAsync(Unknown Source)
at java.net.http/jdk.internal.net.http.MultiExchange.responseAsync(Unknown Source)
at java.net.http/jdk.internal.net.http.HttpClientImpl.sendAsync(Unknown Source)
... 36 common frames omitted
Caused by: java.net.BindException: Cannot assign requested address
at java.base/sun.nio.ch.Net.connect0(Native Method)
at java.base/sun.nio.ch.Net.connect(Unknown Source)
at java.base/sun.nio.ch.Net.connect(Unknown Source)
at java.base/sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$0(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
... 59 common frames omitted
1 Like
What version of Ignition are you using? Also, are you able to share the code in the project library script? If you're on 8.1.16 or higher, you can explicitly set the version
parameter to HTTP_1_1, which prevents a potential socket leak in the underlying Java HTTP client implementation. You should also prefer to recycle the same httpClient
instance as much as possible; I don't know if the script is written to do that or not without seeing it.
Looks to be 8.1.10 currently. I will look into the steps to update it, its in a docker container. I am paranoid about this install since i inherited from some one else and want to avoid having to redo everything, if you know what I mean. Can I dm the script, not sure I want it openly posted on a forum.
Sure, you can DM me, I just want to take a quick look at how it's written.
I would definitely recommend upgrading sooner rather than later, for a variety of reasons, but I totally understand wanting to be cautious about a production system you're inheriting.