andrea-mattioli / mattiols_hassio_repository

Home Assistant Repository Addons
16 stars 13 forks source link

Internal Server Error #77

Open thecesco opened 10 months ago

thecesco commented 10 months ago

Hi Andrea, i'm getting an error on "get your code" step: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

Here the log:

6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[11:31:50] INFO: Smarter file already exist and contain some data.
[11:31:50] INFO: Setup config file...
 * Serving Flask app 'bticino'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:5588
 * Running on http://172.30.33.3:5588
Press CTRL+C to quit
[2023-10-30 11:32:10,124] ERROR in app: Exception on /callback [GET]
Traceback (most recent call last):
  File "/hassio_bticino_smarter/bticino.py", line 299, in get_plants
    plants = json.loads(response.text)['plants']
             ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'plants'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/flask/app.py", line 1455, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/flask/app.py", line 869, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/flask/app.py", line 867, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/flask/app.py", line 852, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/hassio_bticino_smarter/bticino.py", line 744, in callback
    my_plants=get_plants(access_token)
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/hassio_bticino_smarter/bticino.py", line 307, in get_plants
    print("[Errno {0}] {1}".format(e.errno, e.strerror))
                                   ^^^^^^^
AttributeError: 'KeyError' object has no attribute 'errno'
192.168.178.85 - - [30/Oct/2023 11:32:10] "GET /callback?code=blablabla HTTP/1.1" 500 -
Luca1996O commented 9 months ago

Same issue here. Same lines error.

Any solution, @andrea-mattioli ?

engal89 commented 9 months ago

I had a similar error. I go to Legrand API web console (https://developer.legrand.com/) and i see that my secret was expired. I generate a new one and simply replace the old one in HA configuration. Maybe it can help to solve the problem.