N8n can't start in kubernetes

Describe the problem/error/question

I am trying to deploy n8n to kubernetes using GitHub - 8gears/n8n-helm-chart at 0.25.2 helm chart but I cannot get it up and running, I have defined below values.

I guess I am missing some config but I cannot get to it.

N8N_LOG_LEVEL: "debug"
    N8N_METRICS: "true"
    DB_TYPE: sqlite
    DB_SQLITE_VACUUM_ON_STARTUP: true
    N8N_EDITOR_BASE_URL: https://xxxxxxxx/
    N8N_HOST: https://xxxxxxx/
    DB_LOGGING_ENABLED: query
    N8N_COMMUNITY_PACKAGES_ENABLED: false

What is the error message (if any)?

No encryption key found - Auto-generated and saved to: /home/node/.n8n/config
Invalid boolean value for DB_LOGGING_ENABLED: query
Loaded config overwrites from /n8n-config/config.json
2024-11-22T14:05:54.619Z | info     | Initializing n8n process "{ file: 'start.js', function: 'init' }"
2024-11-22T14:05:58.320Z | info     | Received SIGTERM. Shutting down... "{ file: 'base-command.js' }"
2024-11-22T14:05:58.321Z | debug    | Shutting down component "License.shutdown()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-22T14:05:58.322Z | error    | ComponentShutdownError: Failed to shutdown gracefully "{\n  component: 'License.shutdown()',\n  file: 'LoggerProxy.js',\n  function: 'exports.error'\n}"
2024-11-22T14:05:58.323Z | error    | ServiceNotFoundError: Service with "MaybeConstructable<DataSource>" identifier was not found in the container. Register it before usage via explicitly calling the "Container.set" function or using the "@Service()" decorator. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-22T14:05:58.323Z | debug    | Shutting down component "Push.onShutdown()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-22T14:05:58.616Z | debug    | Shutting down component "ActiveWorkflowManager.removeAllTriggerAndPollerBasedWorkflows()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-22T14:05:58.617Z | error    | ComponentShutdownError: Failed to shutdown gracefully "{\n  component: 'ActiveWorkflowManager.removeAllTriggerAndPollerBasedWorkflows()',\n  file: 'LoggerProxy.js',\n  function: 'exports.error'\n}"
2024-11-22T14:05:58.617Z | error    | ServiceNotFoundError: Service with "MaybeConstructable<DataSource>" identifier was not found in the container. Register it before usage via explicitly calling the "Container.set" function or using the "@Service()" decorator. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-22T14:05:58.617Z | debug    | Shutting down component "AbstractServer.onShutdown()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-22T14:05:58.618Z | debug    | Shutting down component "PruningService.shutdown()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-22T14:05:58.618Z | error    | ComponentShutdownError: Failed to shutdown gracefully "{\n  component: 'PruningService.shutdown()',\n  file: 'LoggerProxy.js',\n  function: 'exports.error'\n}"
2024-11-22T14:05:58.618Z | error    | ServiceNotFoundError: Service with "MaybeConstructable<DataSource>" identifier was not found in the container. Register it before usage via explicitly calling the "Container.set" function or using the "@Service()" decorator. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-22T14:05:58.619Z | debug    | Shutting down component "Telemetry.stopTracking()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-22T14:05:58.619Z | error    | ComponentShutdownError: Failed to shutdown gracefully "{\n  component: 'Telemetry.stopTracking()',\n  file: 'LoggerProxy.js',\n  function: 'exports.error'\n}"
2024-11-22T14:05:58.619Z | error    | ServiceNotFoundError: Service with "MaybeConstructable<DataSource>" identifier was not found in the container. Register it before usage via explicitly calling the "Container.set" function or using the "@Service()" decorator. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-22T14:05:58.620Z | info     |
Stopping n8n... "{ file: 'start.js', function: 'stopProcess' }"
2024-11-22T14:05:58.620Z | error    | Error: There was an error shutting down n8n. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-22T14:05:58.620Z | error    | TypeError: Cannot read properties of undefined (reading 'removeAllQueuedWorkflowActivations') "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-22T14:05:58.717Z | debug    | Lazy Loading credentials and nodes from n8n-nodes-base "{\n  credentials: 362,\n  nodes: 459,\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
2024-11-22T14:05:58.819Z | debug    | Lazy Loading credentials and nodes from @n8n/n8n-nodes-langchain "{\n  credentials: 15,\n  nodes: 81,\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
2024-11-22T14:05:59.517Z | info     | n8n ready on 0.0.0.0, port 5678 "{ file: 'abstract-server.js', function: 'init' }"
2024-11-22T14:05:59.618Z | warn     | Migrations in progress, please do NOT stop the process. "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:05:59.618Z | info     | Starting migration InitialMigration1588102412422 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:05:59.620Z | info     | Finished migration InitialMigration1588102412422 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:05:59.716Z | info     | Starting migration WebhookModel1592445003908 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:05:59.717Z | info     | Finished migration WebhookModel1592445003908 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:05:59.721Z | info     | Starting migration CreateIndexStoppedAt1594825041918 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:05:59.722Z | info     | Finished migration CreateIndexStoppedAt1594825041918 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:05:59.727Z | info     | Starting migration MakeStoppedAtNullable1607431743769 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:05:59.728Z | info     | Finished migration MakeStoppedAtNullable1607431743769 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:05:59.731Z | info     | Starting migration AddWebhookId1611071044839 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:05:59.733Z | info     | Finished migration AddWebhookId1611071044839 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:05:59.816Z | info     | Starting migration CreateTagEntity1617213344594 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:05:59.917Z | info     | Finished migration CreateTagEntity1617213344594 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:05:59.922Z | info     | Starting migration UniqueWorkflowNames1620821879465 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:05:59.923Z | info     | Finished migration UniqueWorkflowNames1620821879465 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:05:59.928Z | info     | Starting migration AddWaitColumn1621707690587 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:05:59.930Z | info     | Finished migration AddWaitColumn1621707690587 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:05:59.936Z | info     | Starting migration UpdateWorkflowCredentials1630330987096 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.017Z | info     | Finished migration UpdateWorkflowCredentials1630330987096 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.022Z | info     | Starting migration AddExecutionEntityIndexes1644421939510 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.024Z | info     | Finished migration AddExecutionEntityIndexes1644421939510 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.029Z | info     | Starting migration CreateUserManagement1646992772331 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.120Z | info     | Finished migration CreateUserManagement1646992772331 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.125Z | info     | Starting migration LowerCaseUserEmail1648740597343 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.125Z | info     | Finished migration LowerCaseUserEmail1648740597343 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.131Z | info     | Starting migration CommunityNodes1652254514001 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.216Z | info     | Finished migration CommunityNodes1652254514001 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.224Z | info     | Starting migration AddUserSettings1652367743993 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.235Z | info     | Finished migration AddUserSettings1652367743993 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.242Z | info     | Starting migration AddAPIKeyColumn1652905585850 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.326Z | info     | Finished migration AddAPIKeyColumn1652905585850 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.336Z | info     | Starting migration IntroducePinData1654089251344 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.337Z | info     | Finished migration IntroducePinData1654089251344 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.346Z | info     | Starting migration AddNodeIds1658930531669 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.347Z | info     | Finished migration AddNodeIds1658930531669 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.422Z | info     | Starting migration AddJsonKeyPinData1659888469333 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.423Z | info     | Finished migration AddJsonKeyPinData1659888469333 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.431Z | info     | Starting migration CreateCredentialsUserRole1660062385367 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.432Z | info     | Finished migration CreateCredentialsUserRole1660062385367 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.439Z | info     | Starting migration CreateWorkflowsEditorRole1663755770892 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.440Z | info     | Finished migration CreateWorkflowsEditorRole1663755770892 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.449Z | info     | Starting migration WorkflowStatistics1664196174000 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.450Z | info     | Finished migration WorkflowStatistics1664196174000 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.518Z | info     | Starting migration CreateCredentialUsageTable1665484192211 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.519Z | info     | Finished migration CreateCredentialUsageTable1665484192211 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.528Z | info     | Starting migration RemoveCredentialUsageTable1665754637024 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.529Z | info     | Finished migration RemoveCredentialUsageTable1665754637024 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.538Z | info     | Starting migration AddWorkflowVersionIdColumn1669739707124 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.539Z | info     | Finished migration AddWorkflowVersionIdColumn1669739707124 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"
2024-11-22T14:06:00.548Z | info     | Starting migration AddTriggerCountColumn1669823906993 "{ file: 'migration-helpers.js', function: 'logMigrationStart' }"
2024-11-22T14:06:00.617Z | info     | Finished migration AddTriggerCountColumn1669823906993 "{ file: 'migration-helpers.js', function: 'logMigrationEnd' }"

Information on your n8n setup

  • n8n version: 1.58.2
  • Database (default: SQLite): sqlite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n self-hosted in kubernetes
  • Operating system: Kubernetes

hello @Jeronimo_Jose_Diaz_G

At least, N8N_HOST variable should be an FQDN, not the url

Hello,

Thanks so much for the answer. Unfortunately, after removing the protocol and final slash from N8N_HOST environment variable, I still get below error which looks very similar to the one I was getting before updating the environment variable.

❯ kubectl logs -f n8n-prod-55bf6df9f8-8c2vd -n n8n
Defaulted container "n8n" out of: n8n, init-data-dir (init)
No encryption key found - Auto-generated and saved to: /home/node/.n8n/config
Invalid boolean value for DB_LOGGING_ENABLED: query
Loaded config overwrites from /n8n-config/config.json
2024-11-25T07:30:09.824Z | info     | Initializing n8n process "{ file: 'start.js', function: 'init' }"
2024-11-25T07:30:11.023Z | info     | Received SIGTERM. Shutting down... "{ file: 'base-command.js' }"
2024-11-25T07:30:11.024Z | debug    | Shutting down component "License.shutdown()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-25T07:30:11.025Z | error    | ComponentShutdownError: Failed to shutdown gracefully "{\n  component: 'License.shutdown()',\n  file: 'LoggerProxy.js',\n  function: 'exports.error'\n}"
2024-11-25T07:30:11.025Z | error    | ServiceNotFoundError: Service with "MaybeConstructable<DataSource>" identifier was not found in the container. Register it before usage via explicitly calling the "Container.set" function or using the "@Service()" decorator. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-25T07:30:11.026Z | debug    | Shutting down component "Push.onShutdown()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-25T07:30:11.223Z | debug    | Shutting down component "ActiveWorkflowManager.removeAllTriggerAndPollerBasedWorkflows()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-25T07:30:11.224Z | error    | ComponentShutdownError: Failed to shutdown gracefully "{\n  component: 'ActiveWorkflowManager.removeAllTriggerAndPollerBasedWorkflows()',\n  file: 'LoggerProxy.js',\n  function: 'exports.error'\n}"
2024-11-25T07:30:11.224Z | error    | ServiceNotFoundError: Service with "MaybeConstructable<DataSource>" identifier was not found in the container. Register it before usage via explicitly calling the "Container.set" function or using the "@Service()" decorator. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-25T07:30:11.225Z | debug    | Shutting down component "AbstractServer.onShutdown()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-25T07:30:11.225Z | debug    | Shutting down component "PruningService.shutdown()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-25T07:30:11.226Z | error    | ComponentShutdownError: Failed to shutdown gracefully "{\n  component: 'PruningService.shutdown()',\n  file: 'LoggerProxy.js',\n  function: 'exports.error'\n}"
2024-11-25T07:30:11.226Z | error    | ServiceNotFoundError: Service with "MaybeConstructable<DataSource>" identifier was not found in the container. Register it before usage via explicitly calling the "Container.set" function or using the "@Service()" decorator. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-25T07:30:11.226Z | debug    | Shutting down component "Telemetry.stopTracking()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-25T07:30:11.227Z | error    | ComponentShutdownError: Failed to shutdown gracefully "{\n  component: 'Telemetry.stopTracking()',\n  file: 'LoggerProxy.js',\n  function: 'exports.error'\n}"
2024-11-25T07:30:11.227Z | error    | ServiceNotFoundError: Service with "MaybeConstructable<DataSource>" identifier was not found in the container. Register it before usage via explicitly calling the "Container.set" function or using the "@Service()" decorator. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-25T07:30:11.227Z | info     |
Stopping n8n... "{ file: 'start.js', function: 'stopProcess' }"
2024-11-25T07:30:11.228Z | error    | Error: There was an error shutting down n8n. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-25T07:30:11.228Z | error    | TypeError: Cannot read properties of undefined (reading 'removeAllQueuedWorkflowActivations') "{ file: 'LoggerProxy.js', function: 'exports.error' }"

The main problem I have is I don’t understand what the error could be from the logs

I only can see there is improper value for the variable DB_LOGGING_ENABLED. It should be set as boolean (true / false)

Thanks @barn4k for your response.

I have updated the value of that variable and, unfortunately, n8n does not want to start yet. These are the logs

❯ kubectl logs -f n8n-prod-7fb6b789-6dbms -n n8n
Defaulted container "n8n" out of: n8n, init-data-dir (init)
No encryption key found - Auto-generated and saved to: /home/node/.n8n/config
Loaded config overwrites from /n8n-config/config.json
2024-11-26T06:55:32.304Z | info     | Initializing n8n process "{ file: 'start.js', function: 'init' }"
2024-11-26T06:55:33.595Z | info     | Received SIGTERM. Shutting down... "{ file: 'base-command.js' }"
2024-11-26T06:55:33.596Z | debug    | Shutting down component "License.shutdown()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-26T06:55:33.597Z | error    | ComponentShutdownError: Failed to shutdown gracefully "{\n  component: 'License.shutdown()',\n  file: 'LoggerProxy.js',\n  function: 'exports.error'\n}"
2024-11-26T06:55:33.597Z | error    | ServiceNotFoundError: Service with "MaybeConstructable<DataSource>" identifier was not found in the container. Register it before usage via explicitly calling the "Container.set" function or using the "@Service()" decorator. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-26T06:55:33.598Z | debug    | Shutting down component "Push.onShutdown()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-26T06:55:33.795Z | debug    | Shutting down component "ActiveWorkflowManager.removeAllTriggerAndPollerBasedWorkflows()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-26T06:55:33.795Z | error    | ComponentShutdownError: Failed to shutdown gracefully "{\n  component: 'ActiveWorkflowManager.removeAllTriggerAndPollerBasedWorkflows()',\n  file: 'LoggerProxy.js',\n  function: 'exports.error'\n}"
2024-11-26T06:55:33.796Z | error    | ServiceNotFoundError: Service with "MaybeConstructable<DataSource>" identifier was not found in the container. Register it before usage via explicitly calling the "Container.set" function or using the "@Service()" decorator. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-26T06:55:33.796Z | debug    | Shutting down component "AbstractServer.onShutdown()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-26T06:55:33.797Z | debug    | Shutting down component "PruningService.shutdown()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-26T06:55:33.797Z | error    | ComponentShutdownError: Failed to shutdown gracefully "{\n  component: 'PruningService.shutdown()',\n  file: 'LoggerProxy.js',\n  function: 'exports.error'\n}"
2024-11-26T06:55:33.798Z | error    | ServiceNotFoundError: Service with "MaybeConstructable<DataSource>" identifier was not found in the container. Register it before usage via explicitly calling the "Container.set" function or using the "@Service()" decorator. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-26T06:55:33.798Z | debug    | Shutting down component "Telemetry.stopTracking()" "{ file: 'shutdown.service.js', function: 'shutdownComponent' }"
2024-11-26T06:55:33.798Z | error    | ComponentShutdownError: Failed to shutdown gracefully "{\n  component: 'Telemetry.stopTracking()',\n  file: 'LoggerProxy.js',\n  function: 'exports.error'\n}"
2024-11-26T06:55:33.799Z | error    | ServiceNotFoundError: Service with "MaybeConstructable<DataSource>" identifier was not found in the container. Register it before usage via explicitly calling the "Container.set" function or using the "@Service()" decorator. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-26T06:55:33.799Z | info     |
Stopping n8n... "{ file: 'start.js', function: 'stopProcess' }"
2024-11-26T06:55:33.799Z | error    | Error: There was an error shutting down n8n. "{ file: 'LoggerProxy.js', function: 'exports.error' }"
2024-11-26T06:55:33.800Z | error    | TypeError: Cannot read properties of undefined (reading 'removeAllQueuedWorkflowActivations') "{ file: 'LoggerProxy.js', function: 'exports.error' }"

Log level is set to debug but I am still missing more information in the logs. Is there a way to get more info to know what is going on? Any hint to try to get it up and running?

How are you starting it? seems it starts and right after it receives an exit signal…

I am using helm chart to deploy it GitHub - 8gears/n8n-helm-chart: A Kubernetes Helm chart for n8n - a workflow automation tool. Easily automate tasks across different services on self hosted onKubernetes

What it basically does is to deploy a pod (container) in kubernetes to run n8n. The definition of the pod that is being deployed into kubernetes is below

apiVersion: v1
kind: Pod
metadata:
  labels:
    app.kubernetes.io/instance: n8n-prod
    app.kubernetes.io/name: n8n
    app.kubernetes.io/type: master
    pod-template-hash: 7fb6b789
  name: n8n-prod-7fb6b789-6dbms
  namespace: n8n
spec:
  containers:
    - env:
        - name: DB_LOGGING_ENABLED
          value: 'true'
        - name: DB_SQLITE_VACUUM_ON_STARTUP
          value: 'true'
        - name: DB_TYPE
          value: sqlite
        - name: N8N_COMMUNITY_PACKAGES_ENABLED
          value: 'false'
        - name: N8N_EDITOR_BASE_URL
          value: https://xxxxxx/
        - name: N8N_HOST
          value: xxxxxxx
        - name: N8N_LOG_LEVEL
          value: debug
        - name: N8N_METRICS
          value: 'true'
        - name: N8N_PORT
          value: '5678'
        - name: N8N_CONFIG_FILES
          value: /n8n-config/config.json
      image: n8nio/n8n:1.58.2
      imagePullPolicy: IfNotPresent
      lifecycle: {}
      livenessProbe:
        failureThreshold: 3
        httpGet:
          path: /healthz
          port: http
          scheme: HTTP
        periodSeconds: 10
        successThreshold: 1
        timeoutSeconds: 1
      name: n8n
      ports:
        - containerPort: 5678
          name: http
          protocol: TCP
      readinessProbe:
        failureThreshold: 3
        httpGet:
          path: /healthz
          port: http
          scheme: HTTP
        periodSeconds: 10
        successThreshold: 1
        timeoutSeconds: 1
      resources:
        limits:
          cpu: 100m
          memory: 128Mi
        requests:
          cpu: 100m
          memory: 128Mi
      securityContext: {}
      terminationMessagePath: /dev/termination-log
      terminationMessagePolicy: File
      volumeMounts:
        - mountPath: /home/node/.n8n
          name: data
        - mountPath: /n8n-config
          name: config-volume
        - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
          name: kube-api-access-8hv58
          readOnly: true
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  initContainers:
    - command:
        - /bin/sh
        - '-c'
        - mkdir -p /home/node/.n8n/
      image: n8nio/n8n:1.58.2
      imagePullPolicy: IfNotPresent
      name: init-data-dir
      resources: {}
      terminationMessagePath: /dev/termination-log
      terminationMessagePolicy: File
      volumeMounts:
        - mountPath: /home/node/.n8n
          name: data
        - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
          name: kube-api-access-8hv58
          readOnly: true
  nodeName: xxxxxxxxxx
  preemptionPolicy: PreemptLowerPriority
  priority: 0
  restartPolicy: Always
  schedulerName: default-scheduler
  securityContext:
    fsGroup: 1000
    runAsGroup: 1000
    runAsNonRoot: true
    runAsUser: 1000
  serviceAccount: n8n-prod
  serviceAccountName: n8n-prod
  terminationGracePeriodSeconds: 30
  tolerations:
    - effect: NoExecute
      key: node.kubernetes.io/not-ready
      operator: Exists
      tolerationSeconds: 300
    - effect: NoExecute
      key: node.kubernetes.io/unreachable
      operator: Exists
      tolerationSeconds: 300
  volumes:
    - name: data
      persistentVolumeClaim:
        claimName: n8n-prod
    - configMap:
        defaultMode: 420
        name: n8n-prod
      name: config-volume
    - name: kube-api-access-8hv58
      projected:
        defaultMode: 420
        sources:
          - serviceAccountToken:
              expirationSeconds: 3607
              path: token
          - configMap:
              items:
                - key: ca.crt
                  path: ca.crt
              name: kube-root-ca.crt
          - downwardAPI:
              items:
                - fieldRef:
                    apiVersion: v1
                    fieldPath: metadata.namespace
                  path: namespace

And the config defined in /n8n-config/config.json is

config.json: |
    {
      "executions": {
        "pruneData": "true",
        "pruneDataMaxAge": 3760
      }
    }

I think 128Mb is too low for n8n to operate. Try with 512

1 Like

@barn4k That was the issue. Too low resources assigned to the pod. Thanks so much for all your help.

Kind regards

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.