HTTP Request generates error

After updating to n8n 0.139.1 a workflow that has been successfully running for a long time suddenly generates an error in the HTTP Request step: Request failed with status code 415

This is from the error details:
"stack": "Error: Request failed with status code 415 at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21)",

Has something changed in the HTTP Request node recently? Is this a bug?

As far as I know nothing has changed on the backend I connect to (ownCloud).

Update: I went back to a previous docker image. No error with n8n 0.137.0

Hey @vco1,

Thank you for reporting this error. We changed the underlying request library that was used earlier to make the API calls. This post might help: Get Cookie After Login - #11 by jan

Hey @vco1 welcome to our forums!

Yes, we actually did change the underlying library that performs the http requests.

Can you share some more details of the request you are calling?

Information such as Content-type , file type, etc, all can be useful. We performed some testing and it was all working fine, but these errors are possible.

It would be amazing if you could share the workflow with us, so I can better identify what can be causing the issue.

Hi @krynble,

This is the HTTP Request Node:

      "parameters": {
        "authentication": "basicAuth",
        "requestMethod": "PUT",
        "url": "={{$node[\"IMAP Email\"].json[\"metadata\"][\"message-id\"].substring(1, $node[\"IMAP Email\"].json[\"metadata\"][\"message-id\"].indexOf(\"@\"))}}.ics",
        "responseFormat": "string",
        "jsonParameters": true,
        "options": {
          "bodyContentType": "raw"
        "bodyParametersJson": "=BEGIN:VCALENDAR\nBEGIN:VTODO\nDTSTART:{{$node[\"Date & Time2\"].json[\"startdate\"]}}\nDUE:{{$node[\"Date & Time\"].json[\"duedate\"]}}\nSUMMARY:Summary name {{$node[\"IMAP Email\"].json[\"subject\"].substring($node[\"IMAP Email\"].json[\"subject\"].indexOf('(')+1,$node[\"IMAP Email\"].json[\"subject\"].lastIndexOf('-')-1)}}\nSTATUS:NEEDS-ACTION\nUID:{{$node[\"Function\"].json[\"uid\"]}}\nDESCRIPTION:Betreft: {{$node[\"IMAP Email\"].json[\"textPlain\"].substring($node[\"IMAP Email\"].json[\"textPlain\"].indexOf('inzake')+7,$node[\"IMAP Email\"].json[\"textPlain\"].indexOf('<br>',$node[\"IMAP Email\"].json[\"textPlain\"].indexOf('inzake')+7)-1)}}\nSEQUENCE:1\nEND:VTODO\nEND:VCALENDAR"
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
      "credentials": {
        "httpBasicAuth": "my Auth"

Hey @vco1 I’m sorry about the delay. I have not yet found the exact issue but I would recommend you change an environment variable to make it work again as stated by Harshil in the message above.

Basically we changed n8n’s underlying library to make requests, and this new library is slightly different in a few edge case behaviors. We are constantly fixing bugs and releasing updates.

I will continue to work on this and let you know once it’s fixed.

Hey @vco1

@jan created a PR that fixes an issue with RAW data that might be responsible for fixing the issues you are facing.

You can find it here: Fix RAW request issue by janober · Pull Request #2283 · n8n-io/n8n · GitHub

This will be released soon I believe.