[BUG] system.opc.setServerEnabled() returns an error of "unknown server" eventho it just disabled it!

I did this on a test server and i only really have one opcServer connected. (the standaard “Ignition OPC UA Server”) It dissabled the connection like expected but then an error pops up that it didnt find it. Entho it clearly worked, im guessing there is a bug somewhere. So if i’d have more connections the script wouldnt completly run(i guess)
version 8.1.3 (b2021030309)

    opcs = system.opc.getServers(True)
	for row in range(len(opcs)):
		name = opcs[row]		
		system.opc.setServerEnabled(name, False)

at com.inductiveautomation.ignition.gateway.opc.OpcConnectionManagerImpl.setServerEnabled(OpcConnectionManagerImpl.java:485) at com.inductiveautomation.ignition.gateway.script.GatewayOpcUtilities.setServerEnabledImpl(GatewayOpcUtilities.java:107) at com.inductiveautomation.ignition.common.script.builtin.AbstractOPCUtilities.setServerEnabled(AbstractOPCUtilities.java:135) 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.Exception: java.lang.Exception: unknown server: Ignition OPC UA Server

Oke further testing showed that it only shows this error when i try to disable it when its already disabled…
Or enable it when its already enabled
Not really how it should work imho, i dont have this problem with the db/devices enable scripts

Thanks, opened an issue for this.

1 Like

pretty fast, ty^^