Self certificate error after activating imap workflow

We have a new installation of n8n running in docker with traeffik behind a nginx proxy in another server (providing the SSL). We’ve had an issue we were investigating as when we hit “Execute Node” in the editor it systematically fails with a timeout and no error. Then when we try to stop it… we get an error (on the log) as:

 Error: The execution id "1" could not be found.
common_docker_n8n |     at /usr/local/lib/node_modules/n8n/dist/src/Server.js:1002:23
common_docker_n8n |     at processTicksAndRejections (internal/process/task_queues.js:97:5)
common_docker_n8n |     at async /usr/local/lib/node_modules/n8n/dist/src/ResponseHelper.js:70:26

Then we tried with another module and preapred an IMAP trigger configuration with the same result but just noticed that if we activate this imap workflow the whole n8n becomes unstable and hangs. A restart of the container does not boot now with the following error:

 ln: /home/node/.n8n: File exists
common_docker_n8n | n8n ready on 0.0.0.0, port 5678
common_docker_n8n | Version: 0.86.1
common_docker_n8n |
common_docker_n8n |  ================================
common_docker_n8n |    Start Active Workflows:
common_docker_n8n |  ================================
common_docker_n8n |    - n8n tests
common_docker_n8n | ADD ID (active): 4
common_docker_n8n |      => Started
common_docker_n8n |    - g-calendar
common_docker_n8n | ADD ID (active): 6
common_docker_n8n |      => Started
common_docker_n8n |    - bot@alsur.es imap test
common_docker_n8n | ADD ID (active): 10
common_docker_n8n | events.js:287
common_docker_n8n |       throw er; // Unhandled 'error' event
common_docker_n8n |       ^
common_docker_n8n |
common_docker_n8n | Error: self signed certificate
common_docker_n8n |     at TLSSocket.onConnectSecure (_tls_wrap.js:1474:34)
common_docker_n8n |     at TLSSocket.emit (events.js:310:20)
common_docker_n8n |     at TLSSocket._finishInit (_tls_wrap.js:917:8)
common_docker_n8n |     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:687:12)
common_docker_n8n |     at Socket.ondata (internal/js_stream_socket.js:72:22)
common_docker_n8n |     at Socket.emit (events.js:310:20)
common_docker_n8n |     at addChunk (_stream_readable.js:286:12)
common_docker_n8n |     at readableAddChunk (_stream_readable.js:268:9)
common_docker_n8n |     at Socket.Readable.push (_stream_readable.js:209:10)
common_docker_n8n |     at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
common_docker_n8n | Emitted 'error' event on Connection instance at:
common_docker_n8n |     at TLSSocket._onError (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Connection.js:151:10)
common_docker_n8n |     at TLSSocket.emit (events.js:310:20)
common_docker_n8n |     at emitErrorNT (internal/streams/destroy.js:92:8)
common_docker_n8n |     at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
common_docker_n8n |     at processTicksAndRejections (internal/process/task_queues.js:84:21) {
common_docker_n8n |   code: 'DEPTH_ZERO_SELF_SIGNED_CERT',
common_docker_n8n |   source: 'socket'
common_docker_n8n | }
common_docker_n8n exited with code 1

I’ve included our docker-compose setup too in case we are missing any configuration. I am not sure if both issue are at all related (test nodes not working and self certificate hang on boot)

version: "3"

services:
  n8n:
    image: n8nio/n8n
    container_name: "${PROJECT_NAME}_n8n"
    #command: n8n start --tunnel
    restart: unless-stopped
    networks:
      - common_docker_net
    volumes:
      - /home/docker-user/.n8n:/root/.n8n
      - /backups/n8n:/backups
    healthcheck:
      test: ["CMD-SHELL", "wget -q http://localhost:5678/ -O /dev/null"]
      interval: 10s
      timeout: 5s
      retries: 5
    labels:
      - "traefik.http.services.${PROJECT_NAME}_n8n.loadbalancer.server.port=5678"
      - "traefik.http.routers.${PROJECT_NAME}_n8n.rule=Host(`${PROJECT_BASE_URL}`)"
      - traefik.docker.network=common_docker_net


networks:
  common_docker_net:
    external: true

Sorry to hear that you have problems!

First one question. Is there a reason why you still use traefik if you have already nginx in front of it? Normally there should not be a need for it anymore.

The message “The execution id “1” could not be found.” suggests that the execution actually finished (but no idea if successful or not). Wonder if it is only a communication problem. So that it finishes but the message that n8n sends the frontend to inform it about it somehow gets “lost”. If you set the workflows to save all executions, also the manual ones do they show up in Past-Executions. Just to be sure that the correct and latest data shows up it is maybe a good idea to refresh the page first.

About the SSL error. Did you try to set “Ignore SSL Issues” under “Options” on the IMAP Node? Something else you could try is to use the ubuntu based image instead. The n8n default image uses Alpine Linux which sometimes has some issues in that regard. To use the ubunut-based imaged simple append “-ubuntu” to the version. So instead of for example: “n8nio/n8n:0.86.1” it would be “n8nio/n8n:0.86.1-ubuntu”.

Something unrelated to your problem but just wanted to mention it. For health-checks you should use the following URL instead: http://localhost:5678/healthz

Thanks @jan. Will try/check those and update.
If I set to save all executions I do get the feedback correctly in the report in other cases. Not in the case of IMAP as it seems to hang when I activate that.

Activating a workflow is not “running” it. What happens with Trigger-Nodes is that they wait for the trigger-even to occur. So they either register the webhook-URL (and wait till it gets called) or they run the “trigger” function which does whatever the node needs to do. So in the case of the IMAP-Node it connects to the IMAP-Server, the Cron-Node starts the cron-timers, … and when then this “event” happens they start the workflow. For that reason would an error on activation never show up in past-executions as it happens before it the workflow-runs. If something goes wrong on activate, it should display an error saying that the workflow could not get activated.

Thanks. We’ll reinstall and see. The case now is that no node execution returns a result, so we can not use it to configure the next node as I understand would be the normal procedure.

Sorry, can you please rephrase as I do not understand what you mean exactly. Thanks!

Sorry. The issue we have (apart of the hang after activating the imap module) is that in all worflows, while we are designing and “execute node” we never get the returned result, successfull or not. We can then review afterwards in the executions tab but not within the designer. Therefore we can not see the resulting object and therefore can not map it to the next node while designing.

As you mentioned we must have an issue with the return of the execution result. I did not mention earlier that our NGINX front proxy is on another server on the network that upstreams to our docker server on the port where n8n is working. Perhaps this is an issue or somehow the “public” name for n8n should not be the external one.

Hope that, clarifies something. I attach some screenshots.

Still stuck with this last error. Seems like the execute workflow on the editor never get a return to the interface. Could you point any tip on how to debug it. Any specific Nginx configuration required that we might be missing on the proxy?Thanks