Hellowlol / HTPC-Manager

A fully responsive interface to manage all your favorite software on your Htpc.
MIT License
344 stars 48 forks source link

Error 400: Bad Request #453

Closed billwurles closed 7 years ago

billwurles commented 8 years ago

I just installed the manager, I'm running Debian 8 Jessie, along with sickrage, couchpotato, transmission, apache, plex, emby, php & mysql and a whole load of other things that are probably conflicting. I'm accessing from OS X El Capitan on Chrome.

When I load the site, I get this error:

400 Bad Request

Illegal cookie name sickrage_user

Traceback (most recent call last): File "/opt/HTPCManager/libs/cherrypy/_cprequest.py", line 635, in respond self.process_headers() File "/opt/HTPCManager/libs/cherrypy/_cprequest.py", line 737, in process_headers raise cherrypy.HTTPError(400, msg) HTTPError: (400, 'Illegal cookie name sickrage_user')

So I obviously tried to delete my cookies but that didn't work, however accessing the site from incognito mode works. As I write this, I just tried to access the server from its IP rather than its hostname and that works so now I'm incredibly confused.

Hellowlol commented 8 years ago

What was teh cookie value? Cherrypy chokes on it, but i cant seem to reproduce it.

billwurles commented 8 years ago

I can't see any actual cookies that have anything to do with sickrage or my server or HTPCmanager

billwurles commented 8 years ago

Honestly I can live without it, I use an external domain to access it anyway.

Hellowlol commented 8 years ago

I think cookies is sent to the same "domain" hosting the service.

So say you host sickrage, sabnzbd on 10.0.0.97

When i try to connect to htpc manager on 10.0.0.97:8986/htpc my browser sends this cookies in the request:

plushContainerWidth=100%25; plushMultiOps=1; plushNoTopMenu=0; _ga=; session_id=

As you can see it sends cookies for other services (plush is sabnzbd cookies)

You can use your browsers dev tools to see the cookies your browser sends.

billwurles commented 8 years ago

So where would I see the cookies it's sending in the request?

Hellowlol commented 8 years ago

open your browsers dev tools and hit f5, click the network tab and find the request for the HTML page, click it and and you should see the request headers

rkorn86 commented 8 years ago

Same issue here, but with a cookie, which was set by calling PhpMyAdmin on the same server.

Illegal cookie name pmaCookieVer

Traceback (most recent call last):
  File "/opt/htpc-manager/libs/cherrypy/_cprequest.py", line 635, in respond
    self.process_headers()
  File "/opt/htpc-manager/libs/cherrypy/_cprequest.py", line 737, in process_headers
    raise cherrypy.HTTPError(400, msg)
HTTPError: (400, 'Illegal cookie name pmaCookieVer')

For security reasons im not willing to post the cookie value, but you can reproduce it by setting up PMA on the same machine, open PMA, login to pma, open HTPC-Manager.

Hellowlol commented 8 years ago

I can't be cba with that. What Python version is this? It would be easy to fix. I haven't decided it I should and what the consequence would be.

rkorn86 commented 8 years ago
root@wandboard - 11:38:11 - ~ # ps | grep htpc
root     12049  0.0  0.0   4856   840 pts/0    S+   11:38   0:00          \_ grep htpc
htpc-ma+  8442  0.8  1.6 189284 33840 ?        Sl   09:01   1:16 python2 /opt/htpc-manager/Htpc.py --daemon --port 7000 --datadir /opt/htpc-manager --loglevel WARNING --pid /run/htpc-manager/htpc-manager.pid
root@wandboard - 11:38:13 - ~ # python2 -V
Python 2.7.11
Hellowlol commented 8 years ago

Thanks!

Hellowlol commented 8 years ago

You can try to patch this yourself if you want to. Just replace the line with raise cherrypy... with continue

rkorn86 commented 8 years ago

Problem is, that the cookie somehow got modified, so that pma running on nginx gives an error about malformed request. Will be using python3 an alternative solution or whats the reason of the error? Sorry, im a python noob.

Hellowlol commented 8 years ago

No, py3 is not supported. I don't know why it fails. Does this happens both via the reverse proxy and using the local network?

rkorn86 commented 8 years ago

Im not using reverse proxy for htpc-manager. Nginx is only serving my pma instance.

Hellowlol commented 8 years ago

https://repl.it/CGCt

Hellowlol commented 7 years ago

Closing this as its old and didnt get a response