question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Strange error when receiving web hooks using the smee.io webhook proxy

See original GitHub issue

I just created my first app using the ‘create-probot-app’ tool, and I’m seeing the following error every time a webhook is sent to my app:

23:55:22.926Z ERROR probot: Not Found
  Error: Not Found
      at Request.callback (/Users/arhodes/Code/ship-bot/node_modules/superagent/lib/node/index.js:696:15)
      at IncomingMessage.parser (/Users/arhodes/Code/ship-bot/node_modules/superagent/lib/node/index.js:906:18)
      at emitNone (events.js:110:20)
      at IncomingMessage.emit (events.js:207:7)
      at endReadableNT (_stream_readable.js:1045:12)
      at _combinedTickCallback (internal/process/next_tick.js:138:11)
      at process._tickDomainCallback (internal/process/next_tick.js:218:9)

I’m using the smee.io webhook proxy. I’ve got WEBHOOK_PROXY_URL set in my .env as well as APP_ID and WEBHOOK_SECRET.

From what I can tell, it looks like the smee-client is receiving the webhook correctly, but is failing to post it back to my probot app. Have I missed something with my setup?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pnavarrccommented, Feb 16, 2018

I’m having the same issue, which information would be useful to debug here?

my .env file (replaced my app ID and the smeet slug)

# The ID of your GitHub App
APP_ID=<app_id>
WEBHOOK_SECRET=development

# Uncomment this to get verbose logging; use `info` to show less
# LOG_LEVEL=trace

# Go to https://smee.io/new set this to the URL that you are redirected to.
WEBHOOK_PROXY_URL=https://smee.io/<slug>

The application output

03:23:57.049Z  INFO probot: Yay, the app was loaded!
03:23:57.094Z  INFO probot: Forwarding https://smee.io/<slug> to http://localhost:3000/
03:23:57.096Z  INFO probot: Listening on http://localhost:3000
03:23:59.799Z  INFO probot: Connected https://smee.io/<slug>
03:24:05.533Z ERROR probot: fn.call is not a function (id=4b3b0322-f4d9-4937-9a74-fce7b84d799c)
  TypeError: fn.call is not a function
      at /Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express-async-errors/index.js:17:20
      at Layer.handle [as handle_request] (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/layer.js:95:5)
      at trim_prefix (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:317:13)
      at /Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:284:7
      at Function.process_params (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:335:12)
      at next (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:275:10)
      at /Users/pablo/code/pnavarrc/zenhub-bot/node_modules/probot/lib/middleware/logging.js:33:5
      at /Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express-async-errors/index.js:17:20
      at Layer.handle [as handle_request] (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/layer.js:95:5)
      at trim_prefix (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:317:13)
      at /Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:284:7
      at Function.process_params (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:335:12)
      at next (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:275:10)
      at expressInit (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/middleware/init.js:40:5)
      at /Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express-async-errors/index.js:17:20
      at Layer.handle [as handle_request] (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/layer.js:95:5)
      at trim_prefix (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:317:13)
      at /Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:284:7
      at Function.process_params (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:335:12)
      at next (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:275:10)
      at query (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/middleware/query.js:45:5)
      at /Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express-async-errors/index.js:17:20
      at Layer.handle [as handle_request] (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/layer.js:95:5)
      at trim_prefix (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:317:13)
      at /Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:284:7
      at Function.process_params (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:335:12)
      at next (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:275:10)
      at Function.handle (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/router/index.js:174:3)
      at Function.handle (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/application.js:174:10)
      at Server.app (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/express/lib/express.js:39:9)
      at emitTwo (events.js:126:13)
      at Server.emit (events.js:214:7)
      at parserOnIncoming (_http_server.js:602:12)
      at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
03:24:05.536Z  INFO probot: POST / 404 - 3.85 ms (id=4b3b0322-f4d9-4937-9a74-fce7b84d799c)
03:24:05.539Z ERROR probot: Not Found
  Error: Not Found
      at Request.callback (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/superagent/lib/node/index.js:696:15)
      at IncomingMessage.parser (/Users/pablo/code/pnavarrc/zenhub-bot/node_modules/superagent/lib/node/index.js:906:18)
      at emitNone (events.js:111:20)
      at IncomingMessage.emit (events.js:208:7)
      at endReadableNT (_stream_readable.js:1055:12)
      at _combinedTickCallback (internal/process/next_tick.js:138:11)
      at process._tickDomainCallback (internal/process/next_tick.js:218:9)

my code (index.js)

module.exports = (robot) => {
  // Your code here
  robot.log('Yay, the app was loaded!')

  robot.on(['pull_request'], async function() {
    robot.log('hi')
  })

  robot.on('*', async context => {
    robot.log('***')
  })
}

The application is enabled only on my personal account, the wehbook event was pull_request (edited) on a private repository on my personal account.

I can open a new issue and help debugging / testing if that would be useful. Cheers!

0reactions
akmalickcommented, Apr 14, 2020

I am also getting similar error. I am just not able to trigger an event from within another event. The context just seems to get lost. Hard-coding the parameters of update method works fine. But I want to make this a dynamic one, where all the details are fetched from the correct context.

I am a beginner in both probot and nodejs.

I had posted the full detail here.

This has an answer here Thanks again @gr2m

Read more comments on GitHub >

github_iconTop Results From Across the Web

smee.io | Webhook payload delivery service
smee.io is a small service that uses Server-Sent Events to proxy payloads from the webhook source, then transmit them to your locally running...
Read more >
Triggering builds with webhooks behind a secure ... - Jenkins
This says to connect to the smee service, and forward webhooks to /github-webhook/ (that trailing slash is important, don't miss it). Once this ......
Read more >
Give me /events, not webhooks - Hacker News
You can do this with BenkoBot, we just launched custom webhooks (although it's not in the interface yet). So you can receive a...
Read more >
How to Forward Webhooks to Jenkins Behind a Firewall using ...
Timecodes ⏱:0:00 Introduction0:23 Receiving webhooks from the outside world0:55 All the software we are using today1:17 Walkthrough of ...
Read more >
Get your WebHooks on LOCALHOST with smee.io - YouTube
I'm going to show you how to receive webhooks payload on localhost, using smee. io and the smee client.If you are developing an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found