# Crash when deploying updated flows

**URL:** <https://discourse.nodered.org/t/crash-when-deploying-updated-flows/89758>\
**Category:** General\
**Created:** [25 July 2024 14:37 UTC](https://discourse.nodered.org/t/crash-when-deploying-updated-flows/89758 "2024-07-25T14:37:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikahaller](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mikahaller](https://discourse.nodered.org/u/mikahaller)\
**Post date:** [25 July 2024 14:37 UTC](https://discourse.nodered.org/t/crash-when-deploying-updated-flows/89758/1 "2024-07-25T14:37:40Z")

</div>

Everytime when i deploy my changes, my node-red crashes. It still deploys the changes.  
As long as i don't depoy changes, it doesn't crash.  
Following is the errors i get, i can't really understand it. Can i somehow renew the certificates or sth.?  
I already updated npm, node-red, node.js

```auto
[error] Error: Already disposing
    at OPCUACertificateManager.<anonymous> (C:\Users\NAME\.node-red\node_modules\node-opcua-pki\dist\pki\certificate_manager.js:468:23)
    at Generator.next (<anonymous>)
    at C:\Users\NAME\.node-red\node_modules\node-opcua-pki\dist\pki\certificate_manager.js:31:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\NAME\.node-red\node_modules\node-opcua-pki\dist\pki\certificate_manager.js:27:12)
    at OPCUACertificateManager.dispose (C:\Users\NAME\.node-red\node_modules\node-opcua-pki\dist\pki\certificate_manager.js:466:16)
    at OPCUACertificateManager.<anonymous> (C:\Users\NAME\.node-red\node_modules\node-opcua-certificate-manager\dist\certificate_manager.js:58:38)
    at Generator.next (<anonymous>)
    at C:\Users\NAME\.node-red\node_modules\node-opcua-certificate-manager\dist\certificate_manager.js:8:71
    at new Promise (<anonymous>)

```

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [25 July 2024 16:07 UTC](https://discourse.nodered.org/t/crash-when-deploying-updated-flows/89758/2 "2024-07-25T16:07:40Z")

</div>

The error is stems from the file `certificate_manager.js` on line 468 character 23. The code can be found [here](https://www.npmjs.com/package/node-opcua-pki?activeTab=code) in the folder `/dist/lib/pki/`.

The offending function is:

```auto
verifyCertificate(certificate, ...args) {
        let options;
        let callback = undefined;
        if (args.length === 1) {
            callback = args[0];
        }
        else if (args.length === 2) { // THIS IS LINE 468
            options = args[0];
            callback = args[1];
        }
        // istanbul ignore next
        if (!callback || typeof callback !== "function")
            throw new Error("internal error");
        // Is the signature on the SoftwareCertificate valid .?
        if (!certificate) {
            // missing certificate
            return callback(null, VerificationStatus.BadSecurityChecksFailed);
        }
        (0, util_1.callbackify)(this.verifyCertificateAsync).call(this, certificate, options || {}, callback);
    }

```

If the package is unneeded then running `npm uninstall node-opcua-pki` in your `.node-red` folder should remove it.

---

<div class="post-metadata">

**Author:** ![mikahaller](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mikahaller](https://discourse.nodered.org/u/mikahaller)\
**Post date:** [26 July 2024 06:37 UTC](https://discourse.nodered.org/t/crash-when-deploying-updated-flows/89758/3 "2024-07-26T06:37:43Z")

</div>

It didn't work unfortunately, so i decided to reinstall node red. Now it works totally fine although i don't know the root cause. If it happens again, i will analyse deeper.  
Thanks for your comment!

---

<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:** [24 October 2024 06:38 UTC](https://discourse.nodered.org/t/crash-when-deploying-updated-flows/89758/4 "2024-10-24T06:38:20Z")

</div>

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