Execution Log is not saving

For a moment, while an execution is running, it shows in the Execution List (with live update checked). But after the execution completes, it disappears.
Note, I don’t have any filters active in the Executions view. (it is All Exec and All Statuses)
The only structural change I’ve made is that I moved the n8n database from the sqlite to a postgres backend.

Other than the execution log, everything else seems to working fine.
Any help would be appreciated.
cheers,

Hey @davidbamboo,

Are you running n8n in Docker? If you are can you share the environment options you are setting (removing anything important like hostnames and passwords).

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

# The top level domain to serve from
DOMAIN_NAME=XXXXXX.com

# The subdomain to serve from
SUBDOMAIN=ZZZZZZZZZ

# 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=XXXXXX

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

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

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

# postgres info
POSTGRES_DB=XXXXXX
POSTGRES_NON_ROOT_USER=XXXXXX
POSTGRES_NON_ROOT_PASSWORD=XXXXXX
POSTGRES_HOST=XX.10.10.2

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"
#    ports:
#      - "443:443"
###      - "127.0.0.1:8593:8592"
#    volumes:
#      - ${DATA_FOLDER}/letsencrypt:/letsencrypt
#      - /var/run/docker.sock:/var/run/docker.sock:ro
#
  n8n:
    image: n8nio/n8n
    restart: always
    ports:
      - "127.0.0.1:5678:5678"
    labels:
#      - traefik.enable=true
      - traefik.enable=false
      - 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
    environment:
      - DB_TYPE=postgresdb
#      - DB_POSTGRESDB_HOST=${POSTGRES_HOST}
      - DB_POSTGRESDB_HOST=XXXXXXXX
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
      - DB_POSTGRESDB_SCHEMA=n8n
      - DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER}
      - DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD}
      - 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}/
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ${DATA_FOLDER}/.n8n:/home/node/.n8n
    # Wait 5 seconds to start n8n to make sure that PostgreSQL is ready
    # when n8n tries to connect to it
    command: /bin/sh -c "sleep 5; n8n start"

I am using a custom postgres schema, which seems to be fine.

I was expecting to see some of the EXECUTIONS_DATA_SAVE* options it could be worth setting some and setting them to see if it helps.

Hmm, I can’t see to find any googling reference to those being hardcoded in the .env or docker_compose.

From the UI, this is what my setting for that look like:

Ah, nevermind. I found them here: Environment Variables | Docs

Do they show in the database if you query it?

1 Like

Yes, in the execution_entities table, the correct and complete list of executions is there.

Is it possible that n8n may only be reading from the old sqlite db (which I left there on the server as backup) ?

I guess it could be if it is still pointing to the old database.

1 Like

Ok. I just did a few things, so I’m not sure which of these fixed the issue.

  1. moved .env and docker_compose into the n8n folder I specified in the .env file. and then reloaded n8n from that folder

  2. renamed the sqlite database to database.sqlite.bak

  3. restarted docker, and then reloaded the n8n page. the old executions were still there, so I selected all, and deleted them. When it refreshed, all the recent executions were there.

I’m not sure which of these actions fixed the issue. if it was 3, I suspect a caching issue.

Anyway it is solved now. Thank you for your help @Jon !

1 Like

That is good to hear :+1: