Send 1 Email with multiple Files from ssh node

Describe the issue/error/question

I’m trying to send by email 3 attachments from ssh node wich I download some files. Following other posts here in the community the end of my function node didn’t move forward my binary files. Consequently in the email node result is none file.

Second Issue is that my email node send the email and I didn’t receive the emails, I tried with a 3 other emails as a destinatary but I didn’t receive.

I need to make any kind of extra config to send emails?

What is the error message (if any)?

Please share the workflow

Share the output returned by the last node

Information on your n8n setup

  • ** 0.188.0**
  • ** (default: SQLite):**
  • default, main:
  • Docker:

Hi @rodrigoscdc, the Function code you’re using expects your binary data inside a property named data, but in your ssh node you’re setting the binary property to {{$json.file.split(".")[0]}}.

Could you update the property name in your SSH node like so?

Afterwards, your node would return binary items:

Second Issue is that my email node send the email and I didn’t receive the emails, I tried with a 3 other emails as a destinatary but I didn’t receive.

Are you seeing the email in the “Sent”, “Outbox”, etc. folder of [email protected]? If not, is there any error explaining the bounce? If not, could you check with your email provider what might have happened to these emails handed over to their SMTP server? They might not like empty message bodies or something like this.

The node in general seems fine to me and is working when testing this with my own email accounts:

image

Thanks MutedJam it works, one thing I think is my smtp email that is with problem, so I create an account on mailjet to send my email and using attatchments. But if I run my workflow on cron trigger always give me an error, including if I am on test mode when I hit execute workflow, the only way that I need to do to not give error is executing all nodes before http node that will make request to mailjet, so after that I can hit execute node, so the workflow will not run error.

My version of n8n is 0.192.2 on docker

But if I run my workflow on cron trigger always give me an error, including if I am on test mode when I hit execute workflow

Now that sounds very unexpected to me - which error exactly are you seeing?

I got this error


Inside the node nothing show, just the error message bellow.

Ohhh, any chance you can take a look at the server logs? I hope they contain more information on the error and a stack trace.

@MutedJam here is the log message

{"level":"debug","message":"Start processing node \"Function1\"","metadata":{"file":"WorkflowExecute.js","node":"Function1","timestamp":"2022-09-13T13:39:57.540Z","workflowId":"130"}}
{"level":"debug","message":"Running node \"Function1\" started","metadata":{"file":"WorkflowExecute.js","node":"Function1","timestamp":"2022-09-13T13:39:57.541Z","workflowId":"130"}}
{"level":"debug","message":"Running node \"Function1\" finished successfully","metadata":{"file":"WorkflowExecute.js","node":"Function1","timestamp":"2022-09-13T13:39:57.549Z","workflowId":"130"}}
{"level":"debug","message":"Start processing node \"HTTP Request\"","metadata":{"file":"WorkflowExecute.js","node":"HTTP Request","timestamp":"2022-09-13T13:39:57.550Z","workflowId":"130"}}
{"level":"debug","message":"Running node \"HTTP Request\" started","metadata":{"file":"WorkflowExecute.js","node":"HTTP Request","timestamp":"2022-09-13T13:39:57.550Z","workflowId":"130"}}
{"level":"debug","message":"Proxying request to axios","metadata":{"file":"NodeExecuteFunctions.js","function":"proxyRequestToAxios","timestamp":"2022-09-13T13:39:57.563Z"}}
{"level":"debug","message":"Subprocess for execution ID 68957 finished with error code 1.","metadata":{"executionId":"68957","file":"WorkflowRunner.js","timestamp":"2022-09-13T13:39:57.700Z"}}
{"level":"debug","message":"Executing hook (hookFunctionsSave)","metadata":{"executionId":"68957","file":"WorkflowExecuteAdditionalData.js","function":"workflowExecuteAfter","timestamp":"2022-09-13T13:39:57.701Z","workflowId":"130"}}
{"level":"debug","message":"Executing hook (hookFunctionsPush)","metadata":{"executionId":"68957","file":"WorkflowExecuteAdditionalData.js","function":"workflowExecuteAfter","sessionId":"gr8l69x5uui","timestamp":"2022-09-13T13:39:57.707Z","workflowId":"130"}}
{"level":"debug","message":"Save execution progress to database for execution ID 68957 ","metadata":{"executionId":"68957","file":"WorkflowExecuteAdditionalData.js","function":"workflowExecuteAfter","timestamp":"2022-09-13T13:39:57.708Z","workflowId":"130"}}
{"level":"debug","message":"Send data of type \"executionFinished\" to editor-UI","metadata":{"dataType":"executionFinished","file":"Push.js","function":"send","sessionId":"gr8l69x5uui","timestamp":"2022-09-13T13:39:57.708Z"}}
{"level":"debug","message":"Wait tracker querying database for waiting executions","metadata":{"file":"WaitTracker.js","function":"getwaitingExecutions","timestamp":"2022-09-13T13:40:46.779Z"}}

Thanks so much for confirming @rodrigoscdc. Seeing there’s no error in there I shall add this problem to our internal bug tracker for a closer look by the engineering team. Please accept my sincere apologies for the trouble this causes :frowning:

Thanks so much @MutedJam

1 Like

Hey @rodrigoscdc,

I have just started to look into this one and I have not been able to reproduce the issue. Would you be able to share the env options you have set for your docker image with any important values like hostnames / passwords replaced with a dummy value.

Out of interest what SSH server and version are you connecting to?

Hello @Jon sorry for delay,

this is my docker file

version: "3"

services:
  traefik:
    image: "traefik"
    restart: always
    command:
      - "--api=true"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
      - "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}"
      - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"
      - "--providers.file.filename=/traefik_conf.yaml"
    ports:
      - "443:443"
    volumes:
      - ${DATA_FOLDER}/letsencrypt:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./traefik_conf.yaml:/traefik_conf.yaml

  n8n:
    image: n8nio/n8n:0.195.4
    restart: always
    ports:
      - "127.0.0.1:5678:5678"
    labels:
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
      - traefik.http.routers.n8n.tls=true
      - traefik.http.routers.n8n.entrypoints=websecure
      - traefik.http.routers.n8n.tls.certresolver=mytlschallenge
      - traefik.http.middlewares.n8n.headers.SSLRedirect=true
      - traefik.http.middlewares.n8n.headers.STSSeconds=315360000
      - traefik.http.middlewares.n8n.headers.browserXSSFilter=true
      - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
      - traefik.http.middlewares.n8n.headers.forceSTSHeader=true
      - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
      - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
      - traefik.http.middlewares.n8n.headers.STSPreload=true
      - traefik.backend.buffering.maxRequestBodyBytes=128000000
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER
      - N8N_BASIC_AUTH_PASSWORD
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - WEBHOOK_TUNNEL_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
      - NODE_FUNCTION_ALLOW_EXTERNAL
      - NODE_FUNCTION_ALLOW_BUILTIN
      - EXECUTIONS_DATA_PRUNE
      - EXECUTIONS_DATA_MAX_AGE
      - N8N_METRICS_PREFIX
      - N8N_METRICS
      - GENERIC_TIMEZONE 
      - N8N_DIAGNOSTICS_ENABLED
      - N8N_LOG_LEVEL
      - N8N_LOG_OUTPUT
      - N8N_LOG_FILE_COUNT_MAX=20
      - N8N_LOG_FILE_SIZE_MAX=8
      - N8N_SMTP_SSL=false 
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ${DATA_FOLDER}/.n8n:/home/node/.n8n
      - /home/border/n8n-local-files:/files
      - /home/border/node_modules/sugar-date:/usr/local/lib/node_modules/sugar-date
      - /home/border/node_modules/awesome-phonenumber:/usr/local/lib/node_modules/awesome-phonenumber
      - /home/border/node_modules/sugar-core:/usr/local/lib/node_modules/sugar-core
      - /home/border/node_modules/request-promise-native:/usr/local/lib/node_modules/request-promise-native

this is my .env file

# Telemetry Disable
N8N_DIAGNOSTICS_ENABLED=false

# LOG LEVEL
N8N_LOG_LEVEL=debug

#LOG mode
N8N_LOG_OUTPUT=file

#Log Path
N8N_LOG_FILE_LOCATION=/home/border/n8n-local-files/n8n_log/

# Folder where data should be saved
DATA_FOLDER=/home/border/n8n/

# The top level domain to serve from
DOMAIN_NAME=dummyvalue

# The subdomain to serve from
SUBDOMAIN=n8n-2

# DOMAIN_NAME and SUBDOMAIN combined decide where n8n will be reachable from
# above example would result in: https://n8n.example.com

# The user name to use for autentication - IMPORTANT ALWAYS CHANGE!
N8N_BASIC_AUTH_USER=dummyvalue

# The password to use for autentication - IMPORTANT ALWAYS CHANGE!
N8N_BASIC_AUTH_PASSWORD=dummyvalue

# Optional timezone to set which gets used by Cron-Node by default
# If not set New York time will be used
GENERIC_TIMEZONE=America/Sao_Paulo

# The email address to use for the SSL certificate creation
[email protected]

# Allow external NPM modules
NODE_FUNCTION_ALLOW_EXTERNAL=moment,sugar-date,awesome-phonenumber,request-promise-native

# Allow usage of all builtin modules
NODE_FUNCTION_ALLOW_BUILTIN=*

# Change Prefix of path metrics n8n
N8N_METRICS_PREFIX=n8n_data

# Enable metrics from n8n
N8N_METRICS=true

# Enable Data Prune
EXECUTIONS_DATA_PRUNE=true

# Enable Prune Historical older dan 90 days (2160h)
EXECUTIONS_DATA_MAX_AGE=2880

Perfect there is nothing crazy in there, With the SSH Server do you know what server and SSH version it is? After testing and chatting to @MutedJam before he went on holiday I have a feeling it might be a Windows server running OpenSSH 8 but it is worth checking before I go too far down that route.

@Jon this is the version of ssh debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_8.9 debug1: match: OpenSSH_for_Windows_8.9 pat OpenSSH* compat 0x04000000

@rodrigoscdc that is perfect and fits my theory, It is also annoying as there isn’t a quick fix. As a temporary solution can you try using the FTP node and set it to SFTP, It will do the same thing but from some quick tests you won’t hit the same issue.

@Jon you’re right it works perfectly using ftp node.

Thanks a lot.

1 Like

Hi @rodrigoscdc,

That is perfect and gets you up and running while I work on a fix.