描述問題/錯誤/問題
大家好,
我在使用「從磁碟讀寫檔案」節點 (v1.1) 執行「寫入檔案到磁碟」操作時遇到持續性問題。無論是哪個資料夾、使用者權限或執行模式如何,它都會持續拋出一個錯誤,指出該檔案不可寫入。
我的環境:
- n8n 版本:2.26.4 (自託管)
- 執行模式:在原生 Windows (Node.js 設定) 和透過 Docker Desktop (WSL2 後端) 上都有測試。
- 資料庫模式:已同時測試 binaryDataMode: filesystem 和 binaryDataMode: database。
我已經嘗試過的方法:
- 原生 Windows:目標是本地資料夾 (C:\n8n\poema.json) 和暫存路徑。出現「不可寫入」錯誤。
- Docker (標準使用者):掛載磁碟區 -v c:/n8n:/data 並目標設為 /data/poema.json。失敗。
- Docker 隔離路徑:嘗試直接寫入 Docker 容器原生路徑,如 /tmp/poema.json 和 /home/node/poema.json。失敗,出現完全相同的錯誤。
- 預先建立檔案:我在目的地資料夾內手動建立了一個空的 poema.json 檔案 (0 KB),以檢查這是否是建立與更新的問題。仍然拋出「不可寫入」。
- Docker Root 使用者:重新建立容器,強制使用 root 使用者 (-u root) 以繞過掛載磁碟區上任何可能的主機/容器權限衝突。此行為仍然存在。
錯誤堆棧追蹤:
{
"errorMessage": "The file \"/data/poema.json\" is not writable.",
"errorDetails": {
"rawErrorMessage": [
"The file \"/data/poema.json\" is not writable."
]
},
"n8nDetails": {
"nodeName": "Read/Write Files from Disk",
"nodeType": "n8n-nodes-base.readWriteFile",
"nodeVersion": 1.1,
"operation": "write",
"itemIndex": 0,
"n8nVersion": "2.26.4 (Self Hosted)",
"stackTrace": [
"NodeApiError: The file \"/data/poema.json\" is not writable.",
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Files/ReadWriteFile/actions/write.operation.ts:130:10)"
]
}
}
由於即使在以 root 身份執行的容器內的 /tmp/ 中也會發生這種情況,看起來像是節點的內部驗證邏輯中存在誤報 (特別是在 write.operation.ts:130 附近)。
這是 v2.26.x 中已知的回退問題,還是有任何特定的環境變數我應該調整以修復此驗證檢查?
提前感謝您的幫助!
錯誤訊息是什麼 (如有的話)?
{
“errorMessage”: “The file "/data/poema.json" is not writable.”,
“errorDetails”: {
“rawErrorMessage”: [
“The file "/data/poema.json" is not writable.”
]
},
“n8nDetails”: {
“nodeName”: “Read/Write Files from Disk”,
“nodeType”: “n8n-nodes-base.readWriteFile”,
“nodeVersion”: 1.1,
“operation”: “write”,
“itemIndex”: 0,
“n8nVersion”: “2.26.4 (Self Hosted)”,
“stackTrace”: [
“NodeApiError: The file "/data/poema.json" is not writable.”,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Files/ReadWriteFile/actions/write.operation.ts:130:10)"
]
}
}
請分享您的工作流程
該工作流程是一個簡單的 3 節點結構:
HTTP 請求
轉換為檔案
從磁碟讀寫檔案 (寫入操作)。
「轉換為檔案」節點成功輸出二進位資料 (約 27.5 kB),但執行在「從磁碟讀寫檔案」節點處完全停止。
分享最後一個節點返回的輸出
我在使用「從磁碟讀寫檔案」節點 (v1.1) 執行「寫入檔案到磁碟」操作時遇到持續性問題。無論是哪個資料夾、使用者權限或執行模式如何,它都會持續拋出「不可寫入」錯誤。
我已經嘗試過以下方法來隔離問題:
- 原生 Windows:目標是本地資料夾 (C:\n8n\poema.json) 和暫存路徑。出現錯誤。
- Docker (標準使用者):掛載磁碟區 -v c:/n8n:/data 並目標設為 /data/poema.json。失敗。
- Docker 隔離路徑:嘗試直接寫入 Docker 容器原生路徑,如 /tmp/poema.json 和 /home/node/poema.json。失敗,出現完全相同的錯誤。
- 預先建立檔案:我在目的地資料夾內手動建立了一個空的 poema.json 檔案 (0 KB),以檢查這是否是建立與更新的問題。仍然拋出「不可寫入」。
- Docker Root 使用者:重新建立容器,強制使用 root 使用者 (-u root) 以繞過掛載磁碟區上任何可能的主機/容器權限衝突。此行為仍然存在。
由於即使在以 root 身份執行的容器內的 /tmp/ 中也會發生這種情況,看起來像是節點的內部驗證邏輯中存在誤報 (特別是在 write.operation.ts:130 附近)。
您的 n8n 設定資訊
-
n8n 版本:
-
資料庫 (預設值:SQLite):
-
n8n EXECUTIONS_PROCESS 設定 (預設值:own, main):
-
透過以下方式執行 n8n (Docker、npm、n8n cloud、桌面應用程式):
-
作業系統:
-
n8n 版本:2.26.4 (自託管)
-
資料庫:SQLite (預設值)
-
執行模式:標準 (也透過 Docker / WSL2 後端進行了測試)
-
二進位資料模式:database (也使用 filesystem 進行了測試)