fix(update): add timeout to prevent pull command from hanging

- Add --max-time 600 (10 min) to curl pull command
- Add timeout: 660 to n8n executeCommand node

Docker's /images/create API streams progress until complete.
Without timeout, large image pulls could hang indefinitely.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lucas Berger
2026-02-02 20:50:22 -05:00
parent b0b22c3b39
commit 4f85e00dc4
+4 -2
View File
@@ -1564,7 +1564,7 @@
},
{
"parameters": {
"jsCode": "// Build pull image command\nconst imageName = $json.imageName;\n\nreturn {\n json: {\n cmd: `curl -s --unix-socket /var/run/docker.sock -X POST 'http://localhost/v1.47/images/create?fromImage=${encodeURIComponent(imageName)}'`,\n imageName,\n currentImageId: $json.currentImageId,\n currentVersion: $json.currentVersion,\n containerConfig: $json.containerConfig,\n hostConfig: $json.hostConfig,\n networkSettings: $json.networkSettings,\n containerName: $json.containerName,\n containerId: $json.containerId,\n chatId: $json.chatId\n }\n};"
"jsCode": "// Build pull image command\nconst imageName = $json.imageName;\n\nreturn {\n json: {\n cmd: `curl -s --max-time 600 --unix-socket /var/run/docker.sock -X POST 'http://localhost/v1.47/images/create?fromImage=${encodeURIComponent(imageName)}'`,\n imageName,\n currentImageId: $json.currentImageId,\n currentVersion: $json.currentVersion,\n containerConfig: $json.containerConfig,\n hostConfig: $json.hostConfig,\n networkSettings: $json.networkSettings,\n containerName: $json.containerName,\n containerId: $json.containerId,\n chatId: $json.chatId\n }\n};"
},
"id": "code-build-pull-cmd",
"name": "Build Pull Command",
@@ -1578,7 +1578,9 @@
{
"parameters": {
"command": "={{ $json.cmd }}",
"options": {}
"options": {
"timeout": 660
}
},
"id": "exec-pull-image",
"name": "Pull Image",