zsxsoft / fava-management

A fava management panel.
41 stars 8 forks source link

Issue with Redirect connection #1

Open jacobburrell opened 3 years ago

jacobburrell commented 3 years ago

When trying to "enter fava" I receive the following error: Max retries exceeded with url: /fava/ (Caused by NewConnectionError

MaxRetryError at /fava/
HTTPConnectionPool(host='127.0.0.1', port=57750): Max retries exceeded with url: /fava/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10e724340>: Failed to establish a new connection: [Errno 61] Connection refused'))
jacobburrell commented 3 years ago

The solution seemed to be to modify ProxyView from Django revProxy

Specifically, it seems the port passed from the self.process.port is invalid, causing an infinite loop of retries trying to connect to the wrong port:

self.upstream = 'http://127.0.0.1:' + str(self.process.port) + '/fava/'

You can hard-code the port e.g. self.upstream = 'http://127.0.0.1:' + str(8005) + '/fava/'

Setting the right port fixes this, though seems there probably should to be a fix within the find_free_port function.

jacobburrell commented 3 years ago

Looks like this could have been a configuration issue on my end.

zsxsoft commented 3 years ago

I used find_free_port here, https://github.com/zsxsoft/fava-management/blob/master/proxy/process.py#L25 Can you share your configuration here? Thanks.