Webdev to webdev API call failure: unable to find valid certification path to requested target

Hello all!

This is related to other issues ( Web Service call using system.net.httpClient , Unable to find valid certification path to requested target caused by SSLHandshake Exception while trying to get data from API endpoint - Ignition - Inductive Automation Forum) but in order to complete some of these other tasks I will need to heavily involve IT. I would just like to confirm my direction before I start to make a bunch of calls. I’m aware that I’m not fully understanding all of these protocols so I might butcher the nomenclature. Please ask if there’s something you don’t understand.

I’m attempting to create a connection between a linux Ignition webdev site (8.1) using system.net.httpClient that calls another site’s webdev via an API using doGet. I’ve been able to successfully create a connection with a client that’s using 8.1. I’m now attempting to create a connection to a client that’s using 7.9 which has an https with an error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

I can use postman to connect to this same 7.9 gateway’s webdev site but using linux’s webdev is unsuccessful. I tried opening the 443 port on the 7.9 client’s firewall with no luck. I am guessing that this is a certification issue where I need to place a copy of the certificate for the client’s webdev on the linux’s ignition folder.

If so, where do I download this certificate. If not, what would be the next step for me to create this connection?

Is your Linux gateway even able to bind to the HTTPS port? By default services on Linux can't bind to ports < 1024. You have to set up your service files to allow it with some extra capabilities:

2 Likes

Thanks @paul-griffith ,

I decided to change how we are doing the gateways and opened the 8088 port too. I am still getting the same error however with the same setup. So I’m narrowing down on the issue, it doesn’t have to do with the https port.

I am sending my request to my url: http://SERVERNAME:8088/main/system/webdev/PROJECT_NAME/doGetscript.

With postman, I am getting a correct response but when I’m using the Linux Ignition to call the server I get a 500 error.

In the logs at the SERVER NAME site, I get the following:

java.lang.NullPointerException: null
at org.eclipse.jetty.server.ResponseWriter.write(ResponseWriter.java:248)
at com.inductiveautomation.webdev.gateway.handlers.PythonResourceHandler.doRequest(PythonResourceHandler.java:341)
at com.inductiveautomation.webdev.gateway.handlers.PythonResourceHandler.doGet(PythonResourceHandler.java:502)
at com.inductiveautomation.webdev.gateway.servlets.WebDevDispatch.doGet(WebDevDispatch.java:134)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:85)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:518)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
at java.lang.Thread.run(Unknown Source)

I am unsure at what this log is telling me. There are functions from the jython being pulled but that’s about all I understand. Does anyone have some thoughts on what is keeping the server from responding?

This indicates a programming bug inside Jetty, the underlying third party webserver framework we use. This is the 7.9 gateway, correct? You can try upgrading to the latest 7.9 in case we've updated to a patch release of Jetty that has a fix, but if you're already on the latest or we haven't updated 7.9 to a version of Jetty with a fix there's nothing for you to do.

1 Like

Thanks @paul-griffith,

I will try this on a gateway that has the most recent 7.9 and let you know if it works.

1 Like

OK getting closer on this. I have a gateway with 7.9.21 and it still doesn’t work. BUT! It’s a different error which I have below.

The concern is that I have postman sending the exact same data to this 7.9.21 gateway and I am getting a proper response. But not from my linux gateway (8.1.45). What is failing?

com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 21, in doGet AttributeError: 'NoneType' object has no attribute 'get'
at org.python.core.Py.AttributeError(Py.java:173)
at org.python.core.PyObject.noAttributeError(PyObject.java:930)
at org.python.core.PyObject._getattr_(PyObject.java:925)
at org.python.pycode._pyx172.doGet$1(:59)
at org.python.pycode._pyx172.call_function()
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyBaseCode.call(PyBaseCode.java:301)
at org.python.core.PyFunction.function___call__(PyFunction.java:376)
at org.python.core.PyFunction._call_(PyFunction.java:371)
at org.python.core.PyFunction._call_(PyFunction.java:361)
at org.python.core.PyFunction._call_(PyFunction.java:356)
at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:649)
at com.inductiveautomation.webdev.gateway.handlers.PythonResourceHandler.doRequest(PythonResourceHandler.java:286)
at com.inductiveautomation.webdev.gateway.handlers.PythonResourceHandler.doGet(PythonResourceHandler.java:499)
at com.inductiveautomation.webdev.gateway.servlets.WebDevDispatch.doGet(WebDevDispatch.java:134)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:85)
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.HandlerList.handle(HandlerList.java:59)
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(Unknown Source)
Caused by: org.python.core.PyException: Traceback (most recent call last): File "", line 21, in doGet AttributeError: 'NoneType' object has no attribute 'get'

That one's more straightforward - it's a logic error in your code on line 21. You're trying to call a get function on some reference, but that reference turns out to be null/None.

1 Like

Here’s the response now after I fixed the line 21 error. It’s different from the original error log but still a little close. What error is java:256 on the Jetty?

java.lang.NullPointerException: null
at org.eclipse.jetty.server.ResponseWriter.write(ResponseWriter.java:256)
at com.inductiveautomation.webdev.gateway.handlers.PythonResourceHandler.doRequest(PythonResourceHandler.java:338)
at com.inductiveautomation.webdev.gateway.handlers.PythonResourceHandler.doGet(PythonResourceHandler.java:499)
at com.inductiveautomation.webdev.gateway.servlets.WebDevDispatch.doGet(WebDevDispatch.java:134)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:85)
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.HandlerList.handle(HandlerList.java:59)
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)

Ignition 7.9.21 is using Jetty 9.4.46, so it looks like this line:

The NPE would suggest that s, the string being written, is null/None.

1 Like

OK I am narrowing down on this issue. I tried having the 7.9 code just return a “Hello World” when it received a request from 8.1 and that worked! The issue is how to pull the data from the request in 7.9.

In 8.1 I am using a system.net.httpClient() sending a json body as the data. On the 7.9 Ignition, I am receiving it by using this line of code.

params = request.get('data')

The problem is this line. When this line is processed in 7.9 from the 8.1 httpClient request, the error above repeats itself. Whenever I use Postman with the same situation, 7.9 is able to get the requested data.

Could this be because 7.9 doesn’t have system.net.httpClient? Or perhaps I’m botching the request.get(‘data’) line and it should be something else entirely? Any thoughts?

You should be using a POST instead of a GET (your stack trace shows doGet in it) handler.

GET requests are not supposed to have a body.

1 Like

Yeah, I think you want to be implementing doPost on the receiving side, and you might have better luck pulling out request["postData"] instead of request["data"]:

(This is the 8.3 manual, but this part of Webdev hasn't changed from 7.9).

So here is what I’ve found out:

I can’t have just the receiving implement doPost while I call in doGet. I have to send and receive in doGet or doPost. My next reply will deal with my experiments with doPost.

I am able to have postman’s data be received in doPost when I use request[‘postData’] and request[‘data’]. When I used system.net.httpClient().post(url,params), I get an error every time. Each time the logs’ first line would read

com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 19, in doPost KeyError: postData

which is the first line of code that is pulling this data. This seems to indicate the format that I’m sending the data is incorrect, but I’m sending the data as a json dictionary, the same as with the postman method.

One method that did work was reading request[‘headers’]

for postman I received:

{
"Cookie": "JSESSIONID=node017wqyuoxqs5lexb5yx82n3vgl367.node0",
"Accept": "/",
"User-Agent": "PostmanRuntime/7.49.0",
"Connection": "keep-alive",
"Host": "HOSTSITE:8088",
"Postman-Token": "fcb1dbb0-500a-4a1b-8c0e-10478e0243c2",
"Accept-Encoding": "gzip, deflate, br",
"Content-Length": "192",
"Content-Type": "application/json"
}

whereas from Ignition 8.1 Linux I received:

{
"Connection":"Upgrade,
HTTP2-Settings",
"User-Agent":"Ignition",
"Host":"HOSTSITE:8088",
"HTTP2-Settings":"AAEAAEAAAAIAAAAAAAMAAAAAAAQBAAAAAAUAAEAAAAYABgAA",
"Content-Length":"0",
"Upgrade":"h2c"
}

I can see there is a difference, but I am not skilled enough to see why one works and the other doesn’t. My best guess is that there is some disconnect between 8.1 and 7.9 since I am able to use doGet between 8.1 Igntions systems just fine. I think I’m ready to throw in the towel on this.

What is the exact invocation you are using?

You need to be specifying the data parameter, e.g.

client = system.net.httpClient()

client.post(url, data=my_data)

where my_data is a string or dictionary or whatever your payload is.

See system.net.httpClient | Ignition User Manual

Ignition 8.1 is trying to tell the client to repeat the request with HTTP2 instead of HTTP1.

1 Like

Previous to @Kevin.Herron ‘s and @pturmel ‘s replies, I was using:

params = [json dictionary]

client = system.net.httpClient()

response = client.post(url, params)

response.getText()

I am now using the following:

client = system.net.httpClient()
params = {
"JSON":"DICTIONARY"
}
version = 'HTTP_1_1'
response = client.post(url,version, data = params)
response.getText()

When doing this I get the following errored response back:

u'\n\n\nError 500 Traceback (most recent call last):\r\n File "<HOSTSITE/remote:doPost>", line 19, in doPost\r\nKeyError: postData\r\n\n\nHTTP ERROR 500 Traceback (most recent call last):\r\n File "<HOSTSITE/remote:doPost>", line 19, in doPost\r\nKeyError: postData\r\n\n\nURI:/main/system/webdev/HOSTSITE/remote\nSTATUS:500\nMESSAGE:Traceback (most recent call last):\r\n File "<HOSTSITE/remote:doPost>", line 19, in doPost\r\nKeyError: postData\r\n\nSERVLET:Map\n\nPowered by Jetty:// 9.4.46.v20220331\n\n\n\n'

The error log shows the following:

com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 19, in doPost KeyError: postDataat org.python.core.Py.KeyError(Py.java:225)at org.python.core.PyObject._getitem_(PyObject.java:655)at org.python.pycode._pyx253.doPost$1(:21)at org.python.pycode._pyx253.call_function()at org.python.core.PyTableCode.call(PyTableCode.java:165)at org.python.core.PyBaseCode.call(PyBaseCode.java:301)at org.python.core.PyFunction.function___call__(PyFunction.java:376)at org.python.core.PyFunction._call_(PyFunction.java:371)at org.python.core.PyFunction._call_(PyFunction.java:361)at org.python.core.PyFunction._call_(PyFunction.java:356)at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:649)at com.inductiveautomation.webdev.gateway.handlers.PythonResourceHandler.doRequest(PythonResourceHandler.java:286)at com.inductiveautomation.webdev.gateway.handlers.PythonResourceHandler.doPost(PythonResourceHandler.java:505)at com.inductiveautomation.webdev.gateway.servlets.WebDevDispatch.doPost(WebDevDispatch.java:155)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:85)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.HandlerList.handle(HandlerList.java:59)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(Unknown Source)Caused by: org.python.core.PyException: Traceback (most recent call last): File "", line 19, in doPost KeyError: postData... 52 common frames omitted

And this is when I use request[‘postData’] in my receiving doPost code.

when I use request[‘headers’] on the receiving end, I am now getting the following:

{"Connection":"Upgrade,

HTTP2-Settings","User-Agent":"Ignition",

"Host":"HOSTSITE:8088",

"HTTP2-Settings":"AAEAAEAAAAIAAAAAAAMAAAAAAAQBAAAAAAUAAEAAAAYABgAA",

"Content-Length":"148",

"Upgrade":"h2c",

"Content-Type":"application/json;

charset=UTF-8"}

I know that this is an information dump, but I am obviously missing something here. There are a lot of variables so I know I could be missing something.

Maybe you should give support a call and let them sort you out.

In the latest error it looks like you're trying to access something by key in the postData you receive nothing exists at that key.

1 Like

Thank you @Kevin.Herron,

Will do

Along these lines, try:

client = system.net.httpClient(version="HTTP_1_1")

To force the outgoing call from the client to use HTTP 1.1, which the 7.9 server might be able to negotiate better. In theory servers should be compatible and things should still negotiate correctly, but :person_shrugging:

2 Likes

Good news! After a call with Ignition support I was able to get to the bottom of the issue.

It looked like, whatever method was being used for system.net.httpClient to send a doGet or doPost. was not attaching the body/data/postdata to the request. We could see the request come in but the data field was empty.

What did work was using the method,

system.net.httpPost(url, postParams),

then the receiving end would use

request.get(‘params’)

in doPost. I confirmed this method works correctly on new 7.9 and older 7.9 versions as well. I’m not sure why this was the correct solution, only thought is that system.net.httpClient does not exist on 7.9.

Thanks for your help, everyone!