GivEnergy / giv_tcp

TCP connection (from inverter) and MQTT implementation
30 stars 41 forks source link

TypeError: The view function did not return a valid response #43

Open SystemParadox opened 7 months ago

SystemParadox commented 7 months ago

Still trying to connect to my all-in-one using this docker-compose config:

version: '3.8'

services:
    mariadb:
        image: britkat/giv_tcp-ma:2.4.1
        ports:
            - 1883:1883
            - 6345:6345
        environment:
            - INVERTOR_IP_1=192.168.8.145
            - INVERTOR_AIO_1=1
            - MQTT_USERNAME=mqtt
            - MQTT_PASSWORD=mqtt

I have no idea if it's managing to connect or not, but going to http://localhost:6345/getData gives this, which looks like a bug in the HTTP service:

givenergy-mariadb-1  | [2023-11-17 10:12:37 +0000] [67] [INFO] Starting gunicorn 21.2.0
givenergy-mariadb-1  | [2023-11-17 10:12:37 +0000] [67] [INFO] Listening at: http://0.0.0.0:6345 (67)
givenergy-mariadb-1  | [2023-11-17 10:12:37 +0000] [67] [INFO] Using worker: sync
givenergy-mariadb-1  | [2023-11-17 10:12:37 +0000] [68] [INFO] Booting worker with pid: 68
givenergy-mariadb-1  | [2023-11-17 10:12:37 +0000] [71] [INFO] Booting worker with pid: 71
givenergy-mariadb-1  | [2023-11-17 10:12:37 +0000] [72] [INFO] Booting worker with pid: 72
givenergy-mariadb-1  | 2023-11-17 10:12:38,045 - Inv1 - mqtt_client -  [CRITICAL] - Connecting to MQTT broker for control- 
givenergy-mariadb-1  | 2023-11-17 10:13:10,706 - Inv1 - app         -  [ERROR   ] - Exception on /getData [GET]
givenergy-mariadb-1  | Traceback (most recent call last):
givenergy-mariadb-1  |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2529, in wsgi_app
givenergy-mariadb-1  |     response = self.full_dispatch_request()
givenergy-mariadb-1  |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1826, in full_dispatch_request
givenergy-mariadb-1  |     return self.finalize_request(rv)
givenergy-mariadb-1  |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1845, in finalize_request
givenergy-mariadb-1  |     response = self.make_response(rv)
givenergy-mariadb-1  |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2174, in make_response
givenergy-mariadb-1  |     raise TypeError(
givenergy-mariadb-1  | TypeError: The view function did not return a valid response. The return type must be a string, dict, list, tuple with headers or status, Response instance, or WSGI callable, but it was a Job.