Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Handling Issue in HTTP Request Node during PUT Operation #9665

Closed
domcaram opened this issue Jun 7, 2024 · 14 comments
Closed

Error Handling Issue in HTTP Request Node during PUT Operation #9665

domcaram opened this issue Jun 7, 2024 · 14 comments
Labels
in linear Issue or PR has been created in Linear for internal review Released

Comments

@domcaram
Copy link

domcaram commented Jun 7, 2024

Bug Description

When attempting to perform a PUT request using the HTTP Request node in n8n, I encounter the following error:

Cannot read properties of undefined (reading 'error')

Full Stack Trace:

TypeError: Cannot read properties of undefined (reading 'error') at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:666:253 at processTicksAndRejections (node:internal/process/task_queues:95:5) at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1079:20

Although the PUT request appears to proceed as expected, it seems that the code attempts to read the error property even when there is no error present in the response. This forced reading of the error variable causes the TypeError mentioned above.

To Reproduce

1.	Set up an HTTP Request node with a PUT method.
2.	Execute the workflow.
3.	Observe the error in the execution logs.

Expected behavior

The workflow should handle responses without errors gracefully and should not attempt to read the error property when it is undefined.

Operating System

Debian 12 (Bookworm)

n8n Version

1.44.1

Node.js Version

v20.13.1

Database

SQLite (default)

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented Jun 7, 2024

Hey @domcaram,

What other settings do you have in the node? I have just given this a test with the 1.45.0 release and I can't reproduce this but I have seen this happen in 1.45.0 with other nodes as well.

image

@domcaram
Copy link
Author

domcaram commented Jun 7, 2024

Hey @Joffcom,

The only customization I have made is setting the timeout to 50000

Node settings:
image

Thank you

P.S. I have tried updating the image to 1.45.0 but still encounter the same error.

@Joffcom
Copy link
Member

Joffcom commented Jun 7, 2024

@domcaram which version did you upgrade from? If you click on the settings for the HTTP Request node at the bottom it should show a node version, What is that version?

@domcaram
Copy link
Author

domcaram commented Jun 7, 2024

@Joffcom i just upgraded from 1.44.1 to 1.45.0.

HTTP Request node settings:
image

(HTTP Request node version 1 (Latest version: 4.2))

@Joffcom
Copy link
Member

Joffcom commented Jun 7, 2024

@domcaram I suspect that is node version won't help can you add a new http request node and see if that has the same option.

With the upgrade before you went to 1.44.1 which version were you running?

@domcaram
Copy link
Author

domcaram commented Jun 7, 2024

@Joffcom adding a new HTTP Request node shows a slightly different version and module:

image

To update n8n, I use watchtower, which checks daily for new latest versions. This workflow originates from one of the earliest versions of n8n (possibly 0.2)

I'm now trying with the new version

Update: same error
image

@Joffcom
Copy link
Member

Joffcom commented Jun 7, 2024

@domcaram I guess that means you were on 1.42 before which is a big help tracking down the change as I noticed it is still in 1.43.

@domcaram
Copy link
Author

domcaram commented Jun 7, 2024

@Joffcom Yes that's probably correct. On 1.42 it was working, I also tried downgrading the image but during the container startup I get an SQLITE_ERROR:

QueryFailedError: SQLITE_ERROR: no such column: WorkflowEntity__WorkflowEntity_shared.userId at handler (/usr/local/lib/node_modules/n8n/node_modules/@n8n/typeorm/driver/sqlite/SqliteQueryRunner.js:88:37) at replacement (/usr/local/lib/node_modules/n8n/node_modules/sqlite3/lib/trace.js:25:27) at Statement.errBack (/usr/local/lib/node_modules/n8n/node_modules/sqlite3/lib/sqlite3.js:15:21) Error: Exiting due to an error.

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Jun 7, 2024
@domcaram
Copy link
Author

domcaram commented Jun 7, 2024

Hey @Joffcom,

I just saw that this issues has been fixed and merged in master. May I ask when this will be live?

Thank you

@Joffcom
Copy link
Member

Joffcom commented Jun 7, 2024

Hey @domcaram,

I suspect there will be a 1.45.1 release at some point, It may be Monday now though. When there is a release a note will be popped on here to let you know.

@sprankhub
Copy link

Any news on 1.45.1, @Joffcom? This is breaking our automations 🫣

@Giorgio-gatti
Copy link

Giorgio-gatti commented Jun 11, 2024

Same problem here when use UPDATE operation in SQL from n8n.

{ "errorMessage": "Cannot read properties of undefined (reading 'error')", "errorDetails": {}, "n8nDetails": { "n8nVersion": "1.44.1 (Self Hosted)", "binaryDataMode": "default", "stackTrace": [ "TypeError: Cannot read properties of undefined (reading 'error')", " at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:666:253", " at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1079:20" ] } }

This is breaking my automations :*{
"errorMessage": "Cannot read properties of undefined (reading 'error')",
"errorDetails": {},
"n8nDetails": {
"n8nVersion": "1.44.1 (Self Hosted)",
"binaryDataMode": "default",
"stackTrace": [
"TypeError: Cannot read properties of undefined (reading 'error')",
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:666:253",
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1079:20"
]
}
}

This is breaking my automations :(

@janober
Copy link
Member

janober commented Jun 12, 2024

Fix got released with n8n@1.44.2

@Joffcom
Copy link
Member

Joffcom commented Jun 17, 2024

Updating will resolve this, Let me know how you get on after an update and if it is still an issue.

@Joffcom Joffcom closed this as completed Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review Released
Projects
None yet
Development

No branches or pull requests

5 participants