ansible issueshttps://dev.funkwhale.audio/funkwhale/ansible/-/issues2023-11-09T13:39:24Zhttps://dev.funkwhale.audio/funkwhale/ansible/-/issues/38funkwhale : reload nginx failing when using http only2023-11-09T13:39:24Ziameru1funkwhale : reload nginx failing when using http onlyI am running the following, reproducible with vagrant:
Vagrantfile:
```
Vagrant.configure("2") do |config|
config.vm.define "funkwhale"
config.vm.hostname = "funkwhale"
config.vm.box = "generic/debian12"
end
```
Playbook:
```
- h...I am running the following, reproducible with vagrant:
Vagrantfile:
```
Vagrant.configure("2") do |config|
config.vm.define "funkwhale"
config.vm.hostname = "funkwhale"
config.vm.box = "generic/debian12"
end
```
Playbook:
```
- hosts: funkwhale-servers
roles:
- role: funkwhale
funkwhale_hostname: funkwhale.local
funkwhale_letsencrypt_email: harri@krishna.com
funkwhale_protocol: http
funkwhale_letsencrypt_enabled: false
```
this yields the error:
```
RUNNING HANDLER [funkwhale : reload nginx] **************************************************************************************************************************************************************************
fatal: [vagrant@192.168.121.239]: FAILED! => {"changed": false, "msg": "Unable to reload service nginx: Job for nginx.service failed.\nSee \"systemctl status nginx.service\" and \"journalctl -xeu nginx.service\" for details.\n"}
```
It is probably because the `/etc/nginx/sites-enabled/funkwhale.local.conf` looks like this
note, I will omit the full server block for 443 as you get the point probably.
```
upstream funkwhale-api {
server 127.0.0.1:5000;
}
server {
listen 80;
listen [::]:80;
server_name funkwhale.local;
location /.well-known/ {
allow all;
include /etc/nginx/funkwhale_proxy.conf;
proxy_pass http://127.0.0.1:5000/.well-known/;
}
location / {
return 301 https://$host$request_uri;
}
}
# Required for websocket support.
map $http_upgrade $funkwhale_connection_upgrade {
default upgrade;
'' close;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
charset utf-8;
server_name funkwhale.local;
ssl_certificate /etc/letsencrypt/live/funkwhale.local/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/funkwhale.local/privkey.pem;
### REST OF BLOCK OMITTED
```https://dev.funkwhale.audio/funkwhale/ansible/-/issues/37Migrated from Debian 11 to 12 with ansible playbook2024-02-06T07:23:15ZkippixMigrated from Debian 11 to 12 with ansible playbookHi all,
I'm writing this problem to share my experience of upgrading this program. But in the end, I have a problem that I don't know how to solve. Maybe someone can help me.
## Debian full-upgrade
Make the full-upgrade steps describe...Hi all,
I'm writing this problem to share my experience of upgrading this program. But in the end, I have a problem that I don't know how to solve. Maybe someone can help me.
## Debian full-upgrade
Make the full-upgrade steps describe by debian projet.
## Upgrade funkwhales via this ansible
Checkout this branch:
- git checkout test-debian-12
Define the target version of funkwhales:
- Bump latest version by define : funkwhale_version: 1.3.3
And I got this issue:
```
[17:01:41] ansible-funkwhale : Setup virtualenv | hifi.foobar.network | FAILED | 679ms
{
- msg: :stderr: Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = '/srv/funkwhale/virtualenv/bin/python3'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/srv/funkwhale/virtualenv/bin/python3'
sys.base_prefix = '/usr'
sys.base_exec_prefix = '/usr'
sys.platlibdir = 'lib'
sys.executable = '/srv/funkwhale/virtualenv/bin/python3'
sys.prefix = '/usr'
sys.exec_prefix = '/usr'
sys.path = [
'/usr/lib/python39.zip',
'/usr/lib/python3.9',
'/usr/lib/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007fe3fad37740 (most recent call first):
<no Python frame>
- cmd: [
- /srv/funkwhale/virtualenv/bin/pip3
- freeze
]
- changed: False
}
```
**Solved by :** upgrade python-venv from 3.9 to 3.11.
```
su - funkwhales -s /bin/bash
python3 -m venv --upgrade ./virtualenv`
```
Second ansible run, I got another issue:
```
[17:22:52] ansible-funkwhale : Check if requirements.txt exists | hifi.foobar.network | FAILED | 364ms
{
- msg: Permission denied
- changed: False
}
```
**Solved by :** add become vars to task
```
- name: "Setup virtualenv"
become: true
become_user: "{{ funkwhale_username }}"
pip:
name:
- "wheel"
- "pip>=21.3"
- "setuptools>=64"
virtualenv: "{{ funkwhale_install_path }}/virtualenv"
virtualenv_python: python3
```
Now, I stack on this issue:
```
Oct 17 17:48:58 hifi systemd[1]: funkwhale-server.service: Sending signal SIGHUP to process 5927 (gunicorn) on client request.
Oct 17 17:48:58 hifi gunicorn[5925]: [2023-10-17 17:48:58 +0200] [5925] [WARNING] Worker with pid 5927 was terminated due to signal 1
Oct 17 17:48:58 hifi gunicorn[5937]: [2023-10-17 17:48:58 +0200] [5937] [INFO] Booting worker with pid: 5937
Oct 17 17:48:58 hifi gunicorn[5937]: 2023-10-17 17:48:58,784 funkwhale_api.config INFO Loaded env file at /srv/funkwhale/config/.env
Oct 17 17:48:58 hifi gunicorn[5937]: 2023-10-17 17:48:58,784 funkwhale_api.config INFO Running with the following plugins enabled: funkwhale_api.contrib.scrobbler, funkwhale_api.contrib.listenbrainz, funkwhale_api.contrib.maloja
Oct 17 17:49:00 hifi gunicorn[5937]: [2023-10-17 15:49:00 +0000] [5937] [INFO] Started server process [5937]
Oct 17 17:49:00 hifi gunicorn[5937]: [2023-10-17 15:49:00 +0000] [5937] [INFO] Waiting for application startup.
Oct 17 17:49:00 hifi gunicorn[5937]: [2023-10-17 15:49:00 +0000] [5937] [INFO] ASGI 'lifespan' protocol appears unsupported.
Oct 17 17:49:00 hifi gunicorn[5937]: [2023-10-17 15:49:00 +0000] [5937] [INFO] Application startup complete.
Oct 17 17:49:16 hifi gunicorn[5937]: [2023-10-17 15:49:16 +0000] [5937] [INFO] ('10.0.0.1', 0) - "WebSocket /api/v1/activity?token=null" 403
Oct 17 17:49:16 hifi gunicorn[5937]: [2023-10-17 15:49:16 +0000] [5937] [INFO] connection failed (403 Forbidden)
Oct 17 17:49:16 hifi gunicorn[5937]: [2023-10-17 15:49:16 +0000] [5937] [INFO] connection closed
Oct 17 17:49:16 hifi gunicorn[5937]: [2023-10-17 15:49:16 +0000] [5937] [ERROR] Exception in ASGI application
Oct 17 17:49:16 hifi gunicorn[5937]: Traceback (most recent call last):
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 238, in run_asgi
Oct 17 17:49:16 hifi gunicorn[5937]: result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
Oct 17 17:49:16 hifi gunicorn[5937]: return await self.app(scope, receive, send)
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/channels/routing.py", line 62, in __call__
Oct 17 17:49:16 hifi gunicorn[5937]: return await application(scope, receive, send)
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/channels/sessions.py", line 47, in __call__
Oct 17 17:49:16 hifi gunicorn[5937]: return await self.inner(dict(scope, cookies=cookies), receive, send)
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/channels/sessions.py", line 263, in __call__
Oct 17 17:49:16 hifi gunicorn[5937]: return await self.inner(wrapper.scope, receive, wrapper.send)
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/channels/auth.py", line 185, in __call__
Oct 17 17:49:16 hifi gunicorn[5937]: return await super().__call__(scope, receive, send)
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/channels/middleware.py", line 24, in __call__
Oct 17 17:49:16 hifi gunicorn[5937]: return await self.inner(scope, receive, send)
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/channels/routing.py", line 116, in __call__
Oct 17 17:49:16 hifi gunicorn[5937]: return await application(
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/channels/consumer.py", line 94, in app
Oct 17 17:49:16 hifi gunicorn[5937]: return await consumer(scope, receive, send)
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/channels/consumer.py", line 58, in __call__
Oct 17 17:49:16 hifi gunicorn[5937]: await await_many_dispatch(
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/channels/utils.py", line 50, in await_many_dispatch
Oct 17 17:49:16 hifi gunicorn[5937]: await dispatch(result)
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/asgiref/sync.py", line 479, in __call__
Oct 17 17:49:16 hifi gunicorn[5937]: ret: _R = await loop.run_in_executor(
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
Oct 17 17:49:16 hifi gunicorn[5937]: result = self.fn(*self.args, **self.kwargs)
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/channels/db.py", line 13, in thread_handler
Oct 17 17:49:16 hifi gunicorn[5937]: return super().thread_handler(loop, *args, **kwargs)
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/asgiref/sync.py", line 538, in thread_handler
Oct 17 17:49:16 hifi gunicorn[5937]: return func(*args, **kwargs)
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/channels/consumer.py", line 125, in dispatch
Oct 17 17:49:16 hifi gunicorn[5937]: handler(message)
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/channels/generic/websocket.py", line 105, in websocket_disconnect
Oct 17 17:49:16 hifi gunicorn[5937]: self.disconnect(message["code"])
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/api/funkwhale_api/common/consumers.py", line 22, in disconnect
Oct 17 17:49:16 hifi gunicorn[5937]: groups = self.scope["user"].get_channels_groups() + self.groups
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: File "/srv/funkwhale/virtualenv/lib/python3.11/site-packages/django/utils/functional.py", line 247, in inner
Oct 17 17:49:16 hifi gunicorn[5937]: return func(self._wrapped, *args)
Oct 17 17:49:16 hifi gunicorn[5937]: ^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 17 17:49:16 hifi gunicorn[5937]: AttributeError: 'AnonymousUser' object has no attribute 'get_channels_groups'
Oct 17 17:50:22 hifi gunicorn[5937]: [2023-10-17 15:50:22 +0000] [5937] [INFO] ('10.0.0.1', 0) - "WebSocket /api/v1/activity?token=null" 403
Oct 17 17:50:22 hifi gunicorn[5937]: [2023-10-17 15:50:22 +0000] [5937] [INFO] connection failed (403 Forbidden)
Oct 17 17:50:22 hifi gunicorn[5937]: [2023-10-17 15:50:22 +0000] [5937] [INFO] connection closed
```
CheersGeorg KrauseGeorg Krausehttps://dev.funkwhale.audio/funkwhale/ansible/-/issues/36Old version of pyopenssl causes trouble2023-09-22T09:20:15ZGeorg KrauseOld version of pyopenssl causes troubleReport: https://forum.funkwhale.audio/d/369-404-during-install/13
https://forum.funkwhale.audio/d/383-update-1210-to-133-failedReport: https://forum.funkwhale.audio/d/369-404-during-install/13
https://forum.funkwhale.audio/d/383-update-1210-to-133-failedhttps://dev.funkwhale.audio/funkwhale/ansible/-/issues/35reconfigure script erase S3 rules and other in nginx conf file2024-02-12T09:12:33ZJérémie Lorentereconfigure script erase S3 rules and other in nginx conf fileWhen you launch reconfigure script, parts of nginx conf file are remove. For example s3 config parts.
It would be great if when S3 variables are set in playbook.yml file, nginx conf file is generated properly
Thx!When you launch reconfigure script, parts of nginx conf file are remove. For example s3 config parts.
It would be great if when S3 variables are set in playbook.yml file, nginx conf file is generated properly
Thx!https://dev.funkwhale.audio/funkwhale/ansible/-/issues/34Migrate to pipx installed Ansible2023-08-23T12:21:57ZGeorg KrauseMigrate to pipx installed AnsibleRight now we are using two different ways to install ansible:
- Install ansible with `pip install --user`, which is the method we used in the past
- Install using custom venv, which we needed to use because debian 12 with python 3.11 do...Right now we are using two different ways to install ansible:
- Install ansible with `pip install --user`, which is the method we used in the past
- Install using custom venv, which we needed to use because debian 12 with python 3.11 doesn't like installations with `--user`
~~Sadly we cannot use pipx, because Debian 12 is still supported and doesn't ship a package, so we can only migrate everyone to a pipx installed ansible after it got EOL, which is 30 Jun 2024.~~
Debian 11 doesn't have a pipx package available, so we need to figure how to handle this and the EOL of Debian 10 doesn't really matter.2024-07-31https://dev.funkwhale.audio/funkwhale/ansible/-/issues/33Job Failed #1748422023-08-11T11:52:26ZGeorg KrauseJob Failed #174842Job [#174842](https://dev.funkwhale.audio/funkwhale/ansible/-/jobs/174842) failed for 041876023e3928555cfa8a82427270e06ad45f1c:
Seems like the pip version isn't recent enough to install from pyproject.toml.
Report: https://forum.funkwh...Job [#174842](https://dev.funkwhale.audio/funkwhale/ansible/-/jobs/174842) failed for 041876023e3928555cfa8a82427270e06ad45f1c:
Seems like the pip version isn't recent enough to install from pyproject.toml.
Report: https://forum.funkwhale.audio/d/342-issue-with-new-python-dependencies-when-upgrading-to-130https://dev.funkwhale.audio/funkwhale/ansible/-/issues/32Make sources owned by root2023-01-18T09:09:36ZGeorg KrauseMake sources owned by rootThe following discussion from !35 should be addressed:
- [ ] @jooola started a [discussion](https://dev.funkwhale.audio/funkwhale/ansible/-/merge_requests/35#note_44319): (+1 comment)
> I think source files should not be writable ...The following discussion from !35 should be addressed:
- [ ] @jooola started a [discussion](https://dev.funkwhale.audio/funkwhale/ansible/-/merge_requests/35#note_44319): (+1 comment)
> I think source files should not be writable by the runtime funkwhale user. This should be owned by root.https://dev.funkwhale.audio/funkwhale/ansible/-/issues/31‘funkwhale_version’ might be undefined for task “Set version to install”2022-12-28T04:07:37ZBen Finney‘funkwhale_version’ might be undefined for task “Set version to install”The task “Set version to install” depends on a value set for the variable ‘funkwhale_version’:
```yaml
- name: Set version to install
set_fact:
funkwhale_install_version: "{{ latest_version.get('content', funkwhale_version) | trim...The task “Set version to install” depends on a value set for the variable ‘funkwhale_version’:
```yaml
- name: Set version to install
set_fact:
funkwhale_install_version: "{{ latest_version.get('content', funkwhale_version) | trim }}"
```
That variable, though, is not defined anywhere in the Ansible role.
So, when that condition is not met, the task “Check latest version” is not run, the ‘latest_version’ variable is undefined, and then the task “Set version to install” fails with an error:
```
$ ansible-playbook ansible/playbooks/site.ansible.yaml --check --diff
[…]
TASK [funkwhale : Check latest version] ******************************************************************************************************************************************************************************************************
skipping: [lindale.whitetree]
TASK [funkwhale : Set version to install] ****************************************************************************************************************************************************************************************************
fatal: [lindale.whitetree]: FAILED! =>
msg: |-
The task includes an option with an undefined variable. The error was: 'funkwhale_version' is undefined. 'funkwhale_version' is undefined
The error appears to be in '/home/bignose/.ansible/roles/funkwhale/tasks/funkwhale.yml': line 9, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Set version to install
^ here
```https://dev.funkwhale.audio/funkwhale/ansible/-/issues/30Django secret key unreadable by “Retrieve secret key” task2023-07-03T21:30:54ZBen FinneyDjango secret key unreadable by “Retrieve secret key” taskThe task “Retrieve secret key from […]/django_secret_key” fails to read the generated secret key:
```
TASK [funkwhale : Create django_secret_key file] *************************************************************************************...The task “Retrieve secret key from […]/django_secret_key” fails to read the generated secret key:
```
TASK [funkwhale : Create django_secret_key file] *********************************************************************************************************************************************************************************************
--- before
+++ after: /home/bignose/.ansible/tmp/ansible-local-1119292ag4jz_a4/tmpbalcqqb6
@@ -0,0 +1 @@
+0e19646133b3e306ac4d03dca5f57cc6430d29c37e09a1bd47
\ No newline at end of file
changed: [lindale.whitetree]
TASK [funkwhale : Setup a dummy secret key] **************************************************************************************************************************************************************************************************
skipping: [lindale.whitetree]
TASK [funkwhale : Retrieve secret key from /srv/funkwhale/config/django_secret_key] **********************************************************************************************************************************************************
fatal: [lindale.whitetree]: FAILED! => changed=false
msg: 'file is not readable: /srv/funkwhale/config/django_secret_key'
```
This is because the task “Create django_secret_key file” correctly sets the file as readable only by the application user:
```
$ ls -l /srv/funkwhale/config/django_secret_key
-rw------- 1 funkwhale funkwhale 50 Dec 25 13:30 /srv/funkwhale/config/django_secret_key
```
but the “Retrieve secret key” task does not act as that user.
Instead, the “Retrieve secret key” task should use `become` and `become_user` to act as that application user on the remote host.https://dev.funkwhale.audio/funkwhale/ansible/-/issues/29Upgrade order incorrect2022-12-20T04:07:47ZJanekUpgrade order incorrect```sh
❯ sudo sh -c "$(curl -sSL https://get.funkwhale.audio/upgrade.sh)"
[Beginning upgrade]
[1/4] Retrieving currently installed version from /srv/funkwhale/ansible/playbook.yml
[1/4] No target version specified, retrieving latest vers...```sh
❯ sudo sh -c "$(curl -sSL https://get.funkwhale.audio/upgrade.sh)"
[Beginning upgrade]
[1/4] Retrieving currently installed version from /srv/funkwhale/ansible/playbook.yml
[1/4] No target version specified, retrieving latest version from https://docs.funkwhale.audio/latest.txt
Upgrade summary:
- Current version: 1.1.4
- Target version: 1.2.9
- Upgrading may cause temporary downtime on your pod
Do you want to proceed with the upgrade? [YES/no]:
[2/4] Replacing current version number in /srv/funkwhale/ansible/playbook.yml…
[3/4] Upgrading ansible dependencies...
[3/4] Upgrading Funkwhale using ansible playbook in /srv/funkwhale/ansible...
Traceback (most recent call last):
File "/root/.local/bin/ansible-galaxy", line 32, in <module>
from ansible import context
ModuleNotFoundError: No module named 'ansible'
❯ sudo sh -c "$(curl -sSL https://get.funkwhale.audio/upgrade.sh)"
[Beginning upgrade]
[1/4] Retrieving currently installed version from /srv/funkwhale/ansible/playbook.yml
[1/4] No target version specified, retrieving latest version from https://docs.funkwhale.audio/latest.txt
Upgrade summary:
- Current version: 1.2.9
- Target version: 1.2.9
- Upgrading may cause temporary downtime on your pod
Do you want to proceed with the upgrade? [YES/no]:
[2/4] Replacing current version number in /srv/funkwhale/ansible/playbook.yml…
[3/4] Upgrading ansible dependencies...
[3/4] Upgrading Funkwhale using ansible playbook in /srv/funkwhale/ansible...
Traceback (most recent call last):
File "/root/.local/bin/ansible-galaxy", line 32, in <module>
from ansible import context
ModuleNotFoundError: No module named 'ansible'
```
The version number should only be upgraded after the upgrade was successful.
Why ansible is missing (just as celery, looking at the logs), is still a mystery to me.https://dev.funkwhale.audio/funkwhale/ansible/-/issues/26Do not attempt to setup postgresql database on a remote server2022-10-15T19:36:26ZjooolaDo not attempt to setup postgresql database on a remote serverI propose to remove the capacity of this role to setup a remote database. This is too specific and does not belong here.
People can add the few extra steps before/after calling the funkwhale ansible role.I propose to remove the capacity of this role to setup a remote database. This is too specific and does not belong here.
People can add the few extra steps before/after calling the funkwhale ansible role.https://dev.funkwhale.audio/funkwhale/ansible/-/issues/24cannot import name 'environmentfilter' from 'jinja2.filters'2022-06-09T08:01:05ZDaliChinacannot import name 'environmentfilter' from 'jinja2.filters'When Try install on UBUNTO 20
Full Install ,
```
[WARNING]: Skipping plugin (/root/.local/lib/python3.8/site-
packages/ansible/plugins/filter/core.py) as it seems to be invalid: cannot
import name 'environmentfilter' from 'jinja2.fil...When Try install on UBUNTO 20
Full Install ,
```
[WARNING]: Skipping plugin (/root/.local/lib/python3.8/site-
packages/ansible/plugins/filter/core.py) as it seems to be invalid: cannot
import name 'environmentfilter' from 'jinja2.filters'
(/usr/local/lib/python3.8/dist-packages/jinja2/filters.py)
[WARNING]: Skipping plugin (/root/.local/lib/python3.8/site-
packages/ansible/plugins/filter/mathstuff.py) as it seems to be invalid: cannot
import name 'environmentfilter' from 'jinja2.filters'
(/usr/local/lib/python3.8/dist-packages/jinja2/filters.py)
TASK [funkwhale : Ensure home folder can be created] ***************************
fatal: [127.0.0.1]: FAILED! => {"msg": "template error while templating string: No filter named 'dirname'.. String: {{ funkwhale_install_path | dirname }}"}
PLAY RECAP *********************************************************************
127.0.0.1 : ok=11 changed=6 unreachable=0 failed=1 s kipped=3 rescued=0 ignored=0
```Georg KrauseGeorg Krausehttps://dev.funkwhale.audio/funkwhale/ansible/-/issues/23Missing License2022-10-20T10:31:41ZJulian-Samuel GebührMissing LicenseAdding a License would be great so that others can work with the role more freelyAdding a License would be great so that others can work with the role more freelyhttps://dev.funkwhale.audio/funkwhale/ansible/-/issues/22unable to connect to database: FATAL: database \"funkwhale\" does not exist2022-03-12T23:59:58ZAxelunable to connect to database: FATAL: database \"funkwhale\" does not existSeems like I'm missing a database?
```
$> ansible-playbook -i inventory.ini playbook.yml --check --diff
[WARNING]: Invalid characters were found in group names but not replaced, use
-vvvv to see details
[DEPRECATION WARNING]: "include" ...Seems like I'm missing a database?
```
$> ansible-playbook -i inventory.ini playbook.yml --check --diff
[WARNING]: Invalid characters were found in group names but not replaced, use
-vvvv to see details
[DEPRECATION WARNING]: "include" is deprecated, use include_tasks/import_tasks
instead. This feature will be removed in version 2.16. Deprecation warnings can
be disabled by setting deprecation_warnings=False in ansible.cfg.
PLAY [funkwhale-servers] *******************************************************
TASK [Gathering Facts] *********************************************************
ok: [CENSURED@CENSURED]
TASK [funkwhale : set a password for postgresql DB (remote psql server only)] ***
skipping: [CENSURED@CENSURED]
TASK [funkwhale : Set frontend path] *******************************************
ok: [CENSURED@CENSURED]
TASK [funkwhale : Install system packages] *************************************
The following additional packages will be installed:
libjpeg-turbo8-dev libjpeg8-dev libmagic-mgc libmagic1 python3-appdirs
python3-distlib python3-filelock
Suggested packages:
file libssl-doc
The following NEW packages will be installed:
libffi-dev libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev libldap2-dev
libmagic-dev libmagic-mgc libmagic1 libsasl2-dev libssl-dev
postgresql-client python3-appdirs python3-distlib python3-filelock
python3-virtualenv virtualenv
0 upgraded, 16 newly installed, 0 to remove and 0 not upgraded.
changed: [CENSURED@CENSURED]
TASK [funkwhale : Install postgresql] ******************************************
ok: [CENSURED@CENSURED]
TASK [funkwhale : Start Postgresql] ********************************************
ok: [CENSURED@CENSURED]
TASK [funkwhale : Create funkwhale database user on CENSURED@CENSURED (local / passwordless)] ***
[WARNING]: Using world-readable permissions for temporary files Ansible needs
to create when becoming an unprivileged user. This may be insecure. For
information on securing this, see https://docs.ansible.com/ansible-
core/2.12/user_guide/become.html#risks-of-becoming-an-unprivileged-user
changed: [CENSURED]
TASK [funkwhale : Create funkwhale database user on (remote / with password)] ***
skipping: [CENSURED]
TASK [funkwhale : Create funkwhale database on CENSURED@CENSURED] **********
[WARNING]: Using world-readable permissions for temporary files Ansible needs
to create when becoming an unprivileged user. This may be insecure. For
information on securing this, see https://docs.ansible.com/ansible-
core/2.12/user_guide/become.html#risks-of-becoming-an-unprivileged-user
changed: [CENSURED]
TASK [funkwhale : set up pgsql extensions] *************************************
[WARNING]: Using world-readable permissions for temporary files Ansible needs
to create when becoming an unprivileged user. This may be insecure. For
information on securing this, see https://docs.ansible.com/ansible-
core/2.12/user_guide/become.html#risks-of-becoming-an-unprivileged-user
failed: [CENSURED@CENSURED] (item=unaccent) => {"ansible_loop_var": "myext", "changed": false, "msg": "unable to connect to database: FATAL: database \"funkwhale\" does not exist\n", "myext": "unaccent"}
failed: [CENSURED@CENSURED] (item=citext) => {"ansible_loop_var": "myext", "changed": false, "msg": "unable to connect to database: FATAL: database \"funkwhale\" does not exist\n", "myext": "citext"}
PLAY RECAP *********************************************************************
CENSURED@CENSURED : ok=7 changed=3 unreachable=0 failed=1 skipped=2 rescued=0 ignored=0
```https://dev.funkwhale.audio/funkwhale/ansible/-/issues/21Delete venv and recreate it to avoid issues2022-02-20T04:04:05ZGeorg KrauseDelete venv and recreate it to avoid issueshttps://dev.funkwhale.audio/funkwhale/ansible/-/issues/20Automatically create user on "quick install"2023-08-11T12:05:24ZkadallahAutomatically create user on "quick install"For the most part, the Funkwhale installation went incredibly smooth, but now I'm having quite a bit of trouble creating users and logging into my server. I'd like to suggest creating admin users and Django account as a part of the playb...For the most part, the Funkwhale installation went incredibly smooth, but now I'm having quite a bit of trouble creating users and logging into my server. I'd like to suggest creating admin users and Django account as a part of the playbook.https://dev.funkwhale.audio/funkwhale/ansible/-/issues/19TASK [funkwhale: Create letsencrypt certificate] FAILED2021-08-19T04:04:09ZDanielTASK [funkwhale: Create letsencrypt certificate] FAILED<!--
Hi there! You are reporting a bug on this project, and we want to thank you!
If it's the first time you post here, please take a moment to read our Code of Conduct
(https://funkwhale.audio/code-of-conduct/) and ensure your issue re...<!--
Hi there! You are reporting a bug on this project, and we want to thank you!
If it's the first time you post here, please take a moment to read our Code of Conduct
(https://funkwhale.audio/code-of-conduct/) and ensure your issue respect our guidelines.
To ensure your bug report is as useful as possible, please try to stick
to the following structure. You can leave the parts text between `<!- ->`
markers untouched, they won't be displayed in your final message.
Please do not edit the following line, it's used for automatic classification
-->
## Steps to reproduce
Try installing funkwhale using the 'Quick Install' script.
## What happens?
When I try installing funkwhale using the 'Quick Install' guide, I get an error on 'Create letsencrypt certificate'. **I know that Let's Encrypt recently changed their way of verifying ownership of a domain.**
## What is expected?
Successfully installing funkwhale.
## Context
![output](/uploads/7d959755412c557104d166de3767f4c2/output.png)
I'm using Debian 11 (5.10.0-8-amd64) and I can't install funkwhale using the 'Quick Install' script `sudo sh -c "$(curl -sSL https://get.funkwhale.audio/)"`https://dev.funkwhale.audio/funkwhale/ansible/-/issues/18Certbot not working as expected on Ubuntu 20.04 and 21.042022-01-17T12:32:50ZCiarán Ainsworthsporiff@funkwhale.audioCertbot not working as expected on Ubuntu 20.04 and 21.04We've received the following report [through Twitter](https://twitter.com/komputerow/status/1392505480971526150?s=21):
> Hey, @funkwhaleaudio! Your automatic ansible-based istall is broken on ubuntu 20.04 and 21.04 The solution is to ru...We've received the following report [through Twitter](https://twitter.com/komputerow/status/1392505480971526150?s=21):
> Hey, @funkwhaleaudio! Your automatic ansible-based istall is broken on ubuntu 20.04 and 21.04 The solution is to run sudo snap install certbot --classic before running your scripthttps://dev.funkwhale.audio/funkwhale/ansible/-/issues/17Funkwhale worker not running after quick install2021-04-05T09:56:25ZGeorg KrauseFunkwhale worker not running after quick installI got several reports that the `funkwhale-worker` is not running after the quick install.I got several reports that the `funkwhale-worker` is not running after the quick install.https://dev.funkwhale.audio/funkwhale/ansible/-/issues/15SelectorEventLoop required, instead got uvloop.Loop2021-03-01T09:54:10ZcritterSelectorEventLoop required, instead got uvloop.LoopHey all. Not sure if this should go in the Ansible project or the main Funkwhale one, but I'm putting it here because I am experiencing this issue when installing with Ansible. Haven't tried a regular package just yet, but figured I'd lo...Hey all. Not sure if this should go in the Ansible project or the main Funkwhale one, but I'm putting it here because I am experiencing this issue when installing with Ansible. Haven't tried a regular package just yet, but figured I'd log here nonetheless.
Last night I used the Ansible script to set up Funkwhale, and it looked like everything worked. I had to tear down that instance though due to unrelated issues, so today I spun up a new instance of Ubuntu 20.04 to reinstall Funkwhale on. These are fresh servers, all up to date, nothing else set up. When I run the ansible script according to the docs, it completes normally but attempting to reach the website returns a 502 Bad Gateway. This is because the funkwhale-server is crashing, and throwing the following error in the journalctl logs.
```
Started Funkwhale application server.
[2021-02-28 18:12:34 +0000] [1010] [INFO] Starting gunicorn 20.0.4
[2021-02-28 18:12:34 +0000] [1010] [INFO] Listening at: http://127.0.0.1:5000 (1010)
[2021-02-28 18:12:34 +0000] [1010] [INFO] Using worker: uvicorn.workers.UvicornWorker
[2021-02-28 18:12:34 +0000] [1022] [INFO] Booting worker with pid: 1022
2021-02-28 18:12:35,080 funkwhale_api.config INFO Loaded env file at /srv/funkwhale/config/.env
2021-02-28 18:12:35,081 funkwhale_api.config INFO Running with the following plugins enabled: funkwhale_api.contrib.scrobbler
[2021-02-28 18:12:35 +0000] [1022] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
worker.init_process()
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/uvicorn/workers.py", line 62, in init_process
super(UvicornWorker, self).init_process()
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/gunicorn/workers/base.py", line 119, in init_process
self.load_wsgi()
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
self.wsgi = self.app.wsgi()
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
return self.load_wsgiapp()
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
return util.import_app(self.app_uri)
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/gunicorn/util.py", line 358, in import_app
mod = importlib.import_module(module)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/srv/funkwhale/api/config/asgi.py", line 8, in <module>
django.setup()
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/django/apps/config.py", line 116, in create
mod = import_module(mod_path)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/channels/apps.py", line 6, in <module>
import daphne.server
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/daphne/server.py", line 20, in <module>
asyncioreactor.install(twisted_loop)
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/twisted/internet/asyncioreactor.py", line 307, in install
reactor = AsyncioSelectorReactor(eventloop)
File "/srv/funkwhale/virtualenv/lib/python3.8/site-packages/twisted/internet/asyncioreactor.py", line 60, in __init__
raise TypeError(
TypeError: SelectorEventLoop required, instead got: <uvloop.Loop running=False closed=False debug=False>
[2021-02-28 18:12:35 +0000] [1022] [INFO] Worker exiting (pid: 1022)
[2021-02-28 18:12:35 +0000] [1010] [INFO] Shutting down: Master
[2021-02-28 18:12:35 +0000] [1010] [INFO] Reason: Worker failed to boot.
funkwhale-server.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED
funkwhale-server.service: Failed with result 'exit-code'.
```
This is blocking me from being able to run Funkwhale at the moment, and I've tried on fresh servers multiple times including one on Debian. Looking up the error that is being thrown led me to this ticket, which references a commit made back in September: https://twistedmatrix.com/trac/ticket/10039
Twisted is a dependency for Daphne which is a dependency for Django Channels. Twisted got a [new release](https://github.com/twisted/twisted/releases/tag/twisted-21.2.0) this morning, which might point to why this is failing today where it worked yesterday. I might be able to pin a previous version as a workaround, but haven't tried it yet.