WebDev postjson 501 Not Implemented Errror

I’m just starting out with Ignition and using the WebDev module in an Ignition Edge deployment running on my localhost.
Ignition version 8.1.5 (trial)
WebDev module (trial)

Following the user guide example here,
httpPost - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)

I’m getting a 501 Not Implemented error when calling the POST method.

  • I have pressed save on the project in the Designer each time I make a change.
  • If I change the endpoint to say ~/postjhhh I get a 404 instead. So I think I have the URI correct
  • I have tried setting up a doGet and get the same 501 response

Is this because I’m using a trial version?

This is my Postman Request for example

Are there any errors in your gateway console? A 501 can only be thrown from Webdev if, for some reason, the Python code for the given method isn’t found - which should mean a corresponding error is logged in the gateway console indicating what went wrong with the code.

I don’t see any errors in the Logs on the Gateway Console @ Status/Diagnostics/Logs

This is a Windows install and I did install to a folder other than C:\Program Files. Maybe this is a permissions issue?

Windows permissions shouldn’t have any impact here. If Ignition’s working at all, a Python endpoint should be (or failing with a license error, which would show as an HTTP 402).

You could try putting the WebDev.PythonResource logger on debug or trace, then saving changes in the designer and trying to hit your endpoint from Postman again.
Can you post your actual code in this thread?

I increased the log level as you suggested. I didn’t get any new errors but, after looking further down in the log list I did notice the error below from around the time I made the first attempt at the POST. I was previously thinking an error would get logged each time I attempted the POST so I didn’t search down that far.

Is the problem caused by the trial version?

com.inductiveautomation.ignition.common.script.JythonExecException: Scripting is not available for this platform edition.
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runCode(ProjectScriptLifecycle.java:680)
at com.inductiveautomation.webdev.gateway.handlers.PythonResourceHandler.(PythonResourceHandler.java:129)
at com.inductiveautomation.webdev.gateway.servlets.ProjectDispatcher.route(ProjectDispatcher.java:175)
at com.inductiveautomation.webdev.gateway.servlets.ProjectDispatcher$1.load(ProjectDispatcher.java:103)
at com.inductiveautomation.webdev.gateway.servlets.ProjectDispatcher$1.load(ProjectDispatcher.java:61)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3708)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2416)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212)
at com.google.common.cache.LocalCache.get(LocalCache.java:4147)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140)
at com.inductiveautomation.webdev.gateway.servlets.ProjectDispatcher.get(ProjectDispatcher.java:193)
at com.inductiveautomation.webdev.gateway.servlets.WebDevDispatch.doGet(WebDevDispatch.java:132)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at com.inductiveautomation.webdev.gateway.servlets.WebDevDispatch.service(WebDevDispatch.java:118)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:86)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1391)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:760)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:547)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:590)
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:1607)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1297)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1577)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1212)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:322)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:59)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:500)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
at java.base/java.lang.Thread.run(Unknown Source)

You need the "Compute Plugin" on an active license to use gateway-scoped scripting in Edge.

2 Likes

Hi PGriffith,

Here I am also facing same issue. I am using Standard dev edition. I have created python resource in web dev. Pasted the sample code provided in User Manual. Another set of code, ran in script console tool, but was facing 501 error,. Kindly guide me to resolve this issues.