Closed radeklat closed 4 years ago
You probably manually added another entry to Django sites database with same domain. Go to that admin interface, delete it and fix the one with ID 1 (or restart the container).
I checked both the Django admin interface for Sites and the django_site
database table. There is only one record with the IP address and ID 1.
I tried to debug this issue a little more. I noticed the site name doesn't get reset to the IP address immediately after restart. So I simultaneously watched that table and weblate log to correlate the change. However, there doesn't seem to be anything evidently related. Maybe you will have an idea.
Is there anything else I can try to debug this issue? So far, the only workaround it to manually set it again after every restart.
2020-07-05 19:52:38.384724+00 | weblate.lat.sk
2020-07-05 19:52:38.403497+00 | <IP ADDRESS>
weblate_1 | Deleting 'font-source/OTF/SourceCodePro-Regular.otf'
weblate_1 | Deleting 'font-source/OTF/SourceCodePro-Bold.otf'
weblate_1 | Deleting 'font-source/OTF/SourceSansPro-Regular.otf'
weblate_1 | Deleting 'font-source/OTF/SourceSansPro-Black.otf'
weblate_1 | Deleting 'font-dejavu/DejaVuSans-Bold.ttf'
weblate_1 | Deleting 'font-dejavu/DejaVuSans.ttf'
weblate_1 | Deleting 'font-dejavu/.uuid'
weblate_1 |
weblate_1 | 382 static files copied to '/app/data/static'.
weblate_1 | 2020-07-05 19:52:28,836 DEBUG: git: exec git --version [retcode=0]
weblate_1 | 2020-07-05 19:52:29,611 DEBUG: git: exec git review --version [retcode=0]
weblate_1 | 2020-07-05 19:52:30,088 DEBUG: git: exec git svn --version [retcode=0]
weblate_1 | 2020-07-05 19:52:30,116 DEBUG: hub: exec hub --version [retcode=0]
weblate_1 | 2020-07-05 19:52:30,156 DEBUG: lab: exec lab --version [retcode=1]
weblate_1 | 2020-07-05 19:52:30,550 DEBUG: hg: exec hg version -q [retcode=0]
weblate_1 | 2020-07-05 19:52:31,448 DEBUG: Attempting to acquire lock 140396378918808 on /app/data/home/gitlock
weblate_1 | 2020-07-05 19:52:31,450 INFO: Lock 140396378918808 acquired on /app/data/home/gitlock
weblate_1 | 2020-07-05 19:52:31,467 DEBUG: git: exec git config --global merge.weblate-merge-gettext-po.name Weblate merge driver for Gettext PO files [retcode=0]
weblate_1 | 2020-07-05 19:52:31,481 DEBUG: git: exec git config --global merge.weblate-merge-gettext-po.driver /usr/local/lib/python3.7/dist-packages/weblate/examples/git-merge-gettext-po %O %A %B [retcode=0]
weblate_1 | 2020-07-05 19:52:31,497 DEBUG: git: exec git config --global user.email noreply@weblate.org [retcode=0]
weblate_1 | 2020-07-05 19:52:31,512 DEBUG: git: exec git config --global user.name Weblate [retcode=0]
weblate_1 | 2020-07-05 19:52:31,528 DEBUG: Using selector: EpollSelector
weblate_1 | 2020-07-05 19:52:31,550 DEBUG: Attempting to release lock 140396378918808 on /app/data/home/gitlock
weblate_1 | 2020-07-05 19:52:31,551 INFO: Lock 140396378918808 released on /app/data/home/gitlock
weblate_1 | Updating user admin
weblate_1 | 2020-07-05 19:52:35,591 DEBUG: git: exec git --version [retcode=0]
weblate_1 | 2020-07-05 19:52:36,358 DEBUG: git: exec git review --version [retcode=0]
weblate_1 | 2020-07-05 19:52:36,847 DEBUG: git: exec git svn --version [retcode=0]
weblate_1 | 2020-07-05 19:52:36,870 DEBUG: hub: exec hub --version [retcode=0]
weblate_1 | 2020-07-05 19:52:36,909 DEBUG: lab: exec lab --version [retcode=1]
weblate_1 | 2020-07-05 19:52:37,317 DEBUG: hg: exec hg version -q [retcode=0]
weblate_1 | 2020-07-05 19:52:38,270 DEBUG: Attempting to acquire lock 140188870381464 on /app/data/home/gitlock
weblate_1 | 2020-07-05 19:52:38,273 INFO: Lock 140188870381464 acquired on /app/data/home/gitlock
weblate_1 | 2020-07-05 19:52:38,287 DEBUG: git: exec git config --global merge.weblate-merge-gettext-po.name Weblate merge driver for Gettext PO files [retcode=0]
weblate_1 | 2020-07-05 19:52:38,305 DEBUG: git: exec git config --global merge.weblate-merge-gettext-po.driver /usr/local/lib/python3.7/dist-packages/weblate/examples/git-merge-gettext-po %O %A %B [retcode=0]
weblate_1 | 2020-07-05 19:52:38,320 DEBUG: git: exec git config --global user.email noreply@weblate.org [retcode=0]
weblate_1 | 2020-07-05 19:52:38,336 DEBUG: git: exec git config --global user.name Weblate [retcode=0]
weblate_1 | 2020-07-05 19:52:38,350 DEBUG: Using selector: EpollSelector
weblate_1 | 2020-07-05 19:52:38,371 DEBUG: Attempting to release lock 140188870381464 on /app/data/home/gitlock
weblate_1 | 2020-07-05 19:52:38,372 INFO: Lock 140188870381464 released on /app/data/home/gitlock
# NOW THE DOMAIN CHANGES
weblate_1 | 2020-07-05 19:52:39,958 INFO RPC interface 'supervisor' initialized
weblate_1 | 2020-07-05 19:52:39,959 INFO supervisord started with pid 1
weblate_1 | 2020-07-05 19:52:40,964 INFO spawned: 'stdout' with pid 313
weblate_1 | 2020-07-05 19:52:40,967 INFO spawned: 'celery-backup' with pid 314
weblate_1 | 2020-07-05 19:52:40,973 INFO spawned: 'celery-beat' with pid 315
weblate_1 | 2020-07-05 19:52:40,989 INFO spawned: 'celery-main' with pid 316
weblate_1 | 2020-07-05 19:52:40,996 INFO spawned: 'celery-memory' with pid 317
weblate_1 | 2020-07-05 19:52:41,010 INFO spawned: 'celery-notify' with pid 318
weblate_1 | 2020-07-05 19:52:41,029 INFO spawned: 'celery-translate' with pid 319
weblate_1 | 2020-07-05 19:52:41,048 INFO spawned: 'check' with pid 320
weblate_1 | 2020-07-05 19:52:41,084 INFO spawned: 'nginx' with pid 321
weblate_1 | 2020-07-05 19:52:41,112 INFO spawned: 'uwsgi' with pid 322
weblate_1 | 2020-07-05 19:52:42,742 INFO success: stdout entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
weblate_1 | 2020-07-05 19:52:42,743 INFO success: celery-backup entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
weblate_1 | 2020-07-05 19:52:42,744 INFO success: celery-beat entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
weblate_1 | 2020-07-05 19:52:42,745 INFO success: celery-main entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
weblate_1 | 2020-07-05 19:52:42,745 INFO success: celery-memory entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
weblate_1 | 2020-07-05 19:52:42,746 INFO success: celery-notify entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
weblate_1 | 2020-07-05 19:52:42,747 INFO success: celery-translate entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
weblate_1 | 2020-07-05 19:52:42,747 INFO success: check entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
weblate_1 | 2020-07-05 19:52:42,748 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
weblate_1 | 2020-07-05 19:52:42,748 INFO success: uwsgi entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
This is about the point where changesite gets executed, but it should be changed to the domain matching WEBLATE_ALLOWED_HOSTS there. I've added verbose logging of this in https://github.com/WeblateOrg/docker/commit/57662b6a49de693df629acd1aa78cfb5ae0eab4b, so that it's clear what it does. It will be available as weblate/weblate:edge
within few hours.
After switching to weblate/weblate:edge
, to problem disappeared... And it is fixed in latest
as well (there was an update after docker-compose pull
). I'm sorry I can't reproduce it any more to figure out what caused it. I have made whole server snapshot and verified that the only change I did to fix it was the image update.
Thank you for your assistance.
The issue you have reported seems to be resolved now.
🤦 I just realised what was the problem. docker-compose restart
doesn't reload settings in docker-compose.override.yml
if the container already exists. Nor does docker-composer stop; docker-compose start
. However, docker-compose stop; docker-compose up -d
will re-create the container with the new values. So the the mysterious caching was simply an old set of environment variables tied to the container.
Describe the bug
In a docker-based Weblate installation, I initially used the server IP address in
WEBLATE_ALLOWED_HOSTS
. As part of productionizing the setup, I changed it to an actual URLweblate.lat.sk
. However, the installation keeps insisting on using the IP address and reverts back on restart.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The site is set to the URL
Server configuration and status
Weblate deploy checks
Exception traceback
However, when app containers start, I login to the database and run the same update statement, it passes without errors.
Additional context
When I set the site URL via Django Admin / Sites, it gets reverted back to the IP address on docker restart. When I set the site URL via
docker-compose exec weblate weblate changesite --set-name weblate.lat.sk
, it gets reverted as well on restart.Additionally, I have no idea where Weblate gets the IP address from as it is not present in any configuration file.
docker-compose.override.yml
settings-override.py
In:
/var/lib/docker/volumes/weblate-docker_weblate-data/_data/settings-override.py