The thumbnail regeneration step is unclear in the 1.0 changelog
Hello, not a bug per se, only some improvement to the documentation.
In the changelog for version 1.0
there's a bit about the JPEG quality change (https://docs.funkwhale.audio/changelog.html#increased-quality-of-jpeg-thumbnails-manual-action-required).
In this part of the documentation, for already existing setups, you need to run the python manage.py fw media generate-thumbnails
command to re-generate your thumbnails.
In a multi-container Docker environment, where DATABASE_URL
is unset, the command won't work if you try to execute it directly from a running container (in my case app
is celeryworker
).
$ docker-compose exec app sh
/app # python manage.py fw media generate-thumbnails
2020-09-16 12:59:27,623 funkwhale_api.config INFO Running with the following plugins enabled: funkwhale_api.contrib.scrobbler
Traceback (most recent call last):
File "/venv/lib/python3.7/site-packages/environ/environ.py", line 273, in get_value
value = self.ENVIRON[var]
File "/usr/lib/python3.7/os.py", line 681, in __getitem__
raise KeyError(key) from None
KeyError: 'DATABASE_URL'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 16, in <module>
django.setup()
File "/venv/lib/python3.7/site-packages/django/__init__.py", line 19, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/venv/lib/python3.7/site-packages/django/conf/__init__.py", line 76, in __getattr__
self._setup(name)
File "/venv/lib/python3.7/site-packages/django/conf/__init__.py", line 63, in _setup
self._wrapped = Settings(settings_module)
File "/venv/lib/python3.7/site-packages/django/conf/__init__.py", line 142, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/app/config/settings/production.py", line 14, in <module>
from .common import * # noqa
File "/app/config/settings/common.py", line 367, in <module>
DATABASE_URL = env.db("DATABASE_URL")
File "/venv/lib/python3.7/site-packages/environ/environ.py", line 204, in db_url
return self.db_url_config(self.get_value(var, default=default), engine=engine)
File "/venv/lib/python3.7/site-packages/environ/environ.py", line 277, in get_value
raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: Set the DATABASE_URL environment variable
I realize I had to go through the entrypoint (./compose/django/entrypoint.sh
) script for the DATABASE_URL
variable to be set with my setup, and thus running the command from outside the container, through the entrypoint of a fresh one.
$ docker-compose run --rm app python manage.py fw media generate-thumbnails
Creating network "funkwhale_frontend" with the default driver
Creating network "funkwhale_db" with the default driver
Creating network "funkwhale_backend" with the default driver
Creating funkwhale-cache ...
Creating funkwhale-database ...
Creating funkwhale-cache
Creating funkwhale-database ... done
2020-09-16 12:51:33,084 funkwhale_api.config INFO Running with the following plugins enabled: funkwhale_api.contrib.scrobbler
Deleting existing thumbnails…
Generating thumbnails for common.Attachment.file…
Creating images
[##################################################] 228/228 (100%)
228 created, 0 in error
A clearer explanation would prevent more people to end up with no thumbnails like I did
Greg