I am trying to write a webdev module to export tags.
This code will run correctly in the script console
filePath = "C:\\TagExports\\tags-export.json"
system.tag.exportTags(filePath=filePath, tagPaths=[""])
But it fails in a webdev with the error HTTP ERROR 500 Server Error
If anyone has any advice on how to make this work it would be much appreciated
akivabrookler:
script console
Script console runs in the local client, not on the gateway server. Webdev runs on the server.
You are likely running into a permissions issue, where the account running the gateway service is not allowed to make new folders on the C: root. You can try manually creating the folder(s) on the server, but you may still run into write permission issues.
akivabrookler:
make this work
What is your end goal, to use the webdev endpoint to trigger the server to export its tags to a known location? Or are you trying to return the exported data to whoever requested it? Provide more information.
Additionally, when troubleshooting anything in webdev or perspective and running into errors or issues, you should always check your gateway log, which is where errors in these contexts will end up.
2 Likes
Everything Ryan suggested is valid and valuable advice.
For the exact use case you have here, you're overcomplicating things.
If you drop the filePath argument from exportTags entirely, it will return the export string from the function call:
tagExportJson = system.tag.exportTags(tagPaths=[""])
2 Likes
Thanks for the suggestions!
My goal here is to retrieve all tags from the gateway.
I tried your suggestions of using the export string only, and the command still errors. The error message seems to indicate a problem finding the tag providers. This is the log from the gateway and the exact webdev I am using:
def doGet(request, session):
data=None
try:
tagExportJson = system.tag.exportTags(tagPaths=[""])
except Exception as e:
return {
"json": {
"success": False,
"error": str(e)
}
}
return {
"json":{"success": True, "data": tagExportJson}
}
INFO | jvm 5 | 2025/12/15 12:59:39 | E [W.PythonResource ] [12:59:39.229]: Error executing testproject/backupTags:doGet project=testproject, method=GET, route-path=backupTags
INFO | jvm 5 | 2025/12/15 12:59:39 | com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last):
INFO | jvm 5 | 2025/12/15 12:59:39 | File "<testproject/backupTags:doGet>", line 4, in doGet
INFO | jvm 5 | 2025/12/15 12:59:39 | File "<testproject/backupTags:doGet>", line 4, in doGet
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.TagProviderRpc.getTagProvider(TagProviderRpc.java:662)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.TagProviderRpc.getTagExport(TagProviderRpc.java:753)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.ignition.gateway.script.GatewayTagUtilities.exportInternal(GatewayTagUtilities.java:345)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.ignition.common.script.builtin.AbstractTagUtilities.exportTags(AbstractTagUtilities.java:576)
INFO | jvm 5 | 2025/12/15 12:59:39 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 5 | 2025/12/15 12:59:39 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO | jvm 5 | 2025/12/15 12:59:39 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO | jvm 5 | 2025/12/15 12:59:39 | at java.base/java.lang.reflect.Method.invoke(Unknown Source)
INFO | jvm 5 | 2025/12/15 12:59:39 | java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Provider not found:
INFO | jvm 5 | 2025/12/15 12:59:39 |
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.python.core.Py.JavaError(Py.java:545)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.python.core.Py.JavaError(Py.java:536)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:192)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction.__call__(ScriptManager.java:553)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.python.core.PyObject.__call__(PyObject.java:400)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.python.pycode._pyx83.doGet$1(<testproject/backupTags:doGet>:13)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.python.pycode._pyx83.call_function(<testproject/backupTags:doGet>)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.python.core.PyTableCode.call(PyTableCode.java:173)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.python.core.PyBaseCode.call(PyBaseCode.java:306)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.python.core.PyFunction.function___call__(PyFunction.java:474)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.python.core.PyFunction.__call__(PyFunction.java:469)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.python.core.PyFunction.__call__(PyFunction.java:464)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:847)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:829)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runFunction(ProjectScriptLifecycle.java:868)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.webdev.gateway.handlers.PythonResourceHandler.doRequest(PythonResourceHandler.java:307)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.webdev.gateway.handlers.PythonResourceHandler.doGet(PythonResourceHandler.java:554)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.webdev.gateway.servlets.WebDevDispatch.doGet(WebDevDispatch.java:132)
INFO | jvm 5 | 2025/12/15 12:59:39 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:503)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.webdev.gateway.servlets.WebDevDispatch.service(WebDevDispatch.java:118)
INFO | jvm 5 | 2025/12/15 12:59:39 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:86)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1151)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.servlet.ServletHolder.handle(ServletHolder.java:640)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1374)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.catapult.filters.GatewayFilter.doFilter(GatewayFilter.java:73)
INFO | jvm 5 | 2025/12/15 12:59:39 | at javax.servlet.http.HttpFilter.doFilter(HttpFilter.java:97)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:177)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1348)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.servlet.ServletHandler.doHandle(ServletHandler.java:454)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.ScopedHandler.handle(ScopedHandler.java:119)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.security.SecurityHandler.handle(SecurityHandler.java:497)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.HandlerWrapper.handle(HandlerWrapper.java:108)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.ScopedHandler.nextHandle(ScopedHandler.java:183)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.SessionHandler.doHandle(SessionHandler.java:519)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.ScopedHandler.nextHandle(ScopedHandler.java:181)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.ContextHandler.doHandle(ContextHandler.java:885)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.ScopedHandler.nextScope(ScopedHandler.java:152)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.servlet.ServletHandler.doScope(ServletHandler.java:423)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.ScopedHandler.nextScope(ScopedHandler.java:150)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.SessionHandler.doScope(SessionHandler.java:503)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.ScopedHandler.nextScope(ScopedHandler.java:150)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.ContextHandler.doScope(ContextHandler.java:830)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.ScopedHandler.handle(ScopedHandler.java:117)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.ContextHandler.handle(ContextHandler.java:1443)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1289)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.HttpChannel.dispatch(HttpChannel.java:616)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.HttpChannel.handle(HttpChannel.java:459)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.ee8.nested.ContextHandler$CoreContextHandler$CoreToNestedHandler.handle(ContextHandler.java:2450)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1064)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.rewrite.handler.RewriteHandler$LastRuleHandler.handle(RewriteHandler.java:159)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.rewrite.handler.HeaderPatternRule$1.handle(HeaderPatternRule.java:89)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.rewrite.handler.Rule$Handler.handle(Rule.java:108)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:143)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.server.Handler$Sequence.handle(Handler.java:805)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.server.Handler$Sequence.handle(Handler.java:805)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.server.Server.handle(Server.java:182)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:662)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:416)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:480)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:443)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
INFO | jvm 5 | 2025/12/15 12:59:39 | at java.base/java.lang.Thread.run(Unknown Source)
INFO | jvm 5 | 2025/12/15 12:59:39 | Caused by: org.python.core.PyException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Provider not found:
INFO | jvm 5 | 2025/12/15 12:59:39 | ... 78 common frames omitted
INFO | jvm 5 | 2025/12/15 12:59:39 | Caused by: java.lang.IllegalArgumentException: Provider not found:
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.TagProviderRpc.getTagProvider(TagProviderRpc.java:662)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.TagProviderRpc.getTagExport(TagProviderRpc.java:753)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.ignition.gateway.script.GatewayTagUtilities.exportInternal(GatewayTagUtilities.java:345)
INFO | jvm 5 | 2025/12/15 12:59:39 | at com.inductiveautomation.ignition.common.script.builtin.AbstractTagUtilities.exportTags(AbstractTagUtilities.java:576)
INFO | jvm 5 | 2025/12/15 12:59:39 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 5 | 2025/12/15 12:59:39 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO | jvm 5 | 2025/12/15 12:59:39 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO | jvm 5 | 2025/12/15 12:59:39 | at java.base/java.lang.reflect.Method.invoke(Unknown Source)
INFO | jvm 5 | 2025/12/15 12:59:39 | at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)
INFO | jvm 5 | 2025/12/15 12:59:39 | ... 75 common frames omitted
akivabrookler:
Provider not found
Looks like you are missing the tag provider in one of the tag paths you are supplying.
also, add
except java.lang.Throwable as t,
logger.warn("A java exception occurred", t)
to your try block to catch java exceptions, and add logger = system.util.getLogger("WebdevTagExport") to the start of your function.
The empty string should retrieve all tags across all providers (at least it does in the script console). I had the same problem when I did specify the name of my tag provider “default”.
Also– from a scope perspective, I have a webdev script which works for using the importTags function. I don’t see a reason that the scope for import and export would be any different.
Thanks for your logging suggestion, I added those logs and did not see anything else useful in the logs.
Also, why would the tag retrieval issue only happen in gateway scope not script console scope?
Leor_Fishman:
not script console scope
Since script console is client scope, it's provided with different information than gateway scope. In this case, it seems like something is provided to the client context that is not being provided to the gateway context and causing an issue.
Did the caused by line of the error stack trace still say Provider not found:? or did it have an actual provider name beyond the colon?
In this case what I had you add is catching the error you posted gracefully and allowing the script to continue, instead of stopping the script execution due to the error.
I am able to get the tag export now for a single provider,
tagExportJson = system.tag.exportTags(tagPaths=["[default]"])
Before I was mistakenly calling
tagExportJson = system.tag.exportTags(tagPaths=["default"])
I am still not able to retrieve the exports for all my providers in one shot. Any idea how that can be done? And why system.tag.exportTags(tagPaths=[""]) works in the console but not in the webdev script
It looks like for now you'll have to list all tag providers first (see this post for inspiration) and individually export them, then figure out some way to combine the different JSON exports together.
In the script console, the exportTags functions is going through a different code path (first, it hits the implementation of the tag scripting functions, then inside that (on the client) it calls out to the gateway, where it ultimately hits the gateway implementation of exportTags, which is automatically qualified with the project name (and therefore a default tag provider).
The path when issued from WebDev does get automatically qualified with the project name/project default tag provider, but due to a bug in exportTags doesn't get picked up.
I'll make a ticket for this, but it won't be fixed any time soon (and only in 8.3 whenever it does).
From looking at the code I'm pretty sure that exportTags in the script console is giving you everything from the project's default tag provider, not actually every tag in every provider .
2 Likes