[SOLVED] UrlFetch issues (no apparent request) with custom API

EDIT: After some more messing around, I realized Nightbot does not like using different ports with urlfetch. As this is a standard http request, the server needs to be running on port 80 - I’m guessing it is implemented in a way where the part of the URL where the port is explicitly added somehow messes up the address, but that’s just speculation - either way, running the server on port 80 fixed this issue.

Heyo,

I’ve been working on a project using the Nightbot API, with commands being done through urlfetch. So far the process has been going fine, however, now I’ve run into a problem I have no idea how to fix with regards to urlfetch. At the moment, I’m not too fussed about doing anything useful or handling the request in any way - first I need Nightbot to be able to make requests to my server in the first place. For this testing phase, a command would have the form of

!addcom !test $(urlfetch https://my_dns_name:port_I_use/test)

The problem is that calling the command does not actually seem to make any sort of request to the server.

Some information which could be used:

  • Server is using Python 3 with Bottle as a framework, using gevent as a server supporting SSL
  • Communication with Nightbot’s API has given no issues, and the access tokens etc were succesfully obtained. Can also successfully make requests and process responses to the Nightbot API.
  • All attempted connections show up in the server console, including failed ones (permission denied, not found, wrong method etc, it still shows is making a request)
  • The SSL was needed for authorization tokens; I’ve tried running the command section without encryption using normal http on the server, which made no difference
  • Ports are open in iptables
  • Manually sending requests through curl works just fine, both through localhost and external connections
  • Copy-pasting the link from the command into the browser works fine, which rules out weird typos
  • Nightbot gives no error message (or any message at all) after calling the command. Text surrounding the $(urlfetch blabla) only got displayed when I messed up the urlfetch syntax - apparently if the syntax is right and fetching the url fails, nothing happens?
  • Other commands using urlfetch do work on the same channel

I’m at a complete loss to be honest. If I got any sort of feedback at all from either Nightbot or the server console I’m pretty sure I could fix it myself - as is, I’m hoping anyone here might have any ideas.

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