diyhue / diyHue

Main diyHue software repo
https://diyhue.org/
Other
1.52k stars 274 forks source link

Failed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR) #952

Closed RowMax03 closed 7 months ago

RowMax03 commented 7 months ago

Issue does not already exist?

I have searched and found no existing issue

Select Environment

Docker

Home Assistant related?

No

Description

image

Link Button returns Error when trying to press it.

Tried to get my Hue App to sync after not updating for a while. Removed the container and started it up a couple of times in the process because the curl on localhost for the certificate check failed because the connection got refused (?!). The link button still worked after updating but wouldn't work in the Hue App. Rest of the bridge still works and runs fine, i can turn on lights through established homebridge connection aswell as through hue essentials.

Tried rebooting, Removing container and rebuilding.

Errorlog:

2023-11-19 02:23:36,383 - services.stateFetch - INFO - start lights sync 2023-11-19 02:23:36,383 - services.stateFetch - DEBUG - fetch Couch 1 2023-11-19 02:23:36,410 - services.stateFetch - DEBUG - {'on': True, 'bri': 254, 'xy': [0, 0], 'ct': 324, 'hue': 0, 'sat': 254, 'colormode': 'ct'} 2023-11-19 02:23:36,411 - services.stateFetch - DEBUG - fetch Couch 2 2023-11-19 02:23:36,458 - services.stateFetch - DEBUG - {'on': True, 'bri': 254, 'xy': [0, 0], 'ct': 324, 'hue': 0, 'sat': 254, 'colormode': 'ct'} 2023-11-19 02:23:36,458 - services.stateFetch - DEBUG - fetch Couch 3 2023-11-19 02:23:36,483 - services.stateFetch - DEBUG - {'on': True, 'bri': 254, 'xy': [0, 0], 'ct': 324, 'hue': 0, 'sat': 254, 'colormode': 'ct'} 2023-11-19 02:23:36,484 - services.stateFetch - DEBUG - fetch Couch 4 2023-11-19 02:23:36,505 - services.stateFetch - DEBUG - {'on': True, 'bri': 254, 'xy': [0, 0], 'ct': 324, 'hue': 0, 'sat': 254, 'colormode': 'ct'} 2023-11-19 02:23:36,506 - services.stateFetch - DEBUG - fetch Decke Pc 1 2023-11-19 02:23:36,612 - services.stateFetch - DEBUG - {'on': True, 'bri': 254, 'xy': [0.2324, 0.0863], 'ct': 333, 'hue': 0, 'sat': 254, 'colormode': 'xy'} 2023-11-19 02:23:36,613 - services.stateFetch - DEBUG - fetch Decke Pc 2 2023-11-19 02:23:36,637 - services.stateFetch - DEBUG - {'on': True, 'bri': 254, 'xy': [0.2324, 0.0863], 'ct': 333, 'hue': 0, 'sat': 254, 'colormode': 'xy'} 2023-11-19 02:23:36,638 - services.stateFetch - DEBUG - fetch Decke Pc 3 2023-11-19 02:23:36,661 - services.stateFetch - DEBUG - {'on': True, 'bri': 254, 'xy': [0.2324, 0.0863], 'ct': 333, 'hue': 0, 'sat': 254, 'colormode': 'xy'} 2023-11-19 02:23:36,662 - services.stateFetch - DEBUG - fetch Decke Pc 4 2023-11-19 02:23:36,680 - werkzeug - INFO - 192.168.178.194 - - [19/Nov/2023 02:23:36] "GET /static/js/352.863805ec.chunk.js HTTP/1.1" 304 - 2023-11-19 02:23:36,691 - werkzeug - INFO - 192.168.178.194 - - [19/Nov/2023 02:23:36] "GET /favicon.ico HTTP/1.1" 200 - 2023-11-19 02:23:36,700 - services.stateFetch - DEBUG - {'on': True, 'bri': 254, 'xy': [0.2324, 0.0863], 'ct': 333, 'hue': 0, 'sat': 254, 'colormode': 'xy'} 2023-11-19 02:23:36,701 - services.stateFetch - DEBUG - fetch Decke Pc 5 2023-11-19 02:23:36,723 - services.stateFetch - DEBUG - {'on': True, 'bri': 254, 'xy': [0.2324, 0.0863], 'ct': 333, 'hue': 0, 'sat': 254, 'colormode': 'xy'} 2023-11-19 02:23:36,724 - services.stateFetch - DEBUG - fetch Decke Pc 6 2023-11-19 02:23:36,746 - services.stateFetch - DEBUG - {'on': True, 'bri': 254, 'xy': [0.2324, 0.0863], 'ct': 333, 'hue': 0, 'sat': 254, 'colormode': 'xy'} 2023-11-19 02:23:37,234 - werkzeug - INFO - 127.0.0.1 - - [19/Nov/2023 02:23:37] "GET /api/40649f2c200c11eebde7b827eb9bef6e/groups/0 HTTP/1.1" 200 - [2023-11-19 02:23:37,510] ERROR in app: Exception on /api/40649f2c200c11eebde7b827eb9bef6e/config [PUT] Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1516, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1502, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(req.view_args) File "/usr/local/lib/python3.9/dist-packages/flask_restful/init.py", line 467, in wrapper resp = resource(*args, *kwargs) File "/usr/local/lib/python3.9/dist-packages/flask/views.py", line 84, in view return current_app.ensure_sync(self.dispatch_request)(args, kwargs) File "/usr/local/lib/python3.9/dist-packages/flask_restful/init.py", line 582, in dispatch_request resp = meth(*args, **kwargs) File "/opt/hue-emulator/flaskUI/restful.py", line 274, in put bridgeConfig[resource][key].update(value) AttributeError: 'bool' object has no attribute 'update' 2023-11-19 02:23:37,518 - werkzeug - INFO - 192.168.178.194 - - [19/Nov/2023 02:23:37] "PUT /api/40649f2c200c11eebde7b827eb9bef6e/config HTTP/1.1" 500 - 2023-11-19 02:23:38,440 - werkzeug - INFO - 192.168.178.79 - - [19/Nov/2023 02:23:38] "GET /api/0ccbdf0a22fe11eea82eb827eb9bef6e/lights HTTP/1.1" 200 - 2023-11-19 02:23:39,669 - werkzeug - INFO - 192.168.176.61 - - [19/Nov/2023 02:23:39] "GET /api/ZzUkG-PVvLLz3oiJZdxX82DvAsCgp25mgXhsJR8c/lights HTTP/1.1" 200 - 2023-11-19 02:23:39,701 - werkzeug - INFO - 192.168.176.61 - - [19/Nov/2023 02:23:39] "GET /api/ZzUkG-PVvLLz3oiJZdxX82DvAsCgp25mgXhsJR8c/lights HTTP/1.1" 200 - 2023-11-19 02:23:39,729 - werkzeug - INFO - 192.168.176.61 - - [19/Nov/2023 02:23:39] "GET /api/ZzUkG-PVvLLz3oiJZdxX82DvAsCgp25mgXhsJR8c/lights HTTP/1.1" 200 - 2023-11-19 02:23:39,752 - werkzeug - INFO - 192.168.176.61 - - [19/Nov/2023 02:23:39] "GET /api/ZzUkG-PVvLLz3oiJZdxX82DvAsCgp25mgXhsJR8c/lights HTTP/1.1" 200 - 2023-11-19 02:23:39,778 - werkzeug - INFO - 192.168.176.61 - - [19/Nov/2023 02:23:39] "GET /api/ZzUkG-PVvLLz3oiJZdxX82DvAsCgp25mgXhsJR8c/lights HTTP/1.1" 200 - 2023-11-19 02:23:39,821 - werkzeug - INFO - 192.168.176.61 - - [19/Nov/2023 02:23:39] "GET /api/ZzUkG-PVvLLz3oiJZdxX82DvAsCgp25mgXhsJR8c/lights HTTP/1.1" 200 - 2023-11-19 02:23:39,847 - werkzeug - INFO - 192.168.176.61 - - [19/Nov/2023 02:23:39] "GET /api/ZzUkG-PVvLLz3oiJZdxX82DvAsCgp25mgXhsJR8c/lights HTTP/1.1" 200 - pi@raspberrypi:/mnt/hue-emulator/config $ #

Steps to reproduce

Don't really have steps to reproduce because it occoured some time in that process.

Please enter your operating system details here

Raspberry Pi 3b Running Homebridge and Diy Hue.

What DiyHue version(branch) are you using?

master (latest)

mariusmotea commented 7 months ago

Hi,

This is a know bug, if you press linkbutton in Hue Essetials it will send a json with true (boolean) value were we store an array, and this broke the linkbutton function. To fix it stop the service/docker container and manually edit config.yaml file.

You probably have linkbutton: true

to fix it change it to an array like this:

linkbutton:
  lastlinkbuttonpushed: 1699859027
RowMax03 commented 7 months ago

Thank you!