Are you the owner of the repository? Because the error does not come from n8n but rather from GitHub. The API returns a 404 if you try to listen to events of repository that you do not own. Here is another thread about that:
Hey all, unfortunately trigger problems are somewhat hard to debug as n8n doesn’t log the exact requests made when registering the webhook (which are what the GitHub trigger uses behind the scenes).
I’ve tried creating a bunch of GitHub triggers with manually added logging on my end but didn’t run into the problem, so couldn’t reproduce this unfortunately.
As a workaround, you can still register a webhook manually in your GitHub repository like so:
In n8n, make sure to use the right URL (production if you want your workflow to run in the background whenever active, check the documentation for details) and the POST method (which is what GitHub will use):
So your webhook URLs would need to be publicly accessible so GitHub (or any other service for that matter) can send it webhooks. If you expand the Webhook URLs section of the trigger node, does it by any chance show a localhost URL?
{“code”:0,“message”:“UNKNOWN ERROR - check the detailed error for more information”,“hint”:“”,“context”:{},“name”:“NodeApiError”,“cause”:{“context”:{},“name”:“NodeApiError”,“cause”:{“message”:“404 - {"message":"Not Found","documentation_url":"Repository Webhooks - GitHub Docs“Error: Request failed with status code 404\n at createError (C:\Users\lippe\AppData\Local\Programs\n8n\resources\app\node_modules\axios\lib\core\createError.js:16:15)\n at settle (C:\Users\lippe\AppData\Local\Programs\n8n\resources\app\node_modules\axios\lib\core\settle.js:17:12)\n at IncomingMessage.handleStreamEnd (C:\Users\lippe\AppData\Local\Programs\n8n\resources\app\node_modules\axios\lib\adapters\http.js:269:11)\n at IncomingMessage.emit (node:events:406:35)\n at IncomingMessage.emit (node:domain:470:12)\n at endReadableNT (node:internal/streams/readable:1331:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)”},“timestamp”:1661785787595,“message”:“The resource you are requesting could not be found”,“node”:{“parameters”:{“authentication”:“accessToken”,“owner”:“develogo”,“repository”:“game_store”,“events”:[”“]},“name”:“Github Trigger”,“type”:“n8n-nodes-base.githubTrigger”,“typeVersion”:1,“position”:[-1100,160],“webhookId”:“5a54de6a-6e76-4abf-ad51-5755b78a75ac”,“notesInFlow”:true,“retryOnFail”:true,“executeOnce”:true,“alwaysOutputData”:true,“credentials”:{“githubApi”:{“id”:“1”,“name”:“GitHub account”}},“continueOnFail”:true},“httpCode”:“404”,“description”:“Not Found”},“timestamp”:1661785787596,“node”:{“parameters”:{“authentication”:“accessToken”,“owner”:“develogo”,“repository”:“game_store”,“events”:[”"]},“name”:“Github Trigger”,“type”:“n8n-nodes-base.githubTrigger”,“typeVersion”:1,“position”:[-1100,160],“webhookId”:“5a54de6a-6e76-4abf-ad51-5755b78a75ac”,“notesInFlow”:true,“retryOnFail”:true,“executeOnce”:true,“alwaysOutputData”:true,“credentials”:{“githubApi”:{“id”:“1”,“name”:“GitHub account”}},“continueOnFail”:true},“httpCode”:null,“description”:“Not Found”,“stack”:“NodeApiError: UNKNOWN ERROR - check the detailed error for more information\n at Object.githubApiRequest (C:\Users\lippe\AppData\Local\Programs\n8n\resources\app\node_modules\n8n-nodes-base\dist\nodes\Github\GenericFunctions.js:37:15)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async Object.checkExists (C:\Users\lippe\AppData\Local\Programs\n8n\resources\app\node_modules\n8n-nodes-base\dist\nodes\Github\GithubTrigger.node.js:331:25)\n at async ActiveWorkflowRunner.addWorkflowWebhooks (C:\Users\lippe\AppData\Local\Programs\n8n\resources\app\node_modules\n8n\dist\src\ActiveWorkflowRunner.js:255:39)\n at async ActiveWorkflowRunner.add (C:\Users\lippe\AppData\Local\Programs\n8n\resources\app\node_modules\n8n\dist\src\ActiveWorkflowRunner.js:439:13)\n at async C:\Users\lippe\AppData\Local\Programs\n8n\resources\app\node_modules\n8n\dist\src\Server.js:645:21\n at async C:\Users\lippe\AppData\Local\Programs\n8n\resources\app\node_modules\n8n\dist\src\ResponseHelper.js:90:26”}
Here’s some more evidence. This time upload an instance in the digital ocean.?
When I click on “Execute workflow” every flow runs fine. It just gives an error to make it active.
I can pass the test instance password for you to perform tests.
Erro log
{
“code”:0,
“message”:“UNKNOWN ERROR - check the detailed error for more information”,
“hint”:“”,
“context”:{
},
“name”:“NodeApiError”,
“cause”:{
“context”:{},
“name”:“NodeApiError”,
“cause”:{
“message”:"404 - {"message":"Not Found","documentation_url":"Repository Webhooks - GitHub Docs,
“name”:“Error”,
“stack”:“Error: Request failed with status code 404\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 IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n at IncomingMessage.emit (node:events:525:35)\n at IncomingMessage.emit (node:domain:489:12)\n at endReadableNT (node:internal/streams/readable:1358:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)”
},
“timestamp”:1661958317420,
“message”:“The resource you are requesting could not be found”,
“node”:{
“parameters”:{
“authentication”:“oAuth2”,
“owner”:“develogo”,
“repository”:“game_store”,
“events”:[
“"
]
},
“id”:“c0f7bd79-40ee-4710-8964-39d4424ed22a”,
“name”:“Github Trigger”,
“type”:“n8n-nodes-base.githubTrigger”,
“typeVersion”:1,
“position”:[
240,
440
],
“webhookId”:“cf800b38-dfc6-4a1e-9c16-a0c1e8a5485e”,
“credentials”:{
“githubOAuth2Api”:{
“id”:“2”,
“name”:“GitHub account 2”
}
}
},
“httpCode”:“404”,
“description”:“Not Found”
},
“timestamp”:1661958317420,
“node”:{
“parameters”:{
“authentication”:“oAuth2”,
“owner”:“develogo”,
“repository”:“game_store”,
“events”:[
"”
]
},
“id”:“c0f7bd79-40ee-4710-8964-39d4424ed22a”,
“name”:“Github Trigger”,
“type”:“n8n-nodes-base.githubTrigger”,
“typeVersion”:1,
“position”:[
240,
440
],
“webhookId”:“cf800b38-dfc6-4a1e-9c16-a0c1e8a5485e”,
“credentials”:{
“githubOAuth2Api”:{
“id”:“2”,
“name”:“GitHub account 2”
}
}
},
“httpCode”:null,
“description”:“Not Found”
}
Hi everyone!
I’m getting the same error with Github trigger. I’m trying with Cloud and DigitalOcean.
Is there any progress on this issue?
P.S. Solution with webhook node works fine, but it would be great if the trigger work too
Are you sure that is the same issue? That is works when testing but not when activating the workflow? Because I am sadly still totally unable to reproduce this issue. Always works totally fine for me (both testing and in production). Or does it for you never work in your case?
When i clicked the “listen events” button in the GithubTrigger i got the same error like a TS.
I already solved this problem for myself in a similar way as in the solution.
I’m just added the GithubTrigger Webhook URLs to github repo/settings/webhooks and it works
In this case, my assumption be, that there is a problem with the access token or that the account to which the token belongs to does not have the right to listen to those events.