# OPCUA unable to execute addFolder opcuAcommand

**URL:** https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918
**Category:** General
**Tags:** opcua
**Created:** [5 November 2024 10:05 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918 "2024-11-05T10:05:55Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Meloman](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/meloman/32/96137_2.png) [@Meloman](https://discourse.nodered.org/u/Meloman)
#### Post date: [5 November 2024 10:05 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/1 "2024-11-05T10:05:55Z")

</div>

Hi,

I use some nodes to create an OPC-UA Server which reflect all live data of the machine. It works fine on some computers but today, same code on a new Windows 11 Pro computer doesn't work anymore.

Here is executed code:

```auto
// Aller dans Equipment
node.send({
    ...msg,
    payload: { 
        opcuaCommand: "setFolder" 
    },
    topic: 'i=85', // NodeId de l'Equipment
});

// Ajouter le dossier FESP_100141
node.send({
    ...msg,
    payload: {
        opcuaCommand: "addFolder" 
    },
    topic: 'FESP_100141', // Nom du dossier à créer
});

// Aller dans le dossier FESP_100141
node.send({
    ...msg,
    payload: { 
        opcuaCommand: "setFolder" 
    },
    topic: 'FESP_100141',
});

```

The first setFolder command works fine, but next addFolder returns "Error: Error" without any detail.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/0/00e8bb665d090577a4c61b0155a55746a000306b.png)

All addVariable work as well.

Any idea for addFolder issue ?

Also tried with breaks 500ms between commands :

```auto
// Aller dans Equipment
setTimeout(() => {
    node.send({
        ...msg,
        payload: { 
            opcuaCommand: "setFolder" 
        },
        topic: 'i=85',
    });

    // Register namespace après avoir mis le contexte dans Equipment
    setTimeout(() => {
        node.send({
            ...msg,
            payload: {
                opcuaCommand: "addFolder"
            },
            topic: 'ns=1;s=FESP_100141',
        });

        // Aller dans FESP_100141 après avoir enregistré le namespace
        setTimeout(() => {
            node.send({
                ...msg,
                payload: { 
                    opcuaCommand: "setFolder" 
                },
                topic: 'ns=1;s=FESP_100141',
            });
        }, 500); // Délai avant de définir le dossier FESP_100141
    }, 500); // Délai avant d'enregistrer le namespace
}, 500); // Délai initial pour aller dans Equipment

```

But the same.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/0/6076ba846aab4a502d1368fb95552980c5fa7f5c.png)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [5 November 2024 10:41 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/2 "2024-11-05T10:41:25Z")

</div>

Which node is generating the error?

---

<div class="post-metadata">

### Author: ![Meloman](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/meloman/32/96137_2.png) [@Meloman](https://discourse.nodered.org/u/Meloman)
#### Post date: [5 November 2024 12:23 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/4 "2024-11-05T12:23:29Z")

</div>

OpcUa-Server

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/1/314c239f1956019bc12d7c4939b8aaf5eaefd251.png)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [5 November 2024 16:54 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/5 "2024-11-05T16:54:28Z")

</div>

What node type have you installed to get the opcua server node?

Please select the server node, export it, and paste it here.

Also, if using node-red-contrib-opcua are you using the latest version? I see it was updated last week.

---

<div class="post-metadata">

### Author: ![Meloman](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/meloman/32/96137_2.png) [@Meloman](https://discourse.nodered.org/u/Meloman)
#### Post date: [6 November 2024 06:40 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/6 "2024-11-06T06:40:54Z")

</div>

Thanks for helping me.

Here’s an extracted, simplified version of the function node code that sends a `msg` to the server node, which then returns the error:

```auto
[{"id":"02b31bae31c48d2a","type":"OpcUa-Server","z":"24dfd0b8da371607","port":"4840","name":"uwgifes16287zs","endpoint":"","users":"users.json","nodesetDir":"","autoAcceptUnknownCertificate":true,"registerToDiscovery":false,"constructDefaultAddressSpace":true,"allowAnonymous":true,"endpointNone":true,"endpointSign":true,"endpointSignEncrypt":true,"endpointBasic128Rsa15":true,"endpointBasic256":true,"endpointBasic256Sha256":true,"maxNodesPerBrowse":0,"maxNodesPerHistoryReadData":0,"maxNodesPerHistoryReadEvents":0,"maxNodesPerHistoryUpdateData":0,"maxNodesPerRead":0,"maxNodesPerWrite":0,"maxNodesPerMethodCall":0,"maxNodesPerRegisterNodes":0,"maxNodesPerNodeManagement":0,"maxMonitoredItemsPerCall":0,"maxNodesPerHistoryUpdateEvents":0,"maxNodesPerTranslateBrowsePathsToNodeIds":0,"maxConnectionsPerEndpoint":20,"maxMessageSize":4096,"maxBufferSize":4096,"maxSessions":20,"x":1080,"y":700,"wires":[["102f49798c433781"]]},{"id":"a68ec2d0a118d90c","type":"function","z":"24dfd0b8da371607","name":"Objects > FESP_numfour","func":"var regByContext = global.get('regByContext');\nconst opcua = flow.get('opcua') || {};\n\n// Aller dans Equipment\nsetTimeout(() => {\n node.send({\n ...msg,\n payload: {\n opcuaCommand: \"setFolder\"\n },\n topic: 'i=85',\n });\n\n // Register namespace après avoir mis le contexte dans Equipment\n setTimeout(() => {\n node.send({\n ...msg,\n payload: {\n opcuaCommand: \"addFolder\"\n },\n topic: 'ns=1;s=data',\n });\n\n // Aller dans FESP_100141 après avoir enregistré le namespace\n setTimeout(() => {\n node.send({\n ...msg,\n payload: {\n opcuaCommand: \"setFolder\"\n },\n topic: 'ns=1;s=data',\n });\n }, 1000); // Délai avant de définir le dossier FESP_100141\n }, 1000); // Délai avant d'enregistrer le namespace\n}, 500); // Délai initial pour aller dans Equipment","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":700,"wires":[["02b31bae31c48d2a"]]},{"id":"74fed476fd5242c0","type":"inject","z":"24dfd0b8da371607","name":"OPC-UA Init","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":645,"y":700,"wires":[["a68ec2d0a118d90c"]],"l":false},{"id":"102f49798c433781","type":"debug","z":"24dfd0b8da371607","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"","statusType":"counter","x":1235,"y":700,"wires":[],"l":false}]

```

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/4/24f0a6920579a0e1b125346436a1e83bf0712fd0.png)

I've confirmed that I'm using the latest version of the `node-red-contrib-opcua` package.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d067a91009787b912bda46dfd2a716501dd5361b.png)

Could using an older version help? Is it possible that the latest version has a bug?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 November 2024 10:07 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/7 "2024-11-06T10:07:38Z")

</div>

It is not clear which debug output is showing what is going into the server node, but you don't appear to be passing anything in msg.payload.

---

<div class="post-metadata">

### Author: ![Meloman](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/meloman/32/96137_2.png) [@Meloman](https://discourse.nodered.org/u/Meloman)
#### Post date: [6 November 2024 10:41 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/8 "2024-11-06T10:41:43Z")

</div>

Apologies for the confusion; here’s a clearer breakdown:

The first debug output is from the following code:

```auto
node.send({
        ...msg,
        payload: {
            opcuaCommand: "setFolder"
        },
        topic: 'i=85',
    });

```

→ This executes successfully.

After a 1000ms delay, the second debug output (showing the error) is from:

```auto
node.send({
            ...msg,
            payload: {
                opcuaCommand: "addFolder"
            },
            topic: 'ns=1;s=data',
        });

```

→ Here, `msg.payload` contains `opcuaCommand: "addFolder"`, which triggers the error.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 November 2024 11:10 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/9 "2024-11-06T11:10:24Z")

</div>

What is in the function is not important here.  
As asked before, add a debug node showing what is going into the opcua node and show us what you see. Give the debug node a name so that it is clear which output is which, and set the debug node to output the full message.

Also, as asked before, select the opcua node, export it and paste it here.

Also please stop node red and start it again in a command window, make the error appear, then copy/paste the full command window output here. Copy/paste please. Not screenshot.

---

<div class="post-metadata">

### Author: ![Meloman](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/meloman/32/96137_2.png) [@Meloman](https://discourse.nodered.org/u/Meloman)
#### Post date: [6 November 2024 11:52 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/10 "2024-11-06T11:52:18Z")

</div>

Ok,

So, here you have got the debug of what is outputed by function and sent to "PC UA Server" node (Windows console) :

```auto
6 Nov 12:43:22 - [info] [debug:Function node debug]
{
  payload: { opcuaCommand: 'setFolder' },
  topic: 'i=85',
  _msgid: 'b3c3228071568694'
}
11:43:23.552Z :address_space :1260 modelChangeTransaction
6 Nov 12:43:23 - [error] [OpcUa-Server:OPC UA Server node] Error
6 Nov 12:43:23 - [info] [debug:Function node debug]
{
  payload: { opcuaCommand: 'addFolder', browseName: 'dataFolder' },
  topic: 'ns=1;s=data',
  _msgid: 'b3c3228071568694'
}
6 Nov 12:43:24 - [warn] [OpcUa-Server:OPC UA Server node] OPC UA Server node: Folder not found for topic: ns=1;s=data
6 Nov 12:43:24 - [info] [debug:Function node debug]
{
  payload: { opcuaCommand: 'setFolder' },
  topic: 'ns=1;s=data',
  _msgid: 'b3c3228071568694'
}

```

Here is the "OPC UA Server" node :

```auto
[{"id":"fc8adc2b38b69fb0","type":"OpcUa-Server","z":"24dfd0b8da371607","g":"ea8f423ab0151f6d","port":"4840","name":"OPC UA Server","endpoint":"","users":"users.json","nodesetDir":"","autoAcceptUnknownCertificate":true,"registerToDiscovery":false,"constructDefaultAddressSpace":true,"allowAnonymous":true,"endpointNone":true,"endpointSign":true,"endpointSignEncrypt":true,"endpointBasic128Rsa15":true,"endpointBasic256":true,"endpointBasic256Sha256":true,"maxNodesPerBrowse":0,"maxNodesPerHistoryReadData":0,"maxNodesPerHistoryReadEvents":0,"maxNodesPerHistoryUpdateData":0,"maxNodesPerRead":0,"maxNodesPerWrite":0,"maxNodesPerMethodCall":0,"maxNodesPerRegisterNodes":0,"maxNodesPerNodeManagement":0,"maxMonitoredItemsPerCall":0,"maxNodesPerHistoryUpdateEvents":0,"maxNodesPerTranslateBrowsePathsToNodeIds":0,"maxConnectionsPerEndpoint":20,"maxMessageSize":4096,"maxBufferSize":4096,"maxSessions":20,"x":930,"y":380,"wires":[["80c33821e8c65b4e"]]}]

```

Full console on start :

```auto
6 Nov 12:48:35 - [info]

Bienvenue sur Node-RED
===================

6 Nov 12:48:35 - [info] Node-RED version: v3.1.14
6 Nov 12:48:35 - [info] Node.js version: v22.11.0
6 Nov 12:48:35 - [info] Windows_NT 10.0.22631 x64 LE
(node:14052) [DEP0059] DeprecationWarning: The `util.log API is deprecated. Please use console.log() with a custom formatter or a third-party logger instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
6 Nov 12:48:35 - [info] Chargement des noeuds de la palette
+-------------------------------------------------------------------------------------+
| Warning: |
| node-opcua-client-crawler module has been deprecated and is not maintained anymore. |
| Please use '@sterfive/crawler' instead. |
| '@sterfive/crawler' is available to the NodeOPCUA Subscription members |
+-------------------------------------------------------------------------------------+
(node:14052) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
6 Nov 12:48:37 - [info] Fichier de paramètres : C:\METIER\fesp\settings.js
6 Nov 12:48:37 - [info] Stockage contextuel : 'default' [module=memory]
6 Nov 12:48:37 - [info] Répertoire utilisateur : C:\METIER\fesp
6 Nov 12:48:37 - [warn] Projets désactivés : editorTheme.projects.enabled=false
6 Nov 12:48:37 - [info] Fichier des flux : C:\METIER\fesp\flows.json
6 Nov 12:48:37 - [info] Le serveur est disponible à l'adresse http://127.0.0.1:80/admin/
6 Nov 12:48:37 - [info] Démarrage des flux
6 Nov 12:48:37 - [info] [socketio-config:47235b74.69f984] CORS Enabled false
6 Nov 12:48:37 - [info] [socketio-config:47235b74.69f984] CORS METHODS [""]
6 Nov 12:48:37 - [info] [socketio-config:47235b74.69f984] CORS ORIGINS "*"
6 Nov 12:48:37 - [info] [socketio-config:47235b74.69f984] Created server bind to Node-RED port
6 Nov 12:48:37 - [info] Flux démarrés
6 Nov 12:48:37 - [info] [aedes broker:d9dc2063ac24bccb] Binding aedes mqtt server on port: 1883
(node:14052) [DEP0044] DeprecationWarning: The `util.isArray` API is deprecated. Please use `Array.isArray()` instead.
6 Nov 12:48:37 - [info] [mqtt-broker:d0036dd2faf5432e] Connecté au courtier : FESP@mqtt://localhost:1883
6 Nov 12:48:38 - [warn] [function:Préparation structure des registres] Arch_CSV_Canal1
6 Nov 12:48:38 - [warn] [function:Préparation structure des registres] Info_PLC
6 Nov 12:48:38 - [warn] [function:Horodatage] mise à jour horloge automate : 6.11.2024 12:48:40
6 Nov 12:48:38 - [warn] [function:Préparation structure des registres] Arch_CSV_Canal1
6 Nov 12:48:38 - [warn] [function:Préparation structure des registres] Info_PLC
6 Nov 12:48:39 - [warn] [function:function 44] [object Object]
6 Nov 12:48:39 - [warn] [function:function 44] [object Object]
6 Nov 12:48:39 - [error] [function:Variables CSS] TypeError: Cannot read properties of undefined (reading 'fullscreen')
6 Nov 12:48:39 - [warn] [function:function 44] [object Object]
6 Nov 12:48:39 - [error] [http response:Envoi HTML] Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
6 Nov 12:48:39 - [info] [debug:OPC UA node debug]
{
  topic: 'Client-connected',
  payload: 'UaBrowser@NB-CBA - Session 1',
  _msgid: 'f45b28975792396c'
}
6 Nov 12:48:39 - [info] [debug:OPC UA node debug]
{
  topic: 'Username',
  payload: 'UaBrowser@NB-CBA - Session 1',
  _msgid: '9b318465a01be969'
}
6 Nov 12:48:39 - [warn] [function:function 44] [object Object]
6 Nov 12:48:39 - [warn] [function:Variables et fonctions globales] sanitizeText Ok
6 Nov 12:48:39 - [warn] [function:Variables et fonctions globales] [object Object]
6 Nov 12:48:39 - [warn] [function:Variables et fonctions globales] settings Ok
Access level string: CurrentRead | HistoryRead |
Access level: 1 user access level: 1 restrictions: 0
Role: 15668 selection was b
Permission string: Browse | Read | ReadRolePermissions | ReadHistory | ReceiveEvents |
Permission flag: 163
Permissions: [{"roleId":15668,"permissions":163}]
Access level string: CurrentRead | CurrentWrite | StatusWrite | HistoryRead | HistoryWrite | SemanticChange
Access level: 63 user access level: 63 restrictions: 0
Role: 15680 selection was o
Permission string: Browse | Read | Write | WriteAttribute | ReadRolePermissions | WriteRolePermissions | ReadHistory | WriteHistorizing | InsertHistory | ReceiveEvents | Call |
Permission flag: 2559
Concatenated permissions: [{"roleId":15668,"permissions":163},{"roleId":15680,"permissions":2559}]
Permissions: [{"roleId":15668,"permissions":163},{"roleId":15680,"permissions":2559}]
Access level string: CurrentRead | CurrentWrite | StatusWrite | HistoryRead | HistoryWrite | SemanticChange
Access level: 63 user access level: 63 restrictions: 0
Role: 16036 selection was e
Permission string: Browse | Read | Write | WriteAttribute | ReadRolePermissions | WriteRolePermissions | ReadHistory | WriteHistorizing | InsertHistory | ReceiveEvents | Call |
Permission flag: 2559
Concatenated permissions: [{"roleId":15668,"permissions":163},{"roleId":15680,"permissions":2559},{"roleId":16036,"permissions":2559}]
Permissions: [{"roleId":15668,"permissions":163},{"roleId":15680,"permissions":2559},{"roleId":16036,"permissions":2559}]
11:48:54.088Z :address_space :1260 modelChangeTransaction
6 Nov 12:48:54 - [error] [OpcUa-Server:OPC UA Server] Error
6 Nov 12:48:54 - [info] [debug:Function node debug]
{
  payload: { opcuaCommand: 'addFolder' },
  topic: 'ns=1;s=data',
  _msgid: '38fd4af5a64dcea3',
  _event: 'node:fdd117c2b041fa15',
  accessLevel: 63,
  userAccessLevel: 63,
  accessRestrictions: 0,
  permissions: [
    { roleId: 15668, permissions: 163 },
    { roleId: 15680, permissions: 2559 },
    { roleId: 16036, permissions: 2559 }
  ]
}
Access level string: CurrentRead | HistoryRead |
Access level: 1 user access level: 1 restrictions: 0
Role: 15668 selection was b
Permission string: Browse | Read | ReadRolePermissions | ReadHistory | ReceiveEvents |
Permission flag: 163
Permissions: [{"roleId":15668,"permissions":163}]
Access level string: CurrentRead | CurrentWrite | StatusWrite | HistoryRead | HistoryWrite | SemanticChange
Access level: 63 user access level: 63 restrictions: 0
Role: 15680 selection was o
Permission string: Browse | Read | Write | WriteAttribute | ReadRolePermissions | WriteRolePermissions | ReadHistory | WriteHistorizing | InsertHistory | ReceiveEvents | Call |
Permission flag: 2559
Concatenated permissions: [{"roleId":15668,"permissions":163},{"roleId":15680,"permissions":2559}]
Permissions: [{"roleId":15668,"permissions":163},{"roleId":15680,"permissions":2559}]
Access level string: CurrentRead | CurrentWrite | StatusWrite | HistoryRead | HistoryWrite | SemanticChange
Access level: 63 user access level: 63 restrictions: 0
Role: 16036 selection was e
Permission string: Browse | Read | Write | WriteAttribute | ReadRolePermissions | WriteRolePermissions | ReadHistory | WriteHistorizing | InsertHistory | ReceiveEvents | Call |
Permission flag: 2559
Concatenated permissions: [{"roleId":15668,"permissions":163},{"roleId":15680,"permissions":2559},{"roleId":16036,"permissions":2559}]
Permissions: [{"roleId":15668,"permissions":163},{"roleId":15680,"permissions":2559},{"roleId":16036,"permissions":2559}]
6 Nov 12:48:55 - [warn] [OpcUa-Server:OPC UA Server] OPC UA Server: Folder not found for topic: ns=1;s=data
6 Nov 12:48:55 - [info] [debug:Function node debug]
{
  payload: { opcuaCommand: 'setFolder' },
  topic: 'ns=1;s=data',
  _msgid: '38fd4af5a64dcea3',
  _event: 'node:fdd117c2b041fa15',
  accessLevel: 63,
  userAccessLevel: 63,
  accessRestrictions: 0,
  permissions: [
    { roleId: 15668, permissions: 163 },
    { roleId: 15680, permissions: 2559 },
    { roleId: 16036, permissions: 2559 }
  ]
}
6 Nov 12:48:55 - [info] [debug:OPC UA node debug]
{
  payload: '',
  topic: 'ns=1;s=data',
  _msgid: '38fd4af5a64dcea3',
  _event: 'node:fdd117c2b041fa15',
  accessLevel: 63,
  userAccessLevel: 63,
  accessRestrictions: 0,
  permissions: [
    { roleId: 15668, permissions: 163 },
    { roleId: 15680, permissions: 2559 },
    { roleId: 16036, permissions: 2559 }
  ]
}

```

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 November 2024 13:45 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/11 "2024-11-06T13:45:16Z")

</div>

> [@Meloman](#):
>
> `6 Nov 12:48:35 - [info] Node.js version: v22.11.0`

Node.js v22 is not [currently supported](https://nodered.org/docs/faq/node-versions) so I suggest you start by dropping back to v20. After installing v20 go into C:\METIER\fesp\ and run  
`npm rebuild`  
to rebuild nodes against the new version.

Also, while it is likely that the problem is not related, I suggest fixing the other errors shown in the log. Otherwise you cannot be certain that what you are seeing is not a side effect of one of those.  
I also suggest moving to the latest node-red.

Assuming that the problem is still seen after doing all those I think you may have to submit an issue on the node's github page.  
If it turns out that the node.js version is the problem then submit an issue saying that so that the authors can fix it before v22 becomes an LTS version.

---

<div class="post-metadata">

### Author: ![Meloman](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/meloman/32/96137_2.png) [@Meloman](https://discourse.nodered.org/u/Meloman)
#### Post date: [6 November 2024 13:52 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/12 "2024-11-06T13:52:15Z")

</div>

Thank you! I'll go through each of these steps.

---

<div class="post-metadata">

### Author: ![Meloman](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/meloman/32/96137_2.png) [@Meloman](https://discourse.nodered.org/u/Meloman)
#### Post date: [6 November 2024 15:11 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/13 "2024-11-06T15:11:51Z")

</div>

Hi Colin,

- I uninstalled Node.js 22 and reinstalled Node.js 18 LTS.
- I upgraded Node-RED to 4.0.5, and all node modules were updated as well.
- I created a new project with only test nodes, yet I’m still encountering the same error without any additional details.

Out of frustration, I decided to try sample flows…

- I downloaded and tested the sample from [this link](https://flows.nodered.org/flow/30c941633098789a1ffa348b6ddeef98) without modifying the code, and the same error occurred:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/e/5ea546b250c9e135b65a2bb2abdca628acaf7dea.png)

At this point, it really seems to be a bug in the current version of `node-red-contrib-opcua`.  
I’m feeling quite discouraged.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 November 2024 16:12 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/14 "2024-11-06T16:12:01Z")

</div>

> [@Meloman](#):
>
> it really seems to be a bug in the current version of `node-red-contrib-opcua`.

Submit an issue, as I suggested. The node is well supported so you should get feedback fairly quickly.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 November 2024 16:55 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/15 "2024-11-06T16:55:58Z")

</div>

Post a link to the issue here so anyone finding this will be able to see it.

---

<div class="post-metadata">

### Author: ![Meloman](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/meloman/32/96137_2.png) [@Meloman](https://discourse.nodered.org/u/Meloman)
#### Post date: [7 November 2024 06:53 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/16 "2024-11-07T06:53:00Z")

</div>

You can follow this bug report here 🙂

> <https://github.com/mikakaraila/node-red-contrib-opcua/issues/752>
>
> Hello,
> 
> I've encountered an issue with the \`addFolder\` function in \`node-red-c…ontrib-opcua\`. 
> 
> \*\*The function works correctly in version 0.2.331 but fails in 0.2.337.\*\* 
> 
> The error message received is simply "Error: Error", without additional details.
> 
> \### Steps Taken
> 
> \- I tested addFolder with my own code as well as using the provided sample flow from the documentation.
> \- In both cases, the same error appeared in version 0.2.337, while 0.2.331 functioned without issue.
> \- I have also tested version 0.2.337 with Node.js versions 18, 20, and 22, and with Node-RED versions 3.x and 4.x. The error persisted across all these configurations.
> 
> \### Environment
> 
> \- Node.js: 18, 20, and 22
> \- Node-RED: 3.x and 4.0.5
> 
> \### Run Sequence with Screenshots
> 
> 1. Sample executed on 0.2.331 :
> !\[image\](https://github.com/user-attachments/assets/15253d11-3e78-43cc-9d46-de5dda7fc2f9)
> 
> 2. Upgrade from palette :
> !\[image\](https://github.com/user-attachments/assets/54dd13ca-b245-44f6-ae51-8ad9d8d1b48d)
> 
> 3. Sample executed on 0.2.337 :
> !\[image\](https://github.com/user-attachments/assets/8c01fe94-4fa2-4fb3-b0fe-318509d8e5a7)
> 
> Additional Information
> 
> Before posting this issue, I tried to troubleshoot on the Node-RED forums to confirm the problem wasn’t due to a mistake on my part. You can find the discussion here: https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/12
> 
> Could you please investigate this issue?
> 
> Thank you!

Thanks to Colin.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [5 February 2025 06:53 UTC](https://discourse.nodered.org/t/opcua-unable-to-execute-addfolder-opcuacommand/92918/17 "2025-02-05T06:53:11Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
