Questions about Desktop App

Am very excited to hear about the Desktop App. Have installed and started messing around. However, I am getting the error “API-Server can not be reached. It is probably down.” intermittently. Any ideas why this is happening?

Also, I have created some workflows that uses a cron trigger. Does the app (or workflow itself) needs to be open in order for the workflow to be executed?

Thank you for the report.

Could you please do the following?

  1. Terminate all n8n processes in the Task Manager.
  2. Ensure no process is running on port 5679.
  3. Run the n8n desktop exe from a terminal.
  4. Once you see “Connection lost”, screencap the console output and post here.

(2) To ensure no process is running on port 5679:

netstat -ano | findStr "5679"
// should return with no output

(3) To run n8n desktop from a terminal:

cd C:\\Users\\<username>\\AppData\\Local\\Programs\\n8n
.\\n8n.exe
// remember to replace `<username>`

Commands above should work for git bash and Powershell.

Also, I have created some workflows that uses a cron trigger. Does the app (or workflow itself) needs to be open in order for the workflow to be executed?

Yes.

Still the same error. Please see the console output below:

Microsoft Windows [Version 10.0.19042.1348]

(c) Microsoft Corporation. All rights reserved.

C:\Users\Admin>netstat -ano | findstr “5679”

C:\Users\Admin>cd AppData\Local\Programs\n8n

C:\Users\Admin\AppData\Local\Programs\n8n>n8n

C:\Users\Admin\AppData\Local\Programs\n8n>

Running in prod mode

Starting init process…

Initializing n8n process


  •                                              *
    
  • n8n now sends selected, anonymous telemetry. *

  •  For more details (and how to opt out):      *
    
  • Telemetry | Docs *

  •                                              *
    

Waiting for tunnel …

Tunnel URL: https://.hooks.n8n.cloud/

IMPORTANT! Do not share with anybody as it would give people access to your n8n instance!

n8n ready on 0.0.0.0, port 5679

Version: 0.147.1

================================

Start Active Workflows:

================================

  • Update Robot Scheduler Users

    => Started

Editor is now accessible via:

http://localhost:5679/

Init process completed

Please check http://localhost:5679

Starting Electron main process…

Starting Electron renderer process…

N8N_BASIC_AUTH_ACTIVE: true

node:internal/streams/writable:312

  throw new ERR_INVALID_ARG_TYPE(

  ^

TypeError [ERR_INVALID_ARG_TYPE]: The “chunk” argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of ObjectID

at new NodeError (node:internal/errors:370:5)

at _write (node:internal/streams/writable:312:13)

at PassThrough.Writable.end (node:internal/streams/writable:609:17)

at Immediate.<anonymous> (C:\Users\Admin\AppData\Local\Programs\n8n\resources\app\node_modules\nodemailer\lib\mime-node\index.js:978:46)

at processImmediate (node:internal/timers:464:21) {

code: ‘ERR_INVALID_ARG_TYPE’

}

[19796:1122/164654.819:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is disabled, ANGLE is

It might be related to your workflow “Update Robot Scheduler Users”.

Could you please

  • access your standard (not desktop) n8n instance,
  • disable your workflow “Update Robot Scheduler Users”,
  • stop your standard n8n instance, and
  • run the four debug steps above again?

This workflow was already disabled on the other n8n instance before I performed the steps.

I did copy and paste the workflow into the desktop app, though I am not sure if it matters.

Thank you for clarifying. Logs above suggest the workflow was enabled:

================================
Start Active Workflows:
================================
- Update Robot Scheduler Users 
     => Started

Could you please share the workflow here or via PM? Removing any confidential data.

{

“nodes”: [

{

  "parameters": {},

  "name": "Start",

  "type": "n8n-nodes-base.start",

  "typeVersion": 1,

  "position": [

    250,

    300

  ]

},

{

  "parameters": {

    "collection": "users",

    "options": {},

    "query": "={}"

  },

  "name": "MongoDB",

  "type": "n8n-nodes-base.mongoDb",

  "typeVersion": 1,

  "position": [

    450,

    300

  ],

  "credentials": {

    "mongoDb": {

      "id": "4",

      "name": "MongoDB"

    }

  }

},

{

  "parameters": {

    "fromEmail": "xxx",

    "toEmail": "xxx",

    "subject": "List of Active Users in Robot Scheduler",

    "text": "={{$node[\"MongoDB\"].json[\"_id\"]}}",

    "html": "=",

    "attachments": "={{$node[\"Google Sheets2\"].parameter[\"sheetId\"]}}",

    "options": {}

  },

  "name": "Send Email",

  "type": "n8n-nodes-base.emailSend",

  "typeVersion": 1,

  "position": [

    1050,

    300

  ],

  "credentials": {

    "smtp": {

      "id": "2",

      "name": "xxx"

    }

  }

},

{

  "parameters": {

    "operation": "append",

    "sheetId": "18HxdzAFY9lYnhDkh6MqSbV5on7p4bU7u0I",

    "range": "A:C",

    "options": {

      "valueInputMode": "USER_ENTERED"

    }

  },

  "name": "Google Sheets2",

  "type": "n8n-nodes-base.googleSheets",

  "typeVersion": 1,

  "position": [

    850,

    300

  ],

  "credentials": {

    "googleApi": {

      "id": "3",

      "name": "Google Sheet Service Account"

    }

  }

},

{

  "parameters": {

    "operation": "delete",

    "sheetId": "18HxdzAFY9lYnhDkh6MqSbV5on7p4bU7u0I",

    "toDelete": {

      "rows": [

        {

          "sheetId": "0",

          "startIndex": 1,

          "amount": 100

        }

      ]

    }

  },

  "name": "Google Sheets",

  "type": "n8n-nodes-base.googleSheets",

  "typeVersion": 1,

  "position": [

    650,

    300

  ],

  "credentials": {

    "googleApi": {

      "id": "3",

      "name": "Google Sheet Service Account"

    }

  },

  "continueOnFail": true

},

{

  "parameters": {

    "triggerTimes": {

      "item": [

        {

          "mode": "everyX",

          "value": 5,

          "unit": "minutes"

        }

      ]

    }

  },

  "name": "Cron",

  "type": "n8n-nodes-base.cron",

  "typeVersion": 1,

  "position": [

    250,

    450

  ]

}

],

“connections”: {

"Start": {

  "main": [

    [

      {

        "node": "MongoDB",

        "type": "main",

        "index": 0

      }

    ]

  ]

},

"MongoDB": {

  "main": [

    [

      {

        "node": "Google Sheets",

        "type": "main",

        "index": 0

      }

    ]

  ]

},

"Google Sheets2": {

  "main": [

    [

      {

        "node": "Send Email",

        "type": "main",

        "index": 0

      }

    ]

  ]

},

"Google Sheets": {

  "main": [

    [

      {

        "node": "Google Sheets2",

        "type": "main",

        "index": 0

      }

    ]

  ]

},

"Cron": {

  "main": [

    [

      {

        "node": "MongoDB",

        "type": "main",

        "index": 0

      }

    ]

  ]

}

}

}

My teammates and I have not been able to reproduce this yet.

Could you please rename your .n8n dir to something else, rerun the desktop app, and see if the error persists?

C:\Users\<username>\.n8nC:\Users\<username>\.n8n-backup

A new C:\Users\<username>\.n8n will be generated to test with.

Unfortunately still the same results. Just to add that the workflow did get executed though.

Ok I created another workflow to test and I do not get the error anymore.

So the error probably came from the previous workflow as you suggested. How should I go about debugging the error in this case?

Thanks!

Ideally recreating the workflow from scratch by adding node by node instead of copy-pasting, and running the workflow after adding each node. I did this when attempting to reproduce and the executions suceeded at every step, but perhaps you will see different behavior.

When exactly is “Connection lost” and the error log shown? Immediately after this copy-pasted workflow is manually executed?

I found the error happens with the Send Email node. When I delete that node (which I copy and paste from another instance with an earlier version) and add the node back from scratch, I do not get the error anymore. Curious to understand why the failure of the Send Email node results in Connection Lost error.

Anyway, thanks for your help! Appreciate it.

Could you share the version of the n8n instance where the Send Email node originates from? This should allow us to reproduce the problem. Changelog shows no breaking changes to that node so this might be undocumented.

Sure - 0.98.0

Changelog reflects no breaking changes to Send Email, but it is conceivable that core changes between 0.98.0 and 0.147.1 (current desktop app version) may have affected the node.

Building 0.98.0 is no longer straightforward due to changes in type libs for aws4, cheerio, etc. involving modern TS syntax. Since your issue is fixable by re-adding the node, it’d probably be best not to spend time rebuilding an old version. Please consider upgrading your instance to the latest.

If you have further questions let us know.

3 Likes