E-mail IMAP Trigger - Error Trying Upload File to S3 from E-mail attachment

Hello Guys,

I’m with a problem here, i’m trying get a file from my e-mail by imap and if i try save on S3 folder, or i try to use write binary node i receive the message:

ERROR: Error finding file: /home/node/.n8n/binaryData/daa10def-a784-48bb-9e9d-e8237217b9b4

But this error occurs when I run the workflow via scheduling; if I run it manually, it works. Does anyone know what it could be?

Information on your n8n setup

  • **n8n version: 0.236.3
  • **Database (default: SQLite): postgresql
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via helm chart
  • **Operating system: ubuntu

Hi @Marcelo_Stevacci :wave:

That’s odd - do you have any logs from around when it fails that might shed some light as to why?

Hello @emeraldherald
n8n | 2023-08-21T12:34:08.253Z | verbose | Workflow execution finished with error “{\n error: {\n message: ‘Error finding file: /home/node/.n8n/binaryData/daa10def-a784-48bb-9e9d-e8237217b9b4’,\n stack: ‘Error: Error finding file: /home/node/.n8n/binaryData/daa10def-a784-48bb-9e9d-e8237217b9b4\n’ +\n ’ at BinaryDataFileSystem.retrieveFromLocalStorage (/usr/local/lib/node_modules/n8n/packages/core/dist/BinaryDataManager/FileSystem.js:177:19)\n’ +\n ’ at Object.execute (/usr/local/lib/node_modules/n8n/packages/nodes-base/dist/nodes/S3/S3.node.js:510:36)\n’ +\n ’ at Workflow.runNode (/usr/local/lib/node_modules/n8n/packages/workflow/dist/Workflow.js:652:28)\n’ +\n ’ at /usr/local/lib/node_modules/n8n/packages/core/dist/WorkflowExecute.js:596:53’\n },\n workflowId: ‘7’,\n file: ‘WorkflowExecute.js’,\n function: ‘processSuccessExecution’\n}”

Hi @Marcelo_Stevacci :wave: Thanks for that - I can’t replicate this behaviour myself. I know it might sound obvious, but when you have this cron job set up to automatically run, all servers etc. are still active and have correct permissions? :thinking:

Hey @Marcelo_Stevacci,

Out of interest are you running n8n in queue mode and can you share the config you are using?

1 Like

Hello @emeraldherald, I believe so, because the way it operates during manual execution is the same, right? Or does it work differently when we set it up to run for the IMAP trigger?

Yes, I’m using queue mode:

I’m using this options:

“QUEUE_BULL_REDIS_HOST”: “redis host”,
“QUEUE_BULL_REDIS_PORT”:“6379”,
“EXECUTIONS_MODE” : “queue”,
“N8N_HOST” : “n8n host”,
“N8N_EDITOR_BASE_URL” : "url ",
“QUEUE_HEALTH_CHECK_ACTIVE” : “true”,
“N8N_DIAGNOSTICS_ENABLED”: “false”,
“N8N_LOG_LEVEL”: “debug”,
“DB_POSTGRESDB_HOST”: “host”,
“DB_POSTGRESDB_DATABASE”: “database”,
“DB_POSTGRESDB_PORT”:“5432”,
“DB_POSTGRESDB_USER”: “user db”,
“DB_POSTGRESDB_PASSWORD”: “”,
“DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED” : “false”,
“NODE_OPTIONS”: “–max_old_space_size=8000”,
“N8N_DEFAULT_BINARY_DATA_MODE”: “filesystem”

Hey @Marcelo_Stevacci,

So I suspect the issue might be N8N_DEFAULT_BINARY_DATA_MODE I don’t think filesystem is fully supported when using queue mode so it might be worth changing that to default to see if it helps.