n8n workflow stalling and producing corrupted output

I’m having trouble with my n8n setup in Docker. My workflow used to work fine but now it’s acting up. It’s supposed to take an image from a web form and save it on the server. But now it just hangs forever and spits out a broken file.

When I try to run it, the API call times out with a 500 error. The n8n dashboard shows the workflow as stuck in “running” mode. The output file is there but it’s messed up and won’t open as an image.

The logs show some error about moving files between folders. I’ve tried asking ChatGPT but I’m stumped. Any ideas on how to fix this or what might be causing it? I’d rather not start from scratch if I can help it.

Here’s a simplified version of my workflow:

const workflow = {
  nodes: [
    {
      type: 'webhook',
      method: 'PUT',
      path: '/upload-image'
    },
    {
      type: 'saveBinaryFile',
      filename: '{{query.imageName}}.jpg',
      data: '{{body.imageData}}'
    }
  ]
};

Any help would be awesome!

Have you considered checking your Docker network configuration? Sometimes network issues can cause timeouts and file corruption. Try inspecting your Docker network with ‘docker network ls’ and ensure n8n can communicate properly. Also, verify your volume mounts are correct - misconfigurations there could explain the file moving errors. If those check out, you might want to examine your n8n version compatibility with your current setup. Upgrading or downgrading n8n could potentially resolve the issue. Lastly, don’t forget to clear your workflow cache - stale data there can cause unexpected behavior.

hey there, sounds like a real headache! have u checked ur docker container’s memory usage? sometimes when it maxes out, weird stuff happens. also, double-check ur file paths - maybe theres a typo somewhere? if all else fails, try rolling back to an older version of n8n. good luck!

I have experienced similar issues with n8n workflows in Docker. In my case, the problem turned out to be related to file permissions and available disk space. I suggest verifying that your Docker container has enough free space using a command like ‘docker system df’. It is also important to check whether the output directory is accessible and writable by n8n, as permission issues can lead to file corruption and stalled processes.

Additionally, evaluate any recent changes to your Docker configuration or the n8n version that could affect network communication or volume mappings. A close inspection of the n8n logs may reveal further clues on file operations or network timeouts. I hope this approach helps you resolve the issue.