Page 1 of 1

IWS stopped working?

PostPosted: Wed Oct 25, 2017 12:05 pm
by FlyingDiver
Not sure where to put this. Matt/Jay please move as necessary.

My IWS plugin stopped working. Now when the remote server tries to do a GET to my plugin I get this error:

Code: Select all
   WebServer                       undefined page requested "http://flyingdiver.goprism.com/twilio/ping" from 34.229.219.100


That URL is correct, it hasn't changed. The IWS setup is right, I think. See attached screen shot. And here's the actual code:

Code: Select all
####################
import cherrypy
from indigopy.basereqhandler import BaseRequestHandler

####################
def PluginName():
   return u"Twilio Ping"

def PluginDescription():
   return u"This is the Twilio Ping Plugin."

def ShowOnControlPageList():
   return False      # if True, then above name/description is shown on the Control Page list index
   
####################
class TwilioRequestHandler(BaseRequestHandler):

   def __init__(self, logFunc, debugLogFunc):
      BaseRequestHandler.__init__(self, logFunc, debugLogFunc)

    def index(self, name=None):
        logmessage = "Twilio Ping usage: http://host:port/twilio/ping\n\n"
        self._Log(logmessage)
        cherrypy.response.headers['Content-Type'] = 'text/plain'
        return logmessage
    index.exposed = True

   def ping(self, **params):
      cherrypy.server.indigoDb.VariableSetValue(cherrypy.server.indigoConn, "twilio_ping", "true")
        cherrypy.response.headers['Content-Type'] = 'text/plain'
        return "Twilio Ping Ack"
   ping.exposed = True


Any ideas?

Re: IWS stopped working?

PostPosted: Wed Oct 25, 2017 12:12 pm
by matt (support)
Stop and restart the Indigo Server. Any relevant lines logged from the Indigo WebServer?

Re: IWS stopped working?

PostPosted: Wed Oct 25, 2017 12:23 pm
by FlyingDiver
Not that I can see:

Code: Select all
   WebServer                       started on port 8176 -- digest authentication enabled


   WebServer                       undefined page requested "http://flyingdiver.goprism.com/twilio/ping" from 54.226.132.114


Should there be something in there registering the IWS plugin?

Re: IWS stopped working?

PostPosted: Wed Oct 25, 2017 12:29 pm
by matt (support)
It should log if there is an error loading the plugin.

Is your other plugin (variable_url_redirect) working?

Re: IWS stopped working?

PostPosted: Wed Oct 25, 2017 12:57 pm
by FlyingDiver
Hmm. Yes. At least, I get the usage message if I request the index page. Which doesn't work on the other plugin.

Re: IWS stopped working?

PostPosted: Wed Oct 25, 2017 1:10 pm
by FlyingDiver
It started working again.

I edited the reqhandler.py file and made sure there weren't any weird characters or tabs in it. Deleted the .pyc files, and restarted the server a couple times. Damifino.

Re: IWS stopped working?

PostPosted: Wed Oct 25, 2017 1:15 pm
by matt (support)
What you saw might have happened had the indents not been perfect on this line I think:

ping.exposed = True

One of my least favorite things about Python.