Log http request

I am getting an error with custom HTTP Requests using Oauth2 authentication:

ERROR: The client is not authorized to request an authorization code using this method.
Error: The client is not authorized to request an authorization code using this method.
at getAuthError (/usr/local/lib/node_modules/n8n/node_modules/client-oauth2/src/client-oauth2.js:122:15)
at /usr/local/lib/node_modules/n8n/node_modules/client-oauth2/src/client-oauth2.js:270:21
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/NodeExecuteFunctions.js:78:30
at async Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest.node.js:749:32)
at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:369:47

I reported this error to the service we are using (Exact Online), but they are asking me for request logs (which I can understand). I tried to catch the requests on my localhost (Mac) using mitmproxy, but for some reason that is not working.

Is there another way to log http requests so I can send debug information to Exact?

since we are using this module request-promise - npm to do the requests you can set an env variable NODE_DEBUG=request and you should be able to see all the request are being made on the terminal.

1 Like

Thanks! That works for the HTTP requests, but unfortunately the OAuth2 requests are not logged. Can you give me a hint for those as well?