Twitter OAuth Broken? 404 Error When Connecting

Setup:
Self-hosted n8n 0.233.1

Yesterday I started to receive a 404 error when attempting to send tweets via the HTTP Request node, using n8n’s Twitter OAuth credentials setup.

The full error is:

{"status":"rejected","reason":{"message":"The resource you are requesting could not be found","timestamp":1688327465201,"name":"NodeApiError","description":"{\"errors\":[{\"message\":\"Sorry, that page does not exist\",\"code\":34}]}","context":{},"cause":{"message":"404 - \"{\\\"errors\\\":[{\\\"message\\\":\\\"Sorry, that page does not exist\\\",\\\"code\\\":34}]}\"","name":"Error","stack":"Error: 404 - \"{\\\"errors\\\":[{\\\"message\\\":\\\"Sorry, that page does not exist\\\",\\\"code\\\":34}]}\"\n    at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n    at RedirectableRequest.handleResponse (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:238:9)\n    at RedirectableRequest.emit (node:events:525:35)\n    at RedirectableRequest.emit (node:domain:489:12)\n    at RedirectableRequest._processResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:356:10)\n    at ClientRequest.RedirectableRequest._onNativeResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:62:10)\n    at Object.onceWrapper (node:events:628:26)\n    at ClientRequest.emit (node:events:525:35)\n    at ClientRequest.emit (node:domain:489:12)\n    at HTTPParser.parserOnIncomingClient (node:_http_client:693:27)\n    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)\n    at TLSSocket.socketOnData (node:_http_client:534:22)\n    at TLSSocket.emit (node:events:513:28)\n    at TLSSocket.emit (node:domain:489:12)\n    at addChunk (node:internal/streams/readable:315:12)\n    at readableAddChunk (node:internal/streams/readable:289:9)\n    at TLSSocket.Readable.push (node:internal/streams/readable:228:10)\n    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)"}}}

I’ve been using this (HTTP Request node + n8n’s built-in Twitter OAuth) for months, so I assumed the errors were due to all the problems Twitter was having yesterday.

I posted in the Twitter Developer Community, but didn’t receive a response. Twitter doesn’t really respond to posts anymore, but if other users are having the problem, they will usually chime in and no one did.

So today I took another look, and tried to re-connect within the “Credentials” tab of n8n. When I attempt to connect within “Credentials”, I receive the error:

OAuth Authorization Error
There was a problem generating the authorization URL
Request failed with status code 404

I tried re-generating the keys, and received the same error.

So, to ensure it wasn’t my actual developer account, I tried a different developer account, and received the same error when adding it to the “Credentials” tab.

And of course I’ve checked my email and developer accounts for any deactivation notices, as well as checked my rate limits and I am not over them. I send about 20-40 tweets/day via the API with the HTTP Request node, and that’s it in terms of my current Twitter API use. I am also able to send tweets manually, so my profile isn’t being restricted or banned.

What I have been able to surmise from various threads and tweets (nothing official from Twitter, as, again, they don’t really communicate anymore) is that they may have disabled a version of OAuth that uses the 1.1 API. I’m not certain if n8n uses the 1.1 API or V2 for OAuth though?

Since I’m not seeing people en masse out in the world tweeting and complaining about the same error, I believe that Twitter did something that broke n8n’s OAuth.

I’m sorry I don’t have more technical skill to investigate, so this is all the info I have!

Hey @mmac,

The quick one for this is our node uses the old api version which Twitter has been removing to implement the new api, the update for the Twitter node to use the new v2 api will be available this week which should fix all of the current issues with the Twitter node.

This is of course assuming that you are not using the tunnel option with n8n and that the tunnel url has changed but it is more likely to be the api changes.

2 Likes

Ok, thanks Jon! I knew you guys were working on an update for the Twitter node, but I wasn’t certain that was related to / would solve this new error in the HTTP Request node. Mostly I’m just happy it’s not my user error, LOL!

1 Like

Can’t wait for this!

Should be available this week :slight_smile:

1 Like

I was wondering if this has been released? Asking because I didn’t spot it in the release logs :face_with_monocle:

1 Like

Hey @bartv,

This was released in 0.236.0 and 1.1.0.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.