Funkwhale Mono-Container Help


#1

I am looking to try funkwhale out as it looks pretty cool. I only want to try it out on my local network though.

I have followed the instructions for the mono container installation: https://docs.funkwhale.audio/installation/docker.html#mono-container-installation

I believe I have followed the guide exactly, except when editing the .env file:

echo “FUNKWHALE_HOSTNAME=192.168.1.234” >> .env
echo “FUNKWHALE_PROTOCOL=http” >> .env

I used http instead of https and the hostname was my servers IP address.

However, when I goto 192.168.1.234:5000 as instructed, I get a 504 Gateway Time-out error.

I ran: docker logs -f --tail=50 funkwhale

2019-03-17 09:41:26,721 ERROR Internal Server Error: /
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/urllib3/connection.py”, line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File “/usr/lib/python3.6/site-packages/urllib3/util/connection.py”, line 80, in create_connection
raise err
File “/usr/lib/python3.6/site-packages/urllib3/util/connection.py”, line 70, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 600, in urlopen
chunked=chunked)
File “/usr/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File “/usr/lib/python3.6/http/client.py”, line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File “/usr/lib/python3.6/http/client.py”, line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File “/usr/lib/python3.6/http/client.py”, line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File “/usr/lib/python3.6/http/client.py”, line 1026, in _send_output
self.send(msg)
File “/usr/lib/python3.6/http/client.py”, line 964, in send
self.connect()
File “/usr/lib/python3.6/site-packages/urllib3/connection.py”, line 181, in connect
conn = self._new_conn()
File “/usr/lib/python3.6/site-packages/urllib3/connection.py”, line 168, in _new_conn
self, “Failed to establish a new connection: %s” % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f6009a60c18>: Failed to establish a new connection: [Errno 110] Operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/requests/adapters.py”, line 449, in send
timeout=timeout
File “/usr/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File “/usr/lib/python3.6/site-packages/urllib3/util/retry.py”, line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=‘192.168.1.234’, port=80): Max retries exceeded with url: /front/index.html (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7f6009a60c18>: Failed to establish a new connection: [Errno 110] Operation timed out’,))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/django/core/handlers/exception.py”, line 34, in inner
response = get_response(request)
File “./funkwhale_api/common/middleware.py”, line 135, in call
return serve_spa(request)
File “./funkwhale_api/common/middleware.py”, line 22, in serve_spa
html = get_spa_html(settings.FUNKWHALE_SPA_HTML_ROOT)
File “./funkwhale_api/common/middleware.py”, line 66, in get_spa_html
verify=settings.EXTERNAL_REQUESTS_VERIFY_SSL,
File “/usr/lib/python3.6/site-packages/requests/api.py”, line 75, in get
return request(‘get’, url, params=params, **kwargs)
File “/usr/lib/python3.6/site-packages/requests/api.py”, line 60, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/lib/python3.6/site-packages/requests/sessions.py”, line 533, in request
resp = self.send(prep, **send_kwargs)
File “/usr/lib/python3.6/site-packages/requests/sessions.py”, line 646, in send
r = adapter.send(request, **kwargs)
File “/usr/lib/python3.6/site-packages/requests/adapters.py”, line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host=‘192.168.1.234’, port=80): Max retries exceeded with url: /front/index.html (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7f6009a60c18>: Failed to establish a new connection: [Errno 110] Operation timed out’,))

My experience with docker is minimal, so I’m not sure if I stuffed something up. My system is ubuntu 18.04 LTS.

Any help to get it up and running would be appreciated.

Thanks


#2

Hi there @bender, I think your issue is in the way we handle things internally in the container.

Can you try adding this to your .env file: FUNKWHALE_SPA_HTML_ROOT=/app/front/dist/index.html

then delete the container and recreate it?


#3

Hi @eliotberriot, thanks for the help!

After adding the line to the .env file (and recreating the container) the log produced:

2019-03-19 09:21:23,590 ERROR    Internal Server Error: /
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "./funkwhale_api/common/middleware.py", line 135, in __call__
    return serve_spa(request)
  File "./funkwhale_api/common/middleware.py", line 22, in serve_spa
    html = get_spa_html(settings.FUNKWHALE_SPA_HTML_ROOT)
  File "./funkwhale_api/common/middleware.py", line 66, in get_spa_html
    verify=settings.EXTERNAL_REQUESTS_VERIFY_SSL,
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 519, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 462, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 313, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 387, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL '/app/front/dist/index.html/index.html': No schema supplied. Perhaps you meant http:///app/front/dist/index.html/index.html?
2019-03-19 09:21:23,826 ERROR    Internal Server Error: /favicon.ico
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "./funkwhale_api/common/middleware.py", line 135, in __call__
    return serve_spa(request)
  File "./funkwhale_api/common/middleware.py", line 22, in serve_spa
    html = get_spa_html(settings.FUNKWHALE_SPA_HTML_ROOT)
  File "./funkwhale_api/common/middleware.py", line 66, in get_spa_html
    verify=settings.EXTERNAL_REQUESTS_VERIFY_SSL,
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 519, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 462, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 313, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 387, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL '/app/front/dist/index.html/index.html': No schema supplied. Perhaps you meant http:///app/front/dist/index.html/index.html?
2019-03-19 09:21:27,886 ERROR    Internal Server Error: /
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "./funkwhale_api/common/middleware.py", line 135, in __call__
    return serve_spa(request)
  File "./funkwhale_api/common/middleware.py", line 22, in serve_spa
    html = get_spa_html(settings.FUNKWHALE_SPA_HTML_ROOT)
  File "./funkwhale_api/common/middleware.py", line 66, in get_spa_html
    verify=settings.EXTERNAL_REQUESTS_VERIFY_SSL,
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 519, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 462, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 313, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 387, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL '/app/front/dist/index.html/index.html': No schema supplied. Perhaps you meant http:///app/front/dist/index.html/index.html?
2019-03-19 09:21:32,247 ERROR    Internal Server Error: /
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "./funkwhale_api/common/middleware.py", line 135, in __call__
    return serve_spa(request)
  File "./funkwhale_api/common/middleware.py", line 22, in serve_spa
    html = get_spa_html(settings.FUNKWHALE_SPA_HTML_ROOT)
  File "./funkwhale_api/common/middleware.py", line 66, in get_spa_html
    verify=settings.EXTERNAL_REQUESTS_VERIFY_SSL,
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 519, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 462, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 313, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 387, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL '/app/front/dist/index.html/index.html': No schema supplied. Perhaps you meant http:///app/front/dist/index.html/index.html?

I then tried changing it to: FUNKWHALE_SPA_HTML_ROOT=http://app/front/dist/index.html and FUNKWHALE_SPA_HTML_ROOT=http://app/front/dist
The log then produced:

2019-03-19 09:31:25,960 ERROR    Internal Server Error: /
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/urllib3/connection.py", line 159, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/lib/python3.6/site-packages/urllib3/util/connection.py", line 57, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 354, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/lib/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/usr/lib/python3.6/site-packages/urllib3/connection.py", line 181, in connect
    conn = self._new_conn()
  File "/usr/lib/python3.6/site-packages/urllib3/connection.py", line 168, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7ff2a2caeb00>: Failed to establish a new connection: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3.6/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='app', port=80): Max retries exceeded with url: /front/dist/index.html/index.html (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ff2a2caeb00>: Failed to establish a new connection: [Errno -2] Name does not resolve',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "./funkwhale_api/common/middleware.py", line 135, in __call__
    return serve_spa(request)
  File "./funkwhale_api/common/middleware.py", line 22, in serve_spa
    html = get_spa_html(settings.FUNKWHALE_SPA_HTML_ROOT)
  File "./funkwhale_api/common/middleware.py", line 66, in get_spa_html
    verify=settings.EXTERNAL_REQUESTS_VERIFY_SSL,
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='app', port=80): Max retries exceeded with url: /front/dist/index.html/index.html (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ff2a2caeb00>: Failed to establish a new connection: [Errno -2] Name does not resolve',))

Finally I tried: FUNKWHALE_SPA_HTML_ROOT=app/front/dist

and the log produced:

2019-03-19 09:53:24,537 ERROR    Internal Server Error: /
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "./funkwhale_api/common/middleware.py", line 135, in __call__
    return serve_spa(request)
  File "./funkwhale_api/common/middleware.py", line 22, in serve_spa
    html = get_spa_html(settings.FUNKWHALE_SPA_HTML_ROOT)
  File "./funkwhale_api/common/middleware.py", line 66, in get_spa_html
    verify=settings.EXTERNAL_REQUESTS_VERIFY_SSL,
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 519, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 462, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 313, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 387, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL 'app/front/dist/index.html': No schema supplied. Perhaps you meant http://app/front/dist/index.html?

Thanks again for the help.


#4

Oh, right, this change is not released yet, sorry. I’ll try to push a 0.18.3 release this week, sorry for the trouble!


#5

Thanks and no problem. I’ll look forward to the 0.18.3 release and update with the result.


#6

I saw 0.18.3 was released, updated and retried the suggestion and was able to get it working!

Thanks again for the help.