Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation issues regarding new installation using Postgres/Apache/WSGI #9217

Closed
2 tasks done
BhaaLseN opened this issue May 9, 2023 · 1 comment
Closed
2 tasks done
Assignees
Labels
documentation Improvements or additions to the documentation.
Milestone

Comments

@BhaaLseN
Copy link

BhaaLseN commented May 9, 2023

Describe the issue

I just set up a new VM from scratch, and had a few hiccups that might be worthwhile getting updated in the documentation. Nothing I couldn't handle, but the time I spent with trial&error for a lack of resources (both in the documentation and elsewhere) could've been spent a lot better.

  1. Following the Postgres setup without superuser permissions, I created the the two extensions pg_trgm and btree_gin by hand (as documented)...only to have weblate migrate fail on me later.
    Turns out there is no weblate schema, and even if I create that by hand, weblate migrate won't use it. The fix is removing the WITH SCHEMA weblate at the end (since everything else ended up in the default public schema).
  2. Then the Sample configuration for Apache section suggests I can pick the python version; so I installed the latest one pyenv had to offer (which is 3.11.3 as I was trying this).
    Unfortunately, it seems that libapache2-mod-wsgi-py3 is linked against a specific python version (3.9 for Debian, at the time of writing), and will always look for libraries in that folder. Despite specifying both/either python-home=/home/weblate/.pyenv/versions/3.11.3 and python-path=/home/weblate/.pyenv/versions/3.11.3/lib/python3.11/site-packages (as well as combinations of WSGIPythonHome and WSGIPythonPath) it kept looking for native libraries (such as _ldap when using python-ldap) in /home/weblate/.pyenv/versions/3.11.3/lib/python3.9 (the 3.9 at the end is not a typo), which took me longer than necessary to figure out.
    ldd /usr/lib/apache2/modules/mod_wsgi.so prints libpython3.9.so, so installing 3.9.16 instead fixed it for me.
  3. Last but not least, I got weblate.C023 ("System encoding is not UTF-8, processing non-ASCII strings will break") pop up in the Performance report page (but not on weblate check --deploy). Following System locales and encoding, I updated /etc/apache2/envvars and restarted everything. Only to get weblate.E034 ("The Celery process is outdated or misconfigured. Following items differ: encoding") in addition to weblate.C023.
    Thats the only one I couldn't figure out yet, even after skimming through the Background tasks using Celery section and its related pages.

    Looks like a machine reboot fixed this, not sure what was going on there...

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

Try to set up a new Weblate installation on Debian using the Apache2/WSGI method described in Configuration instructions, along with Installing on Debian and Installing from source.

Source installation because I have a few customization for file formats that cannot be configured using the UI at this point.

Expected behavior

No response

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Git checkout

Weblate versions

$ weblate list_versions
 * Weblate: weblate-4.17
 * Django: 4.2.1
 * siphashc: 2.1
 * translate-toolkit: 3.8.6
 * lxml: 4.9.2
 * Pillow: 9.5.0
 * nh3: 0.2.11
 * python-dateutil: 2.8.2
 * social-auth-core: 4.4.2
 * social-auth-app-django: 5.2.0
 * django-crispy-forms: 2.0
 * oauthlib: 3.2.2
 * django-compressor: 4.3.1
 * djangorestframework: 3.14.0
 * django-filter: 23.1
 * django-appconf: 1.0.5
 * user-agents: 2.2.0
 * filelock: 3.11.0
 * rapidfuzz: 3.0.0
 * openpyxl: 3.1.2
 * celery: 5.2.7
 * django-celery-beat: 2.5.0
 * kombu: 5.2.4
 * translation-finder: 2.15
 * weblate-language-data: 2023.4
 * html2text: 2020.1.16
 * pycairo: 1.23.0
 * pygobject: 3.44.1
 * diff-match-patch: 20200713
 * requests: 2.28.2
 * django-redis: 5.2.0
 * hiredis: 2.2.3
 * sentry_sdk: 1.22.2
 * Cython: 0.29.34
 * misaka: 2.1.1
 * GitPython: 3.1.31
 * borgbackup: 1.2.4
 * pyparsing: 3.0.9
 * pyahocorasick: 2.0.0
 * python-redis-lock: 4.0.0
 * charset-normalizer: 3.1.0
 * Python: 3.9.16
 * Git: 2.30.2
 * psycopg2-binary: 2.9.6
 * ruamel.yaml: 0.17.24
 * Redis server: 6.0.16
 * PostgreSQL server: 13.10
 * Database backends: django.db.backends.postgresql
 * Cache backends: default:RedisCache
 * Email setup: django.core.mail.backends.dummy.EmailBackend:
 * OS encoding: filesystem=utf-8, default=utf-8
 * Celery: redis://localhost:6379, redis://localhost:6379, regular
 * Platform: Linux 5.10.0-22-amd64 (x86_64)

Weblate deploy checks

No response

Additional context

For 3., my files look like this:

/etc/apache2/envvars

[...snip...]
## The locale used by some modules like mod_dav
#export LANG=C
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
## Uncomment the following line to use the system default locale instead:
#. /etc/default/locale
[...snip...]

/etc/default/locale

#  File generated by update-locale
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"

With export LANG=C in /etc/apache2/envvars, only weblate.C023 shows up. But no matter what else I do, it mismatches and adds weblate.E034.

The Performance report page however shows that all encodings are utf8, except for the file encoding of the web server. So I'm not completely sure if I can just ignore those. I haven't set up the repositories yet, so I don't know if I will run into encoding issues there.

Edit: A machine reboot fixed 3. for me; so YMMV.

@nijel nijel added the documentation Improvements or additions to the documentation. label May 12, 2023
@nijel nijel added this to the 4.18 milestone May 12, 2023
@nijel nijel self-assigned this May 12, 2023
nijel added a commit that referenced this issue May 12, 2023
It is not used in the other examples, so avoid it here as well.

See #9217
@nijel nijel closed this as completed in b05ff62 May 12, 2023
@github-actions
Copy link

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to the documentation.
Projects
None yet
Development

No branches or pull requests

2 participants