# Opcua-asyncio python script cannot access tag values using their string paths

**URL:** <https://forum.inductiveautomation.com/t/opcua-asyncio-python-script-cannot-access-tag-values-using-their-string-paths/102832>\
**Category:** Ignition\
**Created:** [February 25, 2025, 2:39am UTC](https://forum.inductiveautomation.com/t/opcua-asyncio-python-script-cannot-access-tag-values-using-their-string-paths/102832 "2025-02-25T02:39:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![noc](https://avatars.discourse-cdn.com/v4/letter/n/6de8d8/32.png) [@noc](https://forum.inductiveautomation.com/u/noc)\
**Post date:** [February 25, 2025, 2:39am UTC](https://forum.inductiveautomation.com/t/opcua-asyncio-python-script-cannot-access-tag-values-using-their-string-paths/102832/1 "2025-02-25T02:39:26Z")

</div>

I have a python script that uses opcua-asyncio. Client authentication is successful. The client code can be found here:

> <https://github.com/FreeOpcUa/opcua-asyncio/blob/772316de21df3b0f874c144b873950f96e188c03/asyncua/client/client.py>

I can successfully get data for these methods that don’t require arguments.

1. get\_root\_node
2. get\_objects\_node
3. get\_server\_node

Which return these respective values:

1. i=84
2. i=85
3. i=2253

This validates that the script works.

The difficulty I’m facing is in correctly identifying tags to get their reported values.

I have used the Ignition designer to copy the path to any tag value of choice for example "[default]The/Full/Tag Path/Including Spaces/Output.value"

When I use the get\_node method where the nodeID is "ns=1;s=[default]The/Full/Tag Path/Including Spaces/Output.value"

I get this error "ERROR:asyncua:The node id refers to a node that does not exist in the server address space.(BadNodeIdUnknown)"

The server is configured to "Expose Tag Providers".

The same error occurs whether I use a "ns" name space value of 1, 2, 3 etc.

1. What is the correct format for the tag path I should be using?
2. Is the NodeID string formatted correctly?

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [February 25, 2025, 4:25am UTC](https://forum.inductiveautomation.com/t/opcua-asyncio-python-script-cannot-access-tag-values-using-their-string-paths/102832/2 "2025-02-25T04:25:19Z")

</div>

To verify that the server is configured correctly, use the OPC quick client in the gateway config webpage, are you able to browse the desired tags there?  
If so, you might have good luck copying the path (nsu=…) as displayed after attempting a [r]ead on a specific tag.

---

<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 25, 2025, 4:45am UTC](https://forum.inductiveautomation.com/t/opcua-asyncio-python-script-cannot-access-tag-values-using-their-string-paths/102832/3 "2025-02-25T04:45:54Z")

</div>

Exposed Tags are always in namespace index 2.

Have you restarted since enabling Exposed Tags? Have you tried a third party client like UaExpert to see what the NodeIds look like?

---

<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 25, 2025, 2:43pm UTC](https://forum.inductiveautomation.com/t/opcua-asyncio-python-script-cannot-access-tag-values-using-their-string-paths/102832/4 "2025-02-25T14:43:56Z")

</div>

This worked for me:

```python
foo = await client.get_node("ns=2;s=[default]/Foo").get_value()
bar = await client.get_node("ns=2;s=[default]/Folder/Bar").get_value()
print(f"foo value: {foo}")
print(f"bar value: {bar}")

```
