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

**URL:** <https://forum.inductiveautomation.com/t/bug-system-opc-setserverenabled-returns-an-error-of-unknown-server-eventho-it-just-disabled-it/49344>\
**Category:** Ignition\
**Tags:** ignition80, scripting\
**Created:** [July 29, 2021, 8:37am UTC](https://forum.inductiveautomation.com/t/bug-system-opc-setserverenabled-returns-an-error-of-unknown-server-eventho-it-just-disabled-it/49344 "2021-07-29T08:37:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 29, 2021, 8:37am UTC](https://forum.inductiveautomation.com/t/bug-system-opc-setserverenabled-returns-an-error-of-unknown-server-eventho-it-just-disabled-it/49344/1 "2021-07-29T08:37:15Z")

</div>

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)**

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

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/8/58d56df11e13c4bc877f958f93632399d0ce5039.png)

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

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 29, 2021, 9:41am UTC](https://forum.inductiveautomation.com/t/bug-system-opc-setserverenabled-returns-an-error-of-unknown-server-eventho-it-just-disabled-it/49344/2 "2021-07-29T09:41:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 29, 2021, 1:56pm UTC](https://forum.inductiveautomation.com/t/bug-system-opc-setserverenabled-returns-an-error-of-unknown-server-eventho-it-just-disabled-it/49344/3 "2021-07-29T13:56:15Z")

</div>

Thanks, opened an issue for this.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 11, 2021, 7:05am UTC](https://forum.inductiveautomation.com/t/bug-system-opc-setserverenabled-returns-an-error-of-unknown-server-eventho-it-just-disabled-it/49344/4 "2021-08-11T07:05:24Z")

</div>

> [@Nightly 8.1 Changelogs - 2021](https://forum.inductiveautomation.com/t/nightly-8-1-changelogs-2021/42410/134):
>
> Nightly Changelog: 8.1.10-b20210810 Data Model 2478: Copying and Pasting Tags in Tag Browser creates duplicate tags Copy and Pasting tags from Tag Browser will no longer create duplicates. Infrastructure 3838: Upgrade to 8.1.8 overwrites gateway.xml file reverting ports to default Fixed an issue where existing gateway ports will be overwritten on an upgrade. [See Technical Advisory](https://support.inductiveautomation.com/hc/en-us/articles/4406741737357-Critical-Port-Reset-Issue-in-8-1-8). 3378: Upgrade the bundled JRE to 11.0.12 Bundled Java runtime upgraded to 11.0.12. Security 2775: Allow A…

pretty fast, ty^^
