styxit / HTPC-Manager

A fully responsive interface to manage all your favorite software on your Htpc.
http://htpc.io
MIT License
530 stars 183 forks source link

500 Internal Server Error after setting up dashbaord #386

Open christsim opened 7 years ago

christsim commented 7 years ago

Hi.

I started setting up sickbeard, sabnzbd, plex etc. and when I decided to add some items to the dashboard i got the following error:

2017-06-04 23:39:30 :: htpc.server :: INFO :: Starting up webserver
2017-06-04 23:39:30 :: cherrypy.error :: INFO :: [04/Jun/2017:23:39:30] ENGINE Listening for SIGHUP.
2017-06-04 23:39:30 :: cherrypy.error :: INFO :: [04/Jun/2017:23:39:30] ENGINE Listening for SIGTERM.
2017-06-04 23:39:30 :: cherrypy.error :: INFO :: [04/Jun/2017:23:39:30] ENGINE Listening for SIGUSR1.
2017-06-04 23:39:30 :: cherrypy.error :: INFO :: [04/Jun/2017:23:39:30] ENGINE Bus STARTING
2017-06-04 23:39:30 :: cherrypy.error :: INFO :: [04/Jun/2017:23:39:30] ENGINE Serving on http://0.0.0.0:8085
2017-06-04 23:39:30 :: cherrypy.error :: INFO :: [04/Jun/2017:23:39:30] ENGINE Bus STARTED
2017-06-04 23:39:31 :: cherrypy.error.139835536209232 :: ERROR :: [04/Jun/2017:23:39:31] HTTP
Traceback (most recent call last):
  File "/app/htpcmanager/libs/cherrypy/_cprequest.py", line 670, in respond
    response.body = self.handler()
  File "/app/htpcmanager/libs/cherrypy/lib/encoding.py", line 217, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/app/htpcmanager/libs/cherrypy/_cpdispatch.py", line 61, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/app/htpcmanager/htpc/root.py", line 53, in index
    return htpc.LOOKUP.get_template('dash.html').render(scriptname='dash')
  File "/app/htpcmanager/libs/mako/template.py", line 443, in render
    return runtime._render(self, self.callable_, args, data)
  File "/app/htpcmanager/libs/mako/runtime.py", line 803, in _render
    **_kwargs_for_callable(callable_, data))
  File "/app/htpcmanager/libs/mako/runtime.py", line 835, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/app/htpcmanager/libs/mako/runtime.py", line 860, in _exec_template
    callable_(context, *args, **kwargs)
  File "base_html", line 71, in render_body
  File "/app/htpcmanager/htpc/settings.py", line 45, in get
    val = Setting.selectBy(key=key).getOne().val
  File "/app/htpcmanager/libs/sqlobject/sresults.py", line 287, in getOne
    % results)
SQLObjectIntegrityError: More than one result returned from query: [<Setting 55 key='app_use_heavy_font' val='0'>, <Setting 57 key='app_use_heavy_font' val='0'>]

Regards, Chris

Hellowlol commented 7 years ago

Delete the duplicate entry in the db

christsim commented 7 years ago

Sure, that works. Was just reporting it so that the code get fixed.

Here are my steps to fix it:

/htpcmanager⟫ sudo apt-get install sqlite
/htpcmanager⟫ sqlite3 database.db
sqlite> delete from setting where id = 57;

Thanks.