Skip to content

Invalid value for N8N_BINARY_DATA_DATABASE_MAX_FILE_SIZE - Expected number, received string. Falling back to default value. #23919

@davidpanic

Description

@davidpanic

Bug Description

The environment variable N8N_BINARY_DATA_DATABASE_MAX_FILE_SIZE cannot be set because it is trying to read a number from the environment. Environment variables are always strings so that makes no sense.

I am 100% sure the variable is set correctly, I've verified it like this:

$kubectl get pod n8n-767d767dff-t6zzs -o json | jq '.spec.containers[0].env[2]'
{
  "name": "N8N_BINARY_DATA_DATABASE_MAX_FILE_SIZE",
  "value": "1024"
}

I believe this is where the issue lies, the type should be changed to a string:

https://github.com/n8n-io/n8n/blob/master/packages/core/src/binary-data/binary-data.config.ts#L42

To Reproduce

  1. Set environment N8N_BINARY_DATA_DATABASE_MAX_FILE_SIZE=1024
  2. Observe the following error in the logs: Invalid value for N8N_BINARY_DATA_DATABASE_MAX_FILE_SIZE - Expected number, received string. Falling back to default value.

Expected behavior

I expect to be able to change the value to 1024.

Debug Info

Debug info

core

  • n8nVersion: 2.1.2
  • platform: docker (self-hosted)
  • nodeJsVersion: 22.21.1
  • nodeEnv: production
  • database: postgres
  • executionMode: scaling (single-main)
  • concurrency: -1
  • license: enterprise (production)
  • consumerId: [REDACTED]

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: database

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (x11; linux x86_64; rv:146.0) gecko/20100101 firefox/146.0
  • isTouchDevice: false

Generated at: 2026-01-06T13:06:51.643Z

Operating System

Kubernetes 1.27.1

n8n Version

2.1.2

Node.js Version

22.21.1

Database

PostgreSQL

Execution mode

main (default)

Hosting

self hosted

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions