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…

Hello all,
I had a couple of other things to do, but now I am back to the topic.

After restarting the gateway and reinstalling the extensions needed, I started from scratch:

I took the python example from github example/multiple-things.py with the light dimmer and the humidity sensor and let it run.
After it was successfully created:

2022-07-28 16:04:24.337 INFO : Successfully created new thing My Lamp
2022-07-28 16:04:24.903 INFO : Successfully created new thing My Humidity Sensor

It took some minutes until the same error occurred:

2022-07-28 16:05:48.367 ERROR : thing-url-adapter: (node:1034) TimeoutOverflowWarning: 120086781141.79825 does not fit into a 32-bit signed integer.
2022-07-28 16:05:48.368 ERROR : thing-url-adapter: Timeout duration was set to 1.
2022-07-28 16:05:48.369 ERROR : thing-url-adapter: (node:1034) TimeoutOverflowWarning: 127084836169.72296 does not fit into a 32-bit signed integer.
2022-07-28 16:05:48.370 ERROR : thing-url-adapter: Timeout duration was set to 1.
2022-07-28 16:05:48.372 ERROR : thing-url-adapter: (node:1034) TimeoutOverflowWarning: 132566948577.38414 does not fit into a 32-bit signed integer.
and so forth, the things were grayed out and not reachable anymore. While the raspberry kept showing the values via the DEBUG info.

Could it be that there is a mistake somewhere?

look like the type of data sent by the things is not compatible with the type of reception

Could be, I don’t know. But I wonder why I am the only one where those errors pop up…
@mrstegeman: Do you have an idea? You were part of the team writing the examples, right?

Hi @Dr.Esi, welcome back.

I’m afraid @mrstegeman won’t be able to help.

I’m not sure if I can help, but are you able to provide a reproduceable test case that we can run ourselves to reproduce the bug?

Even just seeing the Thing Description exposed by the device might help.

I’m seeing this as well. My webthing worked for months and then started doing this. No doubt it is a bug in my webthing but I’m at a loss trying to debug it. I can navigate to the end point using a browser and it looks fine and the webthing is registered with mdns but remains greyed out with the logs full of:

2023-04-06 01:06:24.706 ERROR : thing-url-adapter: (node:956) TimeoutOverflowWarning: 132782097092.05634 does not fit into a 32-bit signed integer.
2023-04-06 01:06:24.706 ERROR : thing-url-adapter: Timeout duration was set to 1.

Hi, I’ve the same error message and greyed objects on my gateway v1.0 since I upgrade a remote webthings raspberry client to debian 11.7 and Python 3.9.2. @cgerhard, @bfrancis did you have an explanation or a solution to solve this issue ?
Thanks on advance.

@jclinden Welcome!

No explanation so far, but if you have a reproduceable test case (web thing), could you please share it at https://github.com/WebThingsIO/gateway/issues/3029

I suspect the issue for me is that the webthing has both asyncio and threads mixed. I plan to pull the webthing part into a separate micro service to avoid this. I could of course be completely wrong about this.

I’ll see if I can package the webthing to be standalone so I works without the hardware and post that,

I’m now sure the problem is an interaction between by code that needs to use async io (I ported it from threads) and the webthing library that is also using asyncio. If there is an example of reading from a network end point, or a serial device using aio and updating the webthing that would help me, but ultimately this is my problem.