ouTube Node Upload Fails with 400 Error – Despite Correct API Permissions & Binary Data Mode

Hello n8n community,

I’m encountering a persistent 400 Bad Request error when trying to upload videos to YouTube using the YouTube Node in n8n (v1.85.4, self-hosted). Here’s what I’ve tried so far:

Error Details:

json

Copy

{ “errorMessage”: “Request failed with status code 400”, “errorDetails”: {}, “n8nDetails”: { “n8nVersion”: “1.85.4 (Self Hosted)”, “binaryDataMode”: “default”, “stackTrace”: […] } }

Steps Taken:

  1. Google API Permissions:
  • Enabled YouTube Data API v3 in Google Cloud Console.
  • Granted OAuth scope for https://www.googleapis.com/auth/youtube.upload.
  • Verified API quotas are not exceeded.
  1. Binary Data Configuration:
  • Set N8N_DEFAULT_BINARY_DATA_MODE=filesystem (also tried default).
  • Confirmed file paths are correct and accessible.
  1. Workflow Debugging:
  • Tested with small video files (<100MB).
  • Verified OAuth credentials are valid (other YouTube API calls work).

Questions:

  • Are there hidden requirements for video uploads (e.g., metadata format, file encoding)?
  • Could this be a self-hosting issue (e.g., proxy, filesystem permissions)?
  • Has anyone resolved a similar 400 error?

Logs/Additional Context:

  • No further details in errorDetails (unhelpful for debugging).
  • Stack trace points to YouTube.node.js and Axios, but no clear cause.

Any guidance would be appreciated!


Information on your n8n setup

  • n8n version:1.85.4
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):coolify
  • **Operating system:Ubuntu **

Hi, might be a long shot, but your media filename seems to be very weird with underscores. Maybe the url/uri encoding is not done correctly or the node doesn’t set the content type correctly (bcs of _mp4) / or you need to set it manually. A simple test would be to rename it to test.mp4 and/or try to set the content type manually. I would try those things before anything else.

reg,
J.

Thanks for idea, didn’t help.

Double checked if all scopes are granted, noticed that they not approved yet. I guess that is the issues.

Waiting google to verify

1 Like

Interesting thing. I tried the same workflow on n8n cloud and everything worked.

But not on self hosted.

In both instances did use the same Google credentials. Can someone suggest how to find the source of problem?

In coolify n8n logs i can not find the problem. Error 200 in Youtube documents doesn’t really provide much context of cause.

Can’t it be because of the fact in google auth you need to set an source domain/website, beside a callback URL? maybe it checks something there when making actual calls.

I have added already idomain to Authorised domains. Right now I try to figure out how to enable more detailed n8n container logs, so I could understand more of the 400 issue.

So the non-working one, is also listed in these authorized domains? since you are showing only the working one. It could be even as silly as a non-synchronized clock I guess. many possibilities

yes it is listed

I can use all other Youtube nodes and they work,

have you managed to sort out this problem?

You have to set N8N_DEFAULT_BINARY_DATA_MODE=filesystem. This worked for me on self-hosted n8n. I am using Coolify, though.