# OPC-UA Tags break on Server with changing NamespaceArray indexes

**URL:** <https://forum.inductiveautomation.com/t/opc-ua-tags-break-on-server-with-changing-namespacearray-indexes/36044>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [June 25, 2020, 3:52pm UTC](https://forum.inductiveautomation.com/t/opc-ua-tags-break-on-server-with-changing-namespacearray-indexes/36044 "2020-06-25T15:52:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![321liftoff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/321liftoff/32/27544_2.png) [@321liftoff](https://forum.inductiveautomation.com/u/321liftoff)\
**Post date:** [June 25, 2020, 3:52pm UTC](https://forum.inductiveautomation.com/t/opc-ua-tags-break-on-server-with-changing-namespacearray-indexes/36044/1 "2020-06-25T15:52:50Z")

</div>

@Kevin.Herron I have an OPC-UA server that aggregates multiple OPC-UA servers into a single address space. This server generates the NamespaceArray on boot based on which server it connects to first. This means that for each reboot of the aggregating OPC-UA server, the Indexes associated with each Server's nodes may swap around.

When the namespace indexes change, this breaks Ignition's tags subscribed to the nodes, as the namespace index appears fixed from the time the tag was created.

Other software like UA Expert is tolerant of the namespace index changing, as they are following the OPC-UA spec 1.03 Part 5 section 6.3.1:

> _NamespaceArray_ defines an array of namespace URIs. This Variable is also referred as  
> _namespace table_. The indexes into the _namespace table_ are referred to as _NamespaceIndexes_.  
> _NamespaceIndexes_ are used in _NodeIds_ in OPC UA _Services_, rather than the longer  
> namespace URI. Index 0 is reserved for the OPC UA namespace, and index 1 is reserved for  
> the local _Server_. Clients may read the entire _namespace table_ or they may read individual  
> entries in the _namespace table_. The _Server_ shall not modify or delete entries of the namespace  
> table while any client has an open session to the _Server_, because clients may cache the  
> _namespace table_. A _Server_ may add entries to the _namespace table_ even if clients are  
> connected to the _Server_. It is recommended that _Servers_ not change the indexes of the  
> _namespace table_ but only add entries, because the client may cache _NodeIds_ using the indexes.
> 
> Nevertheless, it might not always be possible for _Servers_ to avoid changing indexes in the _namespace table_. **Clients that cache _NamespaceIndexes_ of _NodeIds_ should always check when starting a session to verify that the cached _NamespaceIndexes_ have not changed.**

---

<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:** [June 25, 2020, 4:01pm UTC](https://forum.inductiveautomation.com/t/opc-ua-tags-break-on-server-with-changing-namespacearray-indexes/36044/2 "2020-06-25T16:01:21Z")

</div>

Sorry, we definitely do not have a solution for this.

There's another part of the spec that explicitly says NodeIds shall not change, even on reboot:

Part 3, Section 5.2.2:

> A Server shall persist the NodeId of a Node, that is, it shall not generate new NodeIds when rebooting.

I'm not sure we can ever fix this in a backwards-compatible manner. It would require that the OPC Item Path either change to represent an ExpandedNodeId, which can optionally reference a namespace URI instead of index, or that it be broken into two parts (URI and identifier).

---

<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:** [June 25, 2020, 4:12pm UTC](https://forum.inductiveautomation.com/t/opc-ua-tags-break-on-server-with-changing-namespacearray-indexes/36044/3 "2020-06-25T16:12:40Z")

</div>

> [@Kevin.Herron](#):
>
> It would require that the OPC Item Path either change to represent an ExpandedNodeId, which can optionally reference a namespace URI instead of index

Now that I've said this, I'm thinking this could actually be the path forward... I've gotta think about it more. Existing OPC Item Paths would just remain relatively indexed and you would optionally be able to explicitly use a namespace URI instead of index. The drag n' drop behavior would probably have to change to use the namespace URI to be safe, and then all the functionality to translate URIs to indices on client connect would have to be considered as well...

---

<div class="post-metadata">

**Author:** ![321liftoff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/321liftoff/32/27544_2.png) [@321liftoff](https://forum.inductiveautomation.com/u/321liftoff)\
**Post date:** [June 25, 2020, 4:17pm UTC](https://forum.inductiveautomation.com/t/opc-ua-tags-break-on-server-with-changing-namespacearray-indexes/36044/4 "2020-06-25T16:17:53Z")

</div>

Thanks Kevin for the consideration. Seems like an unfortunate lack of consistency within the OPC-UA spec itself: how can the namespace index be allowed to change (Part 5 section 6.3.1), but the nodeid be restricted to not change, which is made up of a namespace index (Part 3 section 5.2.2)?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/f/1ffd32affeb1d1cdfe9f9f5341bc0d0350dae56a.png)

---

<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:** [June 25, 2020, 4:20pm UTC](https://forum.inductiveautomation.com/t/opc-ua-tags-break-on-server-with-changing-namespacearray-indexes/36044/5 "2020-06-25T16:20:08Z")

</div>

Yes, it’s definitely an inconsistency.

---

<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 9, 2020, 12:34pm UTC](https://forum.inductiveautomation.com/t/opc-ua-tags-break-on-server-with-changing-namespacearray-indexes/36044/6 "2020-07-09T12:34:14Z")

</div>

@321liftoff would you be able to test a beta OPC UA module with a fix for this?

---

<div class="post-metadata">

**Author:** ![321liftoff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/321liftoff/32/27544_2.png) [@321liftoff](https://forum.inductiveautomation.com/u/321liftoff)\
**Post date:** [July 9, 2020, 12:53pm UTC](https://forum.inductiveautomation.com/t/opc-ua-tags-break-on-server-with-changing-namespacearray-indexes/36044/7 "2020-07-09T12:53:07Z")

</div>

Sure. Let me know how to get it. Thanks!

---

<div class="post-metadata">

**Author:** ![Michiel.demiddelaer](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@Michiel.demiddelaer](https://forum.inductiveautomation.com/u/Michiel.demiddelaer)\
**Post date:** [February 15, 2021, 9:08pm UTC](https://forum.inductiveautomation.com/t/opc-ua-tags-break-on-server-with-changing-namespacearray-indexes/36044/8 "2021-02-15T21:08:58Z")

</div>

I’m having the same issue here. Has anyone found a work-around to the problem ?

---

<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:** [February 15, 2021, 9:36pm UTC](https://forum.inductiveautomation.com/t/opc-ua-tags-break-on-server-with-changing-namespacearray-indexes/36044/9 "2021-02-15T21:36:14Z")

</div>

@Michiel.demiddelaer this was addressed starting in 8.1.0.
