Thing-url-adapter: (node:889) TimeoutOverflowWarning

Hi, I have RaspPi which reads from webservers on my LAN and presents the results as individual WebThings.
This works great in the beginning, but after a couple of hours the Thing is not reachable anymore. Log shows:
thing-url-adapter: Timeout duration was set to 1.
2022-01-29 17:01:15.414 ERROR : thing-url-adapter: (node:889) TimeoutOverflowWarning: 146821376000 does not fit into a 32-bit signed integer.

And now I can’t even see the ExampleThing anymore and the log shows:
Failed to parse description at http://192.168.0.100/things/led2: SyntaxError: Unexpected token < in JSON at position 0

Whereas the IP address should be where the Thing should have retrieved the data, its own IP is another.

Any idea what I am doing wrong?

Searching Google, this URL is the first returned:

There are many other hints:
https://duckduckgo.com/?q=WebThings+TimeoutOverflowWarning&t=chromentp&ia=web

Can’t help deduce why the LED may not be / or stops responding, but hardening/debugging the error conditions may be appropriate.

What addon do you use?

Hello Eric,

Thank you for the swift reply.
I found timeout issues, but have to admit: As I am running a python script I ignored the .js discussions.

I am not using an addon, but an adapted version based on the python example. I try to derive a Thing which reads from the internal webserver:

from __future__ import division, print_function
from webthing import (Action, Event, MultipleThings, Property, Thing, Value,
                      WebThingServer)
import logging
import random
import time
import tornado.ioloop
import uuid

log = logging.getLogger('GetterThing')
log.setLevel(logging.DEBUG)
import os
import sys
dirname = os.path.dirname(__file__)
sys.path.insert(1, os.path.join(dirname, '../ReadFromWebServer'))

from ReadHTMLdata import readFromIP


class GetDataAction(Action):

    def __init__(self, thing, input_):
        Action.__init__(self, uuid.uuid4().hex, thing, 'collectData', input_=input_)

    def perform_action(self):
        self.input['IP-Adress']
        self.thing.set_property('brightness', self.input['brightness'])

class DHT22_Sensor(Thing):
    """A device to read out a DHT sensor which is connected to the LAN, updates its measurement every 30 seconds."""

    def __init__(self, IP = "192.168.0.100"):
        Thing.__init__(
            self,
            'urn:dev:ops:my-DHT-URL-sensor',
            'My Multipurpose Sensor on: '+IP,
            ['MultiLevelSensor'],
            'A web connected Sensor to read out IP values'
        )

        self.humidity = Value(50.0)
        self.add_property(
            Property(self,
                     'Humidity',
                     self.humidity,
                     metadata={
                         '@type': 'LevelProperty',
                         'title': 'Humidity',
                         'type': 'number',
                         'description': 'The current humidity in %',
                         'minimum': 0,
                         'maximum': 100,
                         'unit': 'percent',
                         'readOnly': True,
                     }))

        logging.debug('starting the sensor update looping task')
        
        self.temp = Value(10.0)
        self.add_property(
            Property(self,
                     'Temperature',
                     self.temp,
                     metadata={
                         '@type': 'TemperatureProperty',
                         'title': 'Temperature',
                         'type': 'number',
                         'description': 'The current Temperature in degree celsius',
                         'unit': 'degree celsius',
                         'readOnly': True,
                     }))
        self.timer = tornado.ioloop.PeriodicCallback(lambda: self.update_values(IP),5000) 
        self.timer.start()


    def update_values(self, IP):
        new_hum, newTemp = self.readIP(IP)
        logging.debug('Reading Humidity level: %s', new_hum)
        logging.debug('Reading Temperature level: %s', newTemp)
        self.temp.notify_of_external_update(newTemp)
        self.humidity.notify_of_external_update(new_hum)
    

    def cancel_update_level_task(self):
        self.timer.stop()

    @staticmethod
    def readIP(IP = "192.168.0.100"):
        """Reading from an actual sensor updating its every couple seconds."""
        a = readFromIP()
        strVal = a.getValues(IP, ret = True)
        posHum = 2
        posTemp = 3
        strVal = a.getValues(IP, ret = True)
        hum = float(strVal[posHum])
        temp = float(strVal[posTemp])
        
        return hum, temp

def run_server():
    HumTempSensor1 = DHT22_Sensor(IP = "192.168.0.100")
    server = WebThingServer(HumTempSensor1, 'PiServer', port=8888)
    try:
        logging.info('starting the server')
        server.start()
    except KeyboardInterrupt:
        logging.debug('canceling the sensor update looping task')
        HumTempSensor1.cancel_update_level_task()
        logging.info('stopping the server')
        server.stop()
        logging.info('done')

if __name__ == '__main__':
    logging.basicConfig(
        level=10,
        format="%(asctime)s %(filename)s:%(lineno)s %(levelname)s %(message)s"
    )
    run_server()

But as this stopped working properly I tried to debug by starting the example. This did not work either and the Gateway Log showed the increasing number (same did the Chromecast adapter b.t.w):
2022-01-29 16:59:41.259 ERROR : thing-url-adapter: (node:889) TimeoutOverflowWarning: 118639774953.81918 does not fit into a 32-bit signed integer.
2022-01-29 16:59:41.261 ERROR : thing-url-adapter: Timeout duration was set to 1.
2022-01-29 16:59:41.264 ERROR : thing-url-adapter: (node:889) TimeoutOverflowWarning: 127587159120.50343 does not fit into a 32-bit signed integer.
2022-01-29 16:59:41.265 ERROR : thing-url-adapter: Timeout duration was set to 1.
2022-01-29 16:59:41.266 ERROR : thing-url-adapter: (node:889) TimeoutOverflowWarning: 134183021018.23598 does not fit into a 32-bit signed integer.
2022-01-29 16:59:41.269 ERROR : thing-url-adapter: Timeout duration was set to 1.
2022-01-29 16:59:41.272 ERROR : thing-url-adapter: (node:889) TimeoutOverflowWarning: 141203322911.06372 does not fit into a 32-bit signed integer.
2022-01-29 16:59:41.274 ERROR : thing-url-adapter: Timeout duration was set to 1.
2022-01-29 16:59:41.277 ERROR : thing-url-adapter: (node:889) TimeoutOverflowWarning: 146818304000 does not fit into a 32-bit signed integer.
2022-01-29 16:59:41.279 ERROR : thing-url-adapter: Timeout duration was set to 1.
2022-01-29 16:59:41.284 ERROR : chromecast-adapter: (node:865) TimeoutOverflowWarning: 125452171085.27827 does not fit into a 32-bit signed integer.
2022-01-29 16:59:41.287 ERROR : chromecast-adapter: Timeout duration was set to 1.

the thing-url adapter has backing-off logic for websockets. Does your thing by chance declare the websocket in its schema (in the root endpoint in the links array) but not actually offer one?

Hi Martin,
Thank you for you input. Since I read your answer I looked at other problem sources, as my thing does not appear on the log, it is named differently. But maybe it somehow interferes with an adapter I thought.
Therefore I wanted to find out which one this thing-url-adapter is and by doing so I deactivated all the addons I don’t need. I don’t know what went wrong, because since then the gateway is not visible on my LAN anymore. The IP is visible and I can ping it but IP:8080 ends in time out.
I restarted the gateway, same thing. I will try to reinstall the gateway from scratch…