Open sprankhub opened 1 week ago
Hey @sprankhub,
We have created an internal ticket to look into this which we will be tracking as "GHC-325"
Hey @sprankhub,
Do you have an example url that returns an empty response? I think the best option here would be if the request has no response throw an error and mention to use the include response headers / status option as our nodes rely on there being data to run.
In my case, this is https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-assignee-put. As you can see, it returns HTTP status code 204 No Content. I don't think there should be an error if the response is clearly empty. It is fine that subsequent nodes aren't executed if there is no output data. This can be fixed by using the "Always Output Data" option. However, sibling nodes should still be executed. But due to the current error, the whole execution of the workflow is stopped.
What if the response isn't meant to be empty though wouldn't you want to know which is where the error makes sense. If you are expecting no response then we have the options in place to work around that.
I wouldn't care too much if there was an error like "The response is empty. If this is expected, use the "Always Output Data" option in the settings". However, this is currently a very hard to understand error. Took me some time to find the root cause :see_no_evil:
Having said that, I'd still argue 204 No Content is a proper response. Since it is specifically meant for showing "the request was okay, but there is no content in the response". I don't think this should result in an error or should stop the workflow. The workflow should be stopped on 4xx response codes, but not 2xx response codes.
You are not wrong on a 204 response being valid as it is in the 200 range, I guess the tricky bit for us is we always expect data so we can link up the data. Maybe if it is a 204 we just output the input data 🤔
I will pop a note on the internal ticket so we can think about the safest option, We should fix that error to make it clearer as a quick action.
Hey @sprankhub,
We have tried to reproduce this with https://httpbin.org/status/204 and https://httpstat.us/204 but they both appear to be working, In your environment do these 2 urls also fail?
Bug Description
In HTTP Request node version 4.2, I get the following error when the HTTP response is empty:
My current workaround is to enable the "Include Response Headers and Status" option.
To Reproduce
Expected behavior
No error should occur if the response is empty.
Operating System
Cloud
n8n Version
1.62.6
Node.js Version
Cloud
Database
SQLite (default)
Execution mode
main (default)