於docker-compose.yml增加以下設定 --- # Clear EXECUTIONS_DATA # Enable executions pruning - EXECUTIONS_DATA_PRUNE=true # How old (hours) a finished execution must be to qualify for soft-deletion - EXECUTIONS_DATA_MAX_AGE=168 # Max number of finished executions to keep. - EXECUTIONS_DATA_PRUNE_MAX_COUNT=5000 ---
Attempt to read execution was blocked due to insufficient permissions
Unable to stop execution "2070" as it was not found
AI協助提供以下答案:
EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS設為false,手動執行只會跑邏輯,不會在DB存完整的執行紀錄。這會導致前端或 API 在讀取/停止該執行時找不到對應資料,就可能會出現的兩個錯誤訊息。
Attempt to read execution was blocked due to insufficient permissions 錯誤
在UI在點「測試工作流程」或打開節點執行結果時,會去讀對應的 execution 資料;若該 ID 在 DB 裡沒有對應內容(因為手動執行未被儲存或已被清除),就可能出現「Attempt to read execution was blocked due to insufficient permissions」這類訊息,實際上常見原因之一是 execution record 不存在或不完整,而非真的RBAC權限錯誤。
Ubuntu 24.04.3 LTS Docker version v28.5.1 Docker compose version v2.40.3 n8n Community Edition version 1.118.1 (n8nio/n8n)
PostgreSQL version 17 (PostgreSQL Docker Community) Admer version 5.4.1
There are deprecations related to your environment variables. Please take the recommended actions to update your configuration: - N8N_BLOCK_ENV_ACCESS_IN_NODE -> The default value of N8N_BLOCK_ENV_ACCESS_IN_NODE will be changed from false to true in a future version. If you need to access environment variables from the Code Node or from expressions, please set N8N_BLOCK_ENV_ACCESS_IN_NODE=false. Learn more: https://docs.n8n.io/hosting/configuration/environment-variables/security/
- N8N_GIT_NODE_DISABLE_BARE_REPOS -> Support for bare repositories in the Git Node will be removed in a future version due to security concerns. If you are not using bare repositories in the Git Node, please set N8N_GIT_NODE_DISABLE_BARE_REPOS=true. Learn more: https://docs.n8n.io/hosting/configuration/environment-variables/security/
Ubuntu 24.04.3 LTS
Docker version v28.5.1
Docker compose version v2.40.3
n8n Community Edition version 1.116.2 (1.118.1) (n8nio/n8n)
PostgreSQL version 17 (PostgreSQL Docker Community)
安裝過程
1.使用者目錄建立n8n-postgres、n8n_data目錄及.env設定檔
將n8n_data目錄掛載到/home/node/.n8n目錄,當container重啟動後資料可以保留。
mkdir n8n-postgres/n8n_data/ -p
新建.env設定檔存放相關參數 (PostgreSQL user and password ),執行docker compose會自動帶入。
vim n8n-postgres/.env
---
POSTGRES_USER=changeUser
POSTGRES_PASSWORD=changePassword
POSTGRES_DB=n8n
POSTGRES_NON_ROOT_USER=changeUser
POSTGRES_NON_ROOT_PASSWORD=changePassword
---
啟動n8n、PostgreSQL服務
sudo docker compose up -d
啟動過程會依n8n、PostgreSQL啟動
檢查n8n、PostgreSQL服務
sudo docker compose ps -a
ls -la
ss -ntlp
3.問題解決
原本使用n8n最新版本1.118.1,出現Connection lost無法連線PostgreSQL的訊息
You have a connection issue or the server is down.
n8n should reconnect automatically once the issue is resolved.
查詢網站無法有效解決。後來發現n8n 版本1.116.2可以正常使用,先用此版本進行測試。
重新啟動n8n服務 sudo docker compose down sudo docker compose up -d
成功看到註冊面,直接設定帳號資料,密碼要8位數以上,要有數字和大寫字母。
如果要使用Community Edition 功能,請輸入正確的email方便收到註冊碼。
5.登入畫面
此畫面可以直接按get started跳過。
申請Community Edition License key,填入email就可以收到
n8n free license key mail
未輸入 license key
輸入 license key啟動後
註冊後即可解鎖社群版(Community Edition) 的以下功能:
Folders: Organize your workflows into tidy folders 資料夾 :將您的工作流程整理到整齊的資料夾中 Debug in editor: Copy and pin execution data when working on a workflow 在編輯器中偵錯 :在處理工作流程時複製並固定執行數據 Custom execution data: Save, find, and annotate execution metadata 自訂執行資料 :儲存、尋找和註解執行元數據
There is a deprecation related to your environment variables. Please take the recommended actions to update your configuration:
- DB_SQLITE_POOL_SIZE -> Running SQLite without a pool of read connections is deprecated. Please set `DB_SQLITE_POOL_SIZE` to a value higher than zero. See: https://docs.n8n.io/hosting/configuration/environment-variables/database/#sqlite