n8n workflow stuck and producing corrupted data during execution

I’m having trouble with my n8n workflow on a Docker container. It’s a simple setup that takes an image from a web UI and saves it on the server. The workflow has a Webhook node and a write-to-binary node.

Recently, it stopped working after I tried to install an exif-parsing library. Now when I run it, the execution hangs and returns a 500 error. The n8n UI shows the execution as “running…” forever. The file gets written but it’s corrupt.

The logs show a problem writing binary data from the tmp folder to the binary_data folder. I’ve tried to fix it but no luck. Any ideas on how to troubleshoot this? I’m worried about rebuilding from scratch because of all the custom changes I’ve made.

Here’s a simplified version of my workflow:

const workflow = {
  nodes: [
    {
      name: 'ImageReceiver',
      type: 'webhook',
      parameters: {
        method: 'POST',
        path: '/upload-image'
      }
    },
    {
      name: 'SaveImage',
      type: 'fileWriter',
      parameters: {
        destination: '/images/',
        fileName: '={{$json.filename}}'
      }
    }
  ],
  connections: {
    ImageReceiver: {
      main: [['SaveImage']]
    }
  }
};

Any help would be great. I’m stuck!

I’ve dealt with similar n8n issues, and it’s often related to Node.js version conflicts or memory allocation problems. First, try increasing the memory limit for your Docker container. You can do this by adding the --memory flag when running the container, like ‘docker run --memory=4g your-n8n-image’.

If that doesn’t work, check your Node.js version. n8n can be picky about versions, and the exif library might have introduced incompatibilities. Try rolling back to a previous Node.js version that you know worked.

Also, don’t overlook network issues. Sometimes, firewall rules or proxy settings can interfere with n8n’s ability to write files. Double-check your network configuration, especially if you’re running this in a corporate environment.

Lastly, if you’re worried about losing your custom changes, consider using version control like Git. It’ll let you experiment while keeping your original setup safe. Good luck troubleshooting!

hey there, had similar issues before. sounds like ur tmp folder might be full or have permission probs. try clearing it out or checking permissions. Also, make sure the exif lib didn’t mess with ur dependencies. if all else fails, u could try rolling back to a previous version.

I’ve encountered similar issues with n8n workflows before. Based on your description, it seems the problem might be related to file system permissions or disk space constraints. First, check if your Docker container has sufficient disk space available. You can use the ‘docker system df’ command to view disk usage.

Next, verify the permissions on both the tmp and binary_data folders. Ensure the n8n process has read/write access to these directories. You might need to adjust the ownership or permissions using ‘chown’ or ‘chmod’ commands.

If these steps don’t resolve the issue, consider reviewing your Docker configuration. Sometimes, volume mounts can cause unexpected behavior. Double-check your Docker-compose file or run command to ensure the necessary volumes are correctly mapped.

Lastly, if you’re concerned about losing your custom changes, I’d recommend backing up your current configuration before attempting any major changes or rebuilds. This way, you can always revert if needed.