Skip to content

Conversation

@SashkoMarchuk
Copy link
Contributor

…file uploading

@SashkoMarchuk SashkoMarchuk requested a review from killev as a code owner August 5, 2025 13:02
@coderabbitai
Copy link

coderabbitai bot commented Aug 5, 2025

📝 Walkthrough

Walkthrough

A new environment variable, N8N_DEFAULT_BINARY_DATA_MODE=filesystem, was added to the n8n service in the docker-compose.prod.yml configuration file. No other modifications were made to logic, control flow, or error handling.

Changes

Cohort / File(s) Change Summary
Docker Compose Production Config
docker-compose.prod.yml
Added N8N_DEFAULT_BINARY_DATA_MODE=filesystem environment variable to the n8n service configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • killev
  • DenisChistyakov

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a6eaa04 and 6c63168.

📒 Files selected for processing (1)
  • docker-compose.prod.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-28T16:44:50.073Z
Learning: Applies to Dockerfile.n8n : Use Dockerfile.n8n for custom n8n image configuration.
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to volumes/**/* : All service data must be persisted in Docker volumes mapped to the local volumes/ directory, such as ./volumes/n8n_data, ./volumes/opensearch-data, and ./volumes/postgresql-data
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to docker-compose.yml : Services must communicate over an internal Docker network with only the specified ports exposed: n8n (5678), Temporal (7233), Temporal UI (8080), PostgreSQL (5432), and OpenSearch (9200)
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to Dockerfile.{n8n,temporal} : Custom Docker images must be defined using Dockerfile.n8n and Dockerfile.temporal, each extending their respective official base images with custom configurations
📚 Learning: applies to docker-compose.yml : services must communicate over an internal docker network with only ...
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to docker-compose.yml : Services must communicate over an internal Docker network with only the specified ports exposed: n8n (5678), Temporal (7233), Temporal UI (8080), PostgreSQL (5432), and OpenSearch (9200)

Applied to files:

  • docker-compose.prod.yml
📚 Learning: applies to docker-compose.yml : all service configurations, including service dependencies, volume m...
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to docker-compose.yml : All service configurations, including service dependencies, volume mounts, network configuration, environment variables, and port mappings, must be defined in docker-compose.yml

Applied to files:

  • docker-compose.prod.yml
📚 Learning: applies to dockerfile.n8n : use dockerfile.n8n for custom n8n image configuration....
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-28T16:44:50.073Z
Learning: Applies to Dockerfile.n8n : Use Dockerfile.n8n for custom n8n image configuration.

Applied to files:

  • docker-compose.prod.yml
📚 Learning: applies to dockerfile.{n8n,temporal} : custom docker images must be defined using dockerfile.n8n and...
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to Dockerfile.{n8n,temporal} : Custom Docker images must be defined using Dockerfile.n8n and Dockerfile.temporal, each extending their respective official base images with custom configurations

Applied to files:

  • docker-compose.prod.yml
📚 Learning: applies to docker-compose.yml : the repository must include a docker-compose.yml file as the main se...
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-28T16:44:50.073Z
Learning: Applies to docker-compose.yml : The repository must include a docker-compose.yml file as the main service orchestration configuration.

Applied to files:

  • docker-compose.prod.yml
📚 Learning: the project architecture must include interconnected services: n8n, temporal server, temporal ui, po...
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-28T16:44:50.073Z
Learning: The project architecture must include interconnected services: n8n, Temporal Server, Temporal UI, PostgreSQL, and OpenSearch, each running on their specified ports.

Applied to files:

  • docker-compose.prod.yml
📚 Learning: applies to dockerfile.temporal : use dockerfile.temporal for custom temporal image configuration....
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-28T16:44:50.073Z
Learning: Applies to Dockerfile.temporal : Use Dockerfile.temporal for custom Temporal image configuration.

Applied to files:

  • docker-compose.prod.yml
📚 Learning: applies to volumes/**/* : all service data must be persisted in docker volumes mapped to the local v...
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to volumes/**/* : All service data must be persisted in Docker volumes mapped to the local volumes/ directory, such as ./volumes/n8n_data, ./volumes/opensearch-data, and ./volumes/postgresql-data

Applied to files:

  • docker-compose.prod.yml

Comment on lines 21 to +22
- N8N_BLOCKED_NODES=n8n-nodes-base.executeCommand,n8n-nodes-base.ssh
- N8N_DEFAULT_BINARY_DATA_MODE=filesystem
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Persist binary data to a Docker volume

N8N_DEFAULT_BINARY_DATA_MODE=filesystem saves uploads to the container’s local disk.
Unless that directory is persisted via a named volume, all files will vanish on every redeploy.

Recommended follow-up:

       - N8N_DEFAULT_BINARY_DATA_MODE=filesystem
+      # Explicitly set the path and document it
+      - N8N_BINARY_DATA_STORAGE_PATH=/data/n8n

…and ensure the n8n service includes

volumes:
  - n8n_data:/data/n8n

This aligns with the team rule that all service data must be persisted in ./volumes/-mapped Docker volumes.


🏁 Script executed:

#!/bin/bash
# Check for existing n8n data volume mappings in docker-compose.prod.yml
grep -R "n8n" -n docker-compose.prod.yml | grep -A3 -i "volumes"
echo "-----"
grep -R "./volumes" -n docker-compose.prod.yml || echo "No local volumes bind mounts found"

Length of output: 207


🏁 Script executed:

#!/bin/bash
set -e
echo "=== n8n service block ==="
grep -R -n "^[[:space:]]*n8n:" -n docker-compose.prod.yml -A20

echo
echo "=== Root-level volumes definitions ==="
grep -R -n "^volumes:" -n docker-compose.prod.yml -A20

Length of output: 1654


Persist n8n binary data via Docker volume

The n8n service currently writes uploads to the container’s filesystem (N8N_DEFAULT_BINARY_DATA_MODE=filesystem) but doesn’t mount any volume at /data/n8n, so all files will be lost on each redeploy.

Apply these changes in docker-compose.prod.yml:

services:
  n8n:
    environment:
      - N8N_DEFAULT_BINARY_DATA_MODE=filesystem
+     - N8N_BINARY_DATA_STORAGE_PATH=/data/n8n
    volumes:
+     - n8n_data:/data/n8n

Ensure your root-level volume definition binds into ./volumes/n8n_data per project conventions:

volumes:
  n8n_data:
    driver: local
    driver_opts:
      type: none
      o: bind
-     device: /data/n8n
+     device: ./volumes/n8n_data

This guarantees that all binary uploads persist across deployments under volumes/n8n_data.

🤖 Prompt for AI Agents
In docker-compose.prod.yml around lines 21 to 22, the n8n service is set to
store binary data on the container filesystem without mounting a volume, causing
data loss on redeploy. Fix this by adding a volume mount for the n8n service
that binds the container path /data/n8n to a host directory like
./volumes/n8n_data. Also, define this volume at the root level of the
docker-compose file to ensure persistent storage of binary uploads across
deployments.

Copy link
Contributor

@killev killev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct

Copy link
Contributor

@killev killev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read suggestion from coderabbit

@SashkoMarchuk
Copy link
Contributor Author

Reason for closing. Already updated in #82

@SashkoMarchuk SashkoMarchuk deleted the patch-1 branch August 5, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants