401 Unauthorized Error when Creating a New Issue

I’m following this tutorial:

Using the GitHub API in your app

But when I get to the last part in step two which is to create an issue to see if the changes in template_server.rb are working correctly, I get an unauthorized error

C:\Users\arman\Documents\Research\EyeTracking\plugin-app\using-the-github-api-in-your-app>smee --url https://smee.io/riknbep7tLUBxxx --path /event_handler --port 3000
Forwarding https://smee.io/riknbep7tLUBxxx to http://127.0.0.1:3000/event_handler
Connected https://smee.io/riknbep7tLUBxxx
{ Error: Unauthorized
    at Request.callback (C:\Users\arman\AppData\Roaming\npm\node_modules\smee-client\node_modules\superagent\lib\node\index.js:706:15)
    at IncomingMessage.parser (C:\Users\arman\AppData\Roaming\npm\node_modules\smee-client\node_modules\superagent\lib\node\index.js:916:18)
    at IncomingMessage.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  status: 401

I thought this was maybe due to incorrect permissions, but I double-checked with what permissions are supposed to be set for the app, and mine looks to be the same. Any ideas of how to fix this problem?

1 Like

The last bit of step 2 is to simply log a debug message, so I don’t see how you would get an Unauthorized response or what it might be a response to. The only thing that I can think of is that perhaps you hadn’t started your Sinatra process that is actually listening to port 3000?

Can you give a little more information as to what exactly you did?

I’m having the same problem. I was developing GitHub application and testing it locally and everything was working. But now I see “Unauthorized” requests with both smee and ngrok locally. I don’t know why this is started to happen and how can I fix this.

Hi,

I am having the same problem. My error says:

Error: Unauthorized
    at Request.callback (/home/siamka/.nvm/versions/node/v12.14.1/lib/node_modules/smee-client/node_modules/superagent/lib/node/index.js:706:15)
    at IncomingMessage.<anonymous> (/home/siamka/.nvm/versions/node/v12.14.1/lib/node_modules/smee-client/node_modules/superagent/lib/node/index.js:916:18)
    at IncomingMessage.emit (events.js:228:7)
    at endReadableNT (_stream_readable.js:1185:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:21) {
  status: 401,
  response: Response {

and then a very long message follows.

I followed the tutorial exactly and everything was working. Then in the part:

… In your browser, visit the repository where you installed your app. Open a new issue in this repository. The issue can say anything you like. It’s just for testing.

When you look back at your Terminal, you should see a message…

But I don’t see the message. There is just an error message in my smee terminal.

My Sinatra is listening at 3000 port. I can check it through ma local host, where it says:
‘Sinatra doesn’t know this ditty.’

I can also see that Smee.io is receiving the issues in the ‘Webhook Deliveries’ tab.

What else can I do?

Thank you for any reply

Add quotes for all values in .env if you have special symbols