wger-project / docker Goto Github PK
View Code? Open in Web Editor NEWProduction...ish docker-compose image for wger
License: GNU Affero General Public License v3.0
Production...ish docker-compose image for wger
License: GNU Affero General Public License v3.0
Good day
I am trying to login and start using my wger Docker installation, but if I login with credentials username: admin password: adminadmin, it gives me the following error:
`Forbidden (403)
CSRF verification failed. Request aborted.`
I have no idea what that means.
The following comes with the error when DEBUG is equal to TRUE:
`Help
Reason given for failure:
Origin checking failed - https://fit.super.org.za does not match any trusted origins.
In general, this can occur when there is a genuine Cross Site Request Forgery, or when [Django’s CSRF mechanism](https://docs.djangoproject.com/en/4.0/ref/csrf/) has not been used correctly. For POST forms, you need to ensure:
Your browser is accepting cookies.
The view function passes a request to the template’s [render](https://docs.djangoproject.com/en/dev/topics/templates/#django.template.backends.base.Template.render) method.
In the template, there is a {% csrf_token %} template tag inside each POST form that targets an internal URL.
If you are not using CsrfViewMiddleware, then you must use csrf_protect on any views that use the csrf_token template tag, as well as those that accept the POST data.
The form has a valid CSRF token. After logging in in another browser tab or hitting the back button after a login, you may need to reload the page with the form, because the token is rotated after a login.
You’re seeing the help section of this page because you have DEBUG = True in your Django settings file. Change that to False, and only the initial error message will be displayed.
You can customize this page using the CSRF_FAILURE_VIEW setting.`
This is my Docker-Compose file:
`#
# Please consult the `Deployment` section in the readme if you want to deploy
# this. You need to keep this nginx service, even if you have your own, otherwise
# the static files will not be served correctly!
#
services:
web:
image: wger/server:latest
container_name: wger_server
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
env_file:
- ./config/prod.env
volumes:
- static:/home/wger/static
- media:/home/wger/media
# For development, mount your local git checkout
# - type: bind
# source: /path/to/wger/sourcecode
# target: /home/wger/src/
ports:
- "8000"
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8000
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
nginx:
image: nginx:stable
container_name: wger_nginx
depends_on:
- web
volumes:
- ./config/nginx.conf:/etc/nginx/conf.d/default.conf
- static:/wger/static:ro
- media:/wger/media:ro
ports:
- "830:80"
healthcheck:
test: service nginx status
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
db:
image: postgres:12-alpine
container_name: wger_db
environment:
- POSTGRES_USER=wger
- POSTGRES_PASSWORD=passwordimadeup
- POSTGRES_DB=wger
volumes:
- postgres-data:/var/lib/postgresql/data/
expose:
- 5432
healthcheck:
test: pg_isready -U wger
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
cache:
image: redis
container_name: wger_cache
expose:
- 6379
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
postgres-data:
static:
media:
networks:
default:
name: wger_network`
NGINX.conf file:
`upstream wger {
server web:8000;
}
server {
listen 80;
location / {
proxy_pass http://wger;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_redirect off;
}
location /static/ {
alias /wger/static/;
}
location /media/ {
alias /wger/media/;
}
# Increase max body size to allow for video uploads
client_max_body_size 1000M;
}`
The prod.env file:
`# Django's secret key, change to a 50 character random string if you are running
# this instance publicly. For an online generator, see e.g. https://djecrety.ir/
SECRET_KEY=a50charactersecretkey
# Signing key used for JWT, use something different than the secret key
SIGNING_KEY=a50charactersecretkey
# The 'from' address used when sending emails
[email protected]
# The server's timezone, for a list of possible names:
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TIME_ZONE=Africa/Johannesburg
#
# Consult the deployment section in the readme if you are running this behind a
# reverse proxy with HTTPS enabled
#
# CSRF_TRUSTED_ORIGINS=https://my.domain.example.com,https://118.999.881.119
# X_FORWARDED_PROTO_HEADER_SET=True
#
# These settings usually don't need changing
#
#
# Application
ALLOW_REGISTRATION=True
ALLOW_GUEST_USERS=True
ALLOW_UPLOAD_VIDEOS=True
# Users won't be able to contribute to exercises if their account age is
# lower than this amount in days.
MIN_ACCOUNT_AGE_TO_TRUST=21
# Note that setting these to true will always perform a sync during startup,
# even if the data is already current and will take some time. Usually you don't
# need to perform these steps so often and a manual trigger (see README) is
# usually enough.
SYNC_EXERCISES_ON_STARTUP=True
DOWNLOAD_EXERCISE_IMAGES_ON_STARTUP=True
#
# Database
DJANGO_DB_ENGINE=django.db.backends.postgresql
DJANGO_DB_DATABASE=wger
DJANGO_DB_USER=wger
DJANGO_DB_PASSWORD=passwordimadeup
DJANGO_DB_HOST=db
DJANGO_DB_PORT=5432
# Perform any new database migrations on startup
DJANGO_PERFORM_MIGRATIONS=True
#
# Cache
DJANGO_CACHE_BACKEND=django_redis.cache.RedisCache
DJANGO_CACHE_LOCATION=redis://cache:6379/1
# 60*60*24*15, 15 Days
DJANGO_CACHE_TIMEOUT=12
DJANGO_CACHE_CLIENT_CLASS=django_redis.client.DefaultClient
#
# Brute force login attacks
# https://django-axes.readthedocs.io/en/latest/index.html
AXES_ENABLED=True
AXES_FAILURE_LIMIT=10
# in minutes
AXES_COOLOFF_TIME=30
AXES_HANDLER=axes.handlers.cache.AxesCacheHandler
#
# Others
DJANGO_DEBUG=True
WGER_USE_GUNICORN=True
EXERCISE_CACHE_TTL=10
SITE_URL=https://mywebsiteurl
#
# JWT auth
# The lifetime duration of the access token, in minutes
ACCESS_TOKEN_LIFETIME=10
# The lifetime duration of the refresh token, in hours
REFRESH_TOKEN_LIFETIME=24
#
# Other possible settings
# RECAPTCHA_PUBLIC_KEY
# RECAPTCHA_PRIVATE_KEY
# NOCAPTCHA
# https://docs.djangoproject.com/en/4.1/topics/email/#smtp-backend
# ENABLE_EMAIL
# EMAIL_HOST
# EMAIL_PORT
# EMAIL_HOST_USER
# EMAIL_HOST_PASSWORD
# EMAIL_USE_TLS
# EMAIL_USE_SSL
# DJANGO_MEDIA_ROOT
# DJANGO_STATIC_ROOT
`
wger server container logs:
`Set site URL to https://URL
Using gunicorn...
[2023-01-03 13:11:02 +0000] [116] [INFO] Starting gunicorn 20.1.0
[2023-01-03 13:11:02 +0000] [116] [INFO] Listening at: http://0.0.0.0:8000 (116)
[2023-01-03 13:11:02 +0000] [116] [INFO] Using worker: sync
[2023-01-03 13:11:02 +0000] [117] [INFO] Booting worker with pid: 117
Forbidden (Origin checking failed - https://URL does not match any trusted origins.): /en/user/login`
wger Nginx container logs:
`v:108.0) Gecko/20100101 Firefox/108.0" "XX.XX.XX.XX"
172.30.0.1 - - [03/Jan/2023:13:13:41 +0000] "POST /en/user/login HTTP/1.1" 403 2572 "https://URL/en/user/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0" "XX.XX.XX.XX"
172.30.0.1 - - [03/Jan/2023:13:13:42 +0000] "GET /robots.txt HTTP/1.1" 200 703 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0" "XX.XX.XX.XX.XX"
172.30.0.1 - - [03/Jan/2023:13:19:58 +0000] "GET /bg/exercise/125/view/leg-raises-lying HTTP/1.1" 301 0 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)" "5.255.231.109"
172.30.0.1 - - [03/Jan/2023:13:20:00 +0000] "GET /bg/exercise/377/view-base/leg-raises-lying HTTP/1.1" 200 21690 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)" "5.255.231.109"`
wger db container logs:
`The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... UTC
creating configuration files ... ok
running bootstrap script ... ok
sh: locale: not found
2023-01-03 12:47:18.721 UTC [30] WARNING: no usable system locales were found
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
pg_ctl -D /var/lib/postgresql/data -l logfile start
waiting for server to start....2023-01-03 12:47:20.257 UTC [36] LOG: starting PostgreSQL 12.13 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924, 64-bit
2023-01-03 12:47:20.260 UTC [36] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-01-03 12:47:20.299 UTC [37] LOG: database system was shut down at 2023-01-03 12:47:19 UTC
2023-01-03 12:47:20.307 UTC [36] LOG: database system is ready to accept connections
done
server started
CREATE DATABASE
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
2023-01-03 12:47:20.754 UTC [36] LOG: received fast shutdown request
waiting for server to shut down....2023-01-03 12:47:20.757 UTC [36] LOG: aborting any active transactions
2023-01-03 12:47:20.760 UTC [36] LOG: background worker "logical replication launcher" (PID 43) exited with exit code 1
2023-01-03 12:47:20.763 UTC [38] LOG: shutting down
2023-01-03 12:47:20.787 UTC [36] LOG: database system is shut down
done
server stopped
PostgreSQL init process complete; ready for start up.
2023-01-03 12:47:20.883 UTC [1] LOG: starting PostgreSQL 12.13 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924, 64-bit
2023-01-03 12:47:20.883 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2023-01-03 12:47:20.883 UTC [1] LOG: listening on IPv6 address "::", port 5432
2023-01-03 12:47:20.892 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-01-03 12:47:20.950 UTC [51] LOG: database system was shut down at 2023-01-03 12:47:20 UTC
2023-01-03 12:47:20.979 UTC [1] LOG: database system is ready to accept connections
2023-01-03 12:47:31.513 UTC [65] ERROR: relation "auth_user" does not exist at character 35
2023-01-03 12:47:31.513 UTC [65] STATEMENT: SELECT COUNT(*) AS "__count" FROM "auth_user"`
PLEASE HELP!
I am attempting to get the prod image running though docker compose. The driving issues is the webpage not loading after the stack starts. Going to the host IP I get redirected to 'hostIP/en/software/features'.
The error from the server logs:
PermissionError: [Errno 13] Permission denied: '/home/wger/static/django_extensions'
I really hope this is enough to get some troubleshooting started! Thanks for the project and the support.
Version:
Docker - 20.10.23
Compose - 2.15.1
OS - Debian GNU/Linux 11 (bullseye)
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
Done in 18.37s.
yarn run v1.22.19
$ sass wger/core/static/scss/main.scss:wger/core/static/yarn/bootstrap-compiled.css
Done in 8.84s.
Running in production mode, running collectstatic now
Traceback (most recent call last):
File "/home/wger/src/manage.py", line 25, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.10/dist-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.10/dist-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.10/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 209, in handle
collected = self.collect()
File "/usr/local/lib/python3.10/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 135, in collect
handler(path, prefixed_path, storage)
File "/usr/local/lib/python3.10/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 378, in copy_file
self.storage.save(prefixed_path, source_file)
File "/usr/local/lib/python3.10/dist-packages/django/core/files/storage.py", line 56, in save
name = self._save(name, content)
File "/usr/local/lib/python3.10/dist-packages/django/core/files/storage.py", line 295, in _save
os.makedirs(directory, exist_ok=True)
File "/usr/lib/python3.10/os.py", line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/usr/lib/python3.10/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/wger/static/django_extensions'
Performing database migrations
Operations to perform:
Apply all migrations: actstream, auth, authtoken, axes, config, contenttypes, core, easy_thumbnails, exercises, gallery, gym, mailer, manager, measurements, nutrition, sessions, sites, weight
Running migrations:
No migrations to apply.
Your models in app(s): 'config' have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
Set site URL to http://localhost
Using gunicorn...
[2023-01-27 22:35:41 +0000] [89] [INFO] Starting gunicorn 20.1.0
[2023-01-27 22:35:41 +0000] [89] [INFO] Listening at: http://0.0.0.0:8000 (89)
[2023-01-27 22:35:41 +0000] [89] [INFO] Using worker: sync
[2023-01-27 22:35:41 +0000] [90] [INFO] Booting worker with pid: 90
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2023/01/27 22:34:59 [notice] 1#1: using the "epoll" event method
2023/01/27 22:34:59 [notice] 1#1: nginx/1.22.1
2023/01/27 22:34:59 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
2023/01/27 22:34:59 [notice] 1#1: OS: Linux 5.15.64-1-pve
2023/01/27 22:34:59 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 524288:524288
2023/01/27 22:34:59 [notice] 1#1: start worker processes
2023/01/27 22:34:59 [notice] 1#1: start worker process 28
2023/01/27 22:34:59 [notice] 1#1: start worker process 29
2023/01/27 22:34:59 [notice] 1#1: start worker process 30
2023/01/27 22:34:59 [notice] 1#1: start worker process 31
10.0.20.13 - - [27/Jan/2023:22:40:28 +0000] "GET / HTTP/1.1" 302 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0" "-"
10.0.20.13 - - [27/Jan/2023:22:40:28 +0000] "GET /en/ HTTP/1.1" 302 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0" "-"
10.0.20.13 - - [27/Jan/2023:22:40:28 +0000] "GET /en/software/features HTTP/1.1" 500 2767 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0" "-"
2023/01/27 22:40:28 [error] 29#29: *1 open() "/wger/static/css/workout-manager.css" failed (2: No such file or directory), client: 10.0.20.13, server: , request: "GET /static/css/workout-manager.css HTTP/1.1", host: "10.0.20.65", referrer: "http://10.0.20.65/en/software/features"
10.0.20.13 - - [27/Jan/2023:22:40:28 +0000] "GET /static/css/workout-manager.css HTTP/1.1" 404 153 "http://10.0.20.65/en/software/features" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0" "-"
10.0.20.13 - - [27/Jan/2023:22:40:28 +0000] "GET /static/yarn/bootstrap-compiled.css HTTP/1.1" 404 153 "http://10.0.20.65/en/software/features" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0" "-"
2023/01/27 22:40:28 [error] 29#29: *1 open() "/wger/static/yarn/bootstrap-compiled.css" failed (2: No such file or directory), client: 10.0.20.13, server: , request: "GET /static/yarn/bootstrap-compiled.css HTTP/1.1", host: "10.0.20.65", referrer: "http://10.0.20.65/en/software/features"
2023/01/27 22:40:28 [error] 30#30: *5 open() "/wger/static/css/bootstrap-custom.css" failed (2: No such file or directory), client: 10.0.20.13, server: , request: "GET /static/css/bootstrap-custom.css HTTP/1.1", host: "10.0.20.65", referrer: "http://10.0.20.65/en/software/features"
10.0.20.13 - - [27/Jan/2023:22:40:28 +0000] "GET /static/css/bootstrap-custom.css HTTP/1.1" 404 153 "http://10.0.20.65/en/software/features" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0" "-"
10.0.20.13 - - [27/Jan/2023:22:40:28 +0000] "GET /static/yarn/shariff/dist/shariff.min.js HTTP/1.1" 404 153 "http://10.0.20.65/en/software/features" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0" "-"
2023/01/27 22:40:28 [error] 30#30: *5 open() "/wger/static/yarn/shariff/dist/shariff.min.js" failed (2: No such file or directory), client: 10.0.20.13, server: , request: "GET /static/yarn/shariff/dist/shariff.min.js HTTP/1.1", host: "10.0.20.65", referrer: "http://10.0.20.65/en/software/features"
10.0.20.13 - - [27/Jan/2023:22:40:28 +0000] "GET /static/images/logos/logo-bg-white.png HTTP/1.1" 404 153 "http://10.0.20.65/en/software/features" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0" "-"
2023/01/27 22:40:28 [error] 30#30: *5 open() "/wger/static/images/logos/logo-bg-white.png" failed (2: No such file or directory), client: 10.0.20.13, server: , request: "GET /static/images/logos/logo-bg-white.png HTTP/1.1", host: "10.0.20.65", referrer: "http://10.0.20.65/en/software/features"
2023/01/27 22:40:28 [error] 29#29: *1 open() "/wger/static/images/favicon.png" failed (2: No such file or directory), client: 10.0.20.13, server: , request: "GET /static/images/favicon.png HTTP/1.1", host: "10.0.20.65", referrer: "http://10.0.20.65/en/software/features"
10.0.20.13 - - [27/Jan/2023:22:40:28 +0000] "GET /static/images/favicon.png HTTP/1.1" 404 153 "http://10.0.20.65/en/software/features" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0" "-"
PostgreSQL Database directory appears to contain a database; Skipping initialization
2023-01-27 22:34:47.292 UTC [1] LOG: starting PostgreSQL 12.13 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924, 64-bit
2023-01-27 22:34:47.292 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2023-01-27 22:34:47.292 UTC [1] LOG: listening on IPv6 address "::", port 5432
2023-01-27 22:34:47.296 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-01-27 22:34:47.330 UTC [21] LOG: database system was shut down at 2023-01-27 22:22:36 UTC
2023-01-27 22:34:47.340 UTC [1] LOG: database system is ready to accept connections
1:C 27 Jan 2023 22:34:47.153 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 27 Jan 2023 22:34:47.153 # Redis version=7.0.8, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 27 Jan 2023 22:34:47.153 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 27 Jan 2023 22:34:47.155 * monotonic clock: POSIX clock_gettime
1:M 27 Jan 2023 22:34:47.157 * Running mode=standalone, port=6379.
1:M 27 Jan 2023 22:34:47.157 # Server initialized
1:M 27 Jan 2023 22:34:47.157 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 27 Jan 2023 22:34:47.158 * Ready to accept connections
1:M 27 Jan 2023 22:39:48.082 * 100 changes in 300 seconds. Saving...
1:M 27 Jan 2023 22:39:48.083 * Background saving started by pid 219
219:C 27 Jan 2023 22:39:48.089 * DB saved on disk
219:C 27 Jan 2023 22:39:48.090 * Fork CoW for RDB: current 0 MB, peak 0 MB, average 0 MB
1:M 27 Jan 2023 22:39:48.183 * Background saving terminated with success
1:M 27 Jan 2023 22:44:49.047 * 100 changes in 300 seconds. Saving...
1:M 27 Jan 2023 22:44:49.047 * Background saving started by pid 428
428:C 27 Jan 2023 22:44:49.055 * DB saved on disk
428:C 27 Jan 2023 22:44:49.056 * Fork CoW for RDB: current 0 MB, peak 0 MB, average 0 MB
1:M 27 Jan 2023 22:44:49.148 * Background saving terminated with success
1:M 27 Jan 2023 22:49:50.055 * 100 changes in 300 seconds. Saving...
1:M 27 Jan 2023 22:49:50.055 * Background saving started by pid 635
635:C 27 Jan 2023 22:49:50.069 * DB saved on disk
635:C 27 Jan 2023 22:49:50.070 * Fork CoW for RDB: current 0 MB, peak 0 MB, average 0 MB
1:M 27 Jan 2023 22:49:50.156 * Background saving terminated with success
#
# Please consult the `Deployment` section in the readme if you want to deploy
# this. You need to keep this nginx service, even if you have your own, otherwise
# the static files will not be served correctly!
#
services:
web:
image: wger/server:latest
container_name: wger_server
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
env_file:
- ./config/prod.env
volumes:
- ./static:/home/wger/static
- ./media:/home/wger/media
# For development, mount your local git checkout
# - type: bind
# source: /path/to/wger/sourcecode
# target: /home/wger/src/
ports:
- "8000"
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8000
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
nginx:
image: nginx:stable
container_name: wger_nginx
depends_on:
- web
volumes:
- ./config/nginx.conf:/etc/nginx/conf.d/default.conf
- ./static:/wger/static:ro
- ./media:/wger/media:ro
ports:
- "80:80"
healthcheck:
test: service nginx status
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
db:
image: postgres:12-alpine
container_name: wger_db
environment:
- POSTGRES_USER=wger
- POSTGRES_PASSWORD=wger
- POSTGRES_DB=wger
volumes:
- ./postgres-data:/var/lib/postgresql/data/
expose:
- 5432
healthcheck:
test: pg_isready -U wger
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
cache:
image: redis
container_name: wger_cache
expose:
- 6379
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
postgres-data:
static:
media:
networks:
default:
name: wger_network
upstream wger {
server web:8000;
}
server {
listen 80;
location / {
proxy_pass http://wger;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_redirect off;
}
location /static/ {
alias /wger/static/;
}
location /media/ {
alias /wger/media/;
}
# Increase max body size to allow for video uploads
client_max_body_size 100M;
}
# Django's secret key, change to a 50 character random string if you are running
# this instance publicly. For an online generator, see e.g. https://djecrety.ir/
SECRET_KEY=**[censored]**
# Signing key used for JWT, use something different than the secret key
SIGNING_KEY=**[censored]**
# The 'from' address used when sending emails
FROM_EMAIL=**[censored]**
# The server's timezone, for a list of possible names:
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TIME_ZONE=**[censored]**
#
# Consult the deployment section in the readme if you are running this behind a
# reverse proxy with HTTPS enabled
#
# CSRF_TRUSTED_ORIGINS=https://my.domain.example.com,https://118.999.881.119
# X_FORWARDED_PROTO_HEADER_SET=True
#
# These settings usually don't need changing
#
#
# Application
ALLOW_REGISTRATION=True
ALLOW_GUEST_USERS=True
ALLOW_UPLOAD_VIDEOS=True
# Users won't be able to contribute to exercises if their account age is
# lower than this amount in days.
MIN_ACCOUNT_AGE_TO_TRUST=21
# Note that setting these to true will always perform a sync during startup,
# even if the data is already current and will take some time. Usually you don't
# need to perform these steps so often and a manual trigger (see README) is
# usually enough.
SYNC_EXERCISES_ON_STARTUP=False
DOWNLOAD_EXERCISE_IMAGES_ON_STARTUP=False
#
# Database
DJANGO_DB_ENGINE=django.db.backends.postgresql
DJANGO_DB_DATABASE=wger
DJANGO_DB_USER=wger
DJANGO_DB_PASSWORD=wger
DJANGO_DB_HOST=db
DJANGO_DB_PORT=5432
# Perform any new database migrations on startup
DJANGO_PERFORM_MIGRATIONS=True
#
# Cache
DJANGO_CACHE_BACKEND=django_redis.cache.RedisCache
DJANGO_CACHE_LOCATION=redis://cache:6379/1
# 60*60*24*15, 15 Days
DJANGO_CACHE_TIMEOUT=12
DJANGO_CACHE_CLIENT_CLASS=django_redis.client.DefaultClient
#
# Brute force login attacks
# https://django-axes.readthedocs.io/en/latest/index.html
AXES_ENABLED=True
AXES_FAILURE_LIMIT=10
# in minutes
AXES_COOLOFF_TIME=30
AXES_HANDLER=axes.handlers.cache.AxesCacheHandler
#
# Others
DJANGO_DEBUG=False
WGER_USE_GUNICORN=True
EXERCISE_CACHE_TTL=10
SITE_URL=http://localhost
#
# JWT auth
# The lifetime duration of the access token, in minutes
ACCESS_TOKEN_LIFETIME=10
# The lifetime duration of the refresh token, in hours
REFRESH_TOKEN_LIFETIME=24
#
# Other possible settings
# RECAPTCHA_PUBLIC_KEY
# RECAPTCHA_PRIVATE_KEY
# NOCAPTCHA
# https://docs.djangoproject.com/en/4.1/topics/email/#smtp-backend
# ENABLE_EMAIL
# EMAIL_HOST
# EMAIL_PORT
# EMAIL_HOST_USER
# EMAIL_HOST_PASSWORD
# EMAIL_USE_TLS
# EMAIL_USE_SSL
# DJANGO_MEDIA_ROOT
# DJANGO_STATIC_ROOT
Expected results:
actual site url in email
Actual results:
Diese E-Mail wurde aufgrund einer Anfrage zum Zurücksetzen des Passworts auf der Website [example.com](http://example.com/) versendet.
Bitte öffne folgende Seite, um dein neues Passwort einzugeben:
http://example.com/de/user/password/reset/check/MQ/b326v2-db29a74f3682933d0e88afca6ded9e32
Dein Benutzername, falls du ihn vergessen hast: admin
Vielen Dank, dass du unsere Website benutzt!
Das Team von [example.com](http://example.com/)
Can this help track down any permission errors on static or django?
wger | yarn install v1.22.19
wger | [1/5] Validating package.json...
wger | [2/5] Resolving packages...
wger | [3/5] Fetching packages...
wger | [4/5] Linking dependencies...
wger | [5/5] Building fresh packages...
wger | Done in 42.34s.
wger | yarn run v1.22.19
wger | $ sass wger/core/static/scss/main.scss:wger/core/static/yarn/bootstrap-compiled.css
wger | Done in 14.57s.
wger | Running in production mode, running collectstatic now
wger | Traceback (most recent call last):
wger | File "/home/wger/src/manage.py", line 25, in
wger | execute_from_command_line(sys.argv)
wger | File "/usr/local/lib/python3.10/dist-packages/django/core/management/init.py", line 419, in execute_from_command_line
wger | utility.execute()
wger | File "/usr/local/lib/python3.10/dist-packages/django/core/management/init.py", line 413, in execute
wger | self.fetch_command(subcommand).run_from_argv(self.argv)
wger | File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 354, in run_from_argv
wger | self.execute(*args, **cmd_options)
wger | File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 398, in execute
wger | output = self.handle(*args, **options)
wger | File "/usr/local/lib/python3.10/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 187, in handle
wger | collected = self.collect()
wger | File "/usr/local/lib/python3.10/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 114, in collect
wger | handler(path, prefixed_path, storage)
wger | File "/usr/local/lib/python3.10/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 348, in copy_file
wger | self.storage.save(prefixed_path, source_file)
wger | File "/usr/local/lib/python3.10/dist-packages/django/core/files/storage.py", line 54, in save
wger | name = self._save(name, content)
wger | File "/usr/local/lib/python3.10/dist-packages/django/core/files/storage.py", line 260, in _save
wger | os.makedirs(directory, exist_ok=True)
wger | File "/usr/lib/python3.10/os.py", line 215, in makedirs
wger | makedirs(head, exist_ok=exist_ok)
wger | File "/usr/lib/python3.10/os.py", line 225, in makedirs
wger | mkdir(name, mode)
wger | PermissionError: [Errno 13] Permission denied: '/home/wger/static/django_extensions'
wger | Performing database migrations
wger | Operations to perform:
wger | Apply all migrations: actstream, auth, authtoken, axes, config, contenttypes, core, easy_thumbnails, exercises, gallery, gym, mailer, manager, measurements, nutrition, sessions, sites, weight
In prod.env
, I have SITE_URL=https://wger.mydomain.tld
. This is in a LAN-only environment with local reverse proxy.
I also have SMTP variables correctly setup:
ENABLE_EMAIL=True
EMAIL_HOST=smtp.mailgun.org
EMAIL_PORT=587
[email protected]
EMAIL_HOST_PASSWORD=mypassword
EMAIL_USE_TLS=True
EMAIL_USE_SSL=False
Verification emails are successfully sent, but the "click here" link uses localhost
instead of SITE_URL
:
http://localhost/email/email/long_email_verification_string
Replacing localhost
with wger.mydomain.tld
(SITE_URL) correctly loads the page and verifies the user.
Is this a bug, or have I missed a setting?
When I try to update the exercise-images of the docker I obtain this error:
lordpedal@overclock:~/docker/wger$ docker-compose exec web python3 manage.py download-exercise-images
*** Processing 2 Handed Kettlebell Swing (ID: 345, UUID: c788d643-150a-4ac7-97ef-84643c6419bf)
No images for this exercise, nothing to do
*** Processing Abduktoren-Maschine (ID: 174, UUID: 99881bdd-43d7-4c3b-82ed-9c187d0455b7)
No images for this exercise, nothing to do
*** Processing Adduktoren Maschine (ID: 223, UUID: e56d0a17-b1b8-427d-991e-97c530c7db6a)
No images for this exercise, nothing to do
*** Processing Arnold Press (ID: 228, UUID: 880bff63-6798-4ffc-a818-b2a1ccfec0f7)
Fetching image 193 - Arnold-press-2.png
--> Image not found in local DB, creating now...
Traceback (most recent call last):
File "manage.py", line 25, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 371, in execute
output = self.handle(*args, **options)
File "/home/wger/src/wger/exercises/management/commands/download-exercise-images.py", line 137, in handle
image.exercise = exercise
File "/usr/local/lib/python3.8/dist-packages/django/db/models/fields/related_descriptors.py", line 215, in __set__
raise ValueError(
ValueError: Cannot assign "<Exercise: Arnold Press>": "ExerciseImage.exercise" must be a "ExerciseBase" instance.
Meanwhile the other command work fine, without fails:
lordpedal@overclock:~/docker/wger$ docker-compose exec web wger load-online-fixtures
*** No settings given, using /home/wger/src/settings.py
Downloading fixture data from https://github.com/wger-project/data/raw/master/fixtures/ingredients.json.zip...
-> fixture size: 5.03 MB
-> saving to temp file /tmp/tmph_fl0esl.json.zip
Installed 78854 object(s) from 1 fixture(s)
-> removing temp file
Downloading fixture data from https://github.com/wger-project/data/raw/master/fixtures/weight_units.json.zip...
-> fixture size: 0.0201 MB
-> saving to temp file /tmp/tmpc7zfenk3.json.zip
Installed 1897 object(s) from 1 fixture(s)
-> removing temp file
Downloading fixture data from https://github.com/wger-project/data/raw/master/fixtures/ingredient_units.json.zip...
-> fixture size: 0.13 MB
-> saving to temp file /tmp/tmp1nwmvv97.json.zip
Installed 14274 object(s) from 1 fixture(s)
-> removing temp file
Best regards
Most of the settings used will not need to be changed, it would be nice to document how users can just extend those. This will also fetching changes more easy (just pull the new version of the yml file and you're set)
Hello.
My CI woke me up today with the following error when pulling the latest image for wger/server:
fatal: [instance]: FAILED! => {"changed": false, "msg": "Error pulling wger/server - code: None message: no matching manifest for linux/amd64 in the manifest list entries"}
and looks like the latest
version is indeed only linux/arm64
. Only 2.1-dev
tag contains both arm64 and amd64.
Is this intentional? Only ARM now for latest?
Hi,
no matter what I try, I can’t seem to get the Wger Docker instance to work correctly.. I’ve created 3 persistent local locations to store config, media and static content , but they don’t seem to get picked up. If someone is able to review / or better yet try my config (or a close approximation of it,) that would help me a lot..
my Docker compose is..
version: '3'
services:
web:
image: wger/server:latest
container_name: wger_server
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
environment:
- SECRET_KEY=wger-docker-supersecret-key
- SIGNING_KEY=wger-docker-secret-jwtkey
- [email protected]
- TIME_ZONE=Europe/London
- ALLOW_REGISTRATION=True
- ALLOW_GUEST_USERS=True
- ALLOW_UPLOAD_VIDEOS=True
- MIN_ACCOUNT_AGE_TO_TRUST=18
- SYNC_EXERCISES_ON_STARTUP=True
- DOWNLOAD_EXERCISE_IMAGES_ON_STARTUP=True
# Database
- DJANGO_DB_ENGINE=django.db.backends.postgresql
- DJANGO_DB_DATABASE=wger
- DJANGO_DB_USER=wger
- DJANGO_DB_PASSWORD=wger
- DJANGO_DB_HOST=db
- DJANGO_DB_PORT=5432
- DJANGO_PERFORM_MIGRATIONS=True
# Cache
- DJANGO_CACHE_BACKEND=django_redis.cache.RedisCache
- DJANGO_CACHE_LOCATION=redis://cache:6379/1
# 60*60*24*15, 15 Days
- DJANGO_CACHE_TIMEOUT=12
- DJANGO_CACHE_CLIENT_CLASS=django_redis.client.DefaultClient
# Brute force login attacks - https://django-axes.readthedocs.io/en/latest/index.html
- AXES_ENABLED=True
- AXES_FAILURE_LIMIT=10
# in minutes
- AXES_COOLOFF_TIME=30
- AXES_HANDLER=axes.handlers.cache.AxesCacheHandler
# Others
- DJANGO_DEBUG=True
- WGER_USE_GUNICORN=True
- EXERCISE_CACHE_TTL=10
# SITE_URL=http://localhost
# JWT auth - The lifetime duration of the access token, in minutes
- ACCESS_TOKEN_LIFETIME=10
# The lifetime duration of the refresh token, in hours
- REFRESH_TOKEN_LIFETIME=24
# Other possible settings
# RECAPTCHA_PUBLIC_KEY
# RECAPTCHA_PRIVATE_KEY
# NOCAPTCHA
# https://docs.djangoproject.com/en/4.1/topics/email/#smtp-backend
# ENABLE_EMAIL
# EMAIL_HOST
# EMAIL_PORT
# EMAIL_HOST_USER
# EMAIL_HOST_PASSWORD
# EMAIL_USE_TLS
# EMAIL_USE_SSL
# DJANGO_MEDIA_ROOT
# DJANGO_STATIC_ROOT
- CSRF_TRUSTED_ORIGINS=https://192.168.102.134,http://192.168.102.134
volumes:
- /share/Container/wger/static:/home/wger/static
- /share/Container/wger/media:/home/wger/media
ports:
- "8000"
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8000
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
nginx:
image: nginx:stable
container_name: wger_nginx
depends_on:
- web
volumes:
#- ./config/nginx.conf:/etc/nginx/conf.d/default.conf
- /share/Container/wger/config/nginx.conf:/etc/nginx/conf.d/default.conf
- /share/Container/wger/static:/wger/static:ro
- /share/Container/wger/media:/wger/media:ro
ports:
- "8008:80"
healthcheck:
test: service nginx status
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
db:
image: postgres:12-alpine
container_name: wger_db
environment:
- POSTGRES_USER=wger
- POSTGRES_PASSWORD=wger
- POSTGRES_DB=wger
volumes:
- postgres-data:/var/lib/postgresql/data/
expose:
- 5432
healthcheck:
test: pg_isready -U wger
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
cache:
image: redis
container_name: wger_cache
expose:
- 6379
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
postgres-data:
static:
media:
networks:
default:
name: wger_network
Here’s my nginx.conf too
upstream wger {
server web:8000;
}
server {
listen 80;
location / {
proxy_pass http://wger;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
location /static/ {m
alias /wger/static/;
}
location /media/ {
alias /wger/media/;
}
# Increase max body size to allow for video uploads
client_max_body_size 100M;
}
Which makes it look like this..
I was able to get wger/apache up and running since it has a very straightforward docker-compose. However, it doesn't save data and everything is wiped on container restart.
How do I get the production-ish version up and running if I already have a separate Nginx Proxy Manager for my LAN-only network? Even before setting up a wger reverse proxy, I still can't access via http://PORT:IP.
version: '3.7'
services:
web:
image: wger/server:latest
container_name: wger_server
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
env_file:
- ./config/prod.env
volumes:
- static:/home/wger/static
- media:/home/wger/media
# For development, mount your local git checkout
# - type: bind
# source: /path/to/wger/sourcecode
# target: /home/wger/src/
ports:
- "8004:8000"
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8000
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# nginx:
# image: nginx:stable
# container_name: wger_nginx
# depends_on:
# - web
# volumes:
# - ./config/nginx.conf:/etc/nginx/conf.d/default.conf
# - static:/wger/static:ro
# - media:/wger/media:ro
# ports:
# - "80:80"
# healthcheck:
# test: service nginx status
# interval: 10s
# timeout: 5s
# retries: 5
# restart: unless-stopped
db:
image: postgres:12-alpine
container_name: wger_db
environment:
- POSTGRES_USER=wger
- POSTGRES_PASSWORD=wger
- POSTGRES_DB=wger
volumes:
- postgres-data:/var/lib/postgresql/data/
expose:
- 5432
healthcheck:
test: pg_isready -U wger
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
cache:
image: redis
container_name: wger_cache
expose:
- 6379
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
postgres-data:
static:
media:
networks:
default:
name: nginx_proxy
Above is s the docker-compose I modified by removing the nginx section and changing the web port to 8004:8000
. Starting wger this way results in "An error occurred. Something happened that caused an error." If I set DJANGO_DEBUG=True
, I see the following:
connection to server at "db" (172.16.64.15), port 5432 failed: FATAL: password authentication failed for user "wger"
prod.env and my docker-compose both retain default settings for user, password, and db, so I'm not sure why I'm getting this error. What else can I do to troubleshoot?
I recently installed the wger docker-compose image. After running it and running the optional download of exercises
docker-compose exec web python3 manage.py sync-exercises
docker-compose exec web python3 manage.py download-exercise-images
docker-compose exec web wger load-online-fixtures
I logged in and tried to add an exercise. When on the "new set" page, I search for a common exercise (bench press, for instance), and first it says No items found!
but shortly after it says in red Error: Instance of 'NoSuchEntryException'
.
I can't add exercises if they are not on the list, even if I write down the exercise name, below the search box a text appears that says Please select an exercise
.
What seems to be the problem? I have repeatedly run the commands above to sync the exercises, but that won't solve the issue.
Hi there,
After updating the image to the latest verssion of wger server and redis, now I'm unable to access the application. A message saying : " An error occurred Something happened that caused an error." appear on screen. I've checked the log but there is nothing I put it in here anyway.
###Redis
1:C 23 Apr 2022 06:45:08.013 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 23 Apr 2022 06:45:08.013 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 23 Apr 2022 06:45:08.014 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 23 Apr 2022 06:45:08.016 * monotonic clock: POSIX clock_gettime
1:M 23 Apr 2022 06:45:08.020 * Running mode=standalone, port=6379.
1:M 23 Apr 2022 06:45:08.024 # Server initialized
1:M 23 Apr 2022 06:45:08.024 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 23 Apr 2022 06:45:08.031 * Loading RDB produced by version 6.2.6
1:M 23 Apr 2022 06:45:08.031 * RDB age 12 seconds
1:M 23 Apr 2022 06:45:08.031 * RDB memory usage when created 0.83 Mb
1:M 23 Apr 2022 06:45:08.032 # Done loading RDB, keys loaded: 82, keys expired: 0.
1:M 23 Apr 2022 06:45:08.032 * DB loaded from disk: 0.001 seconds
1:M 23 Apr 2022 06:45:08.032 * Ready to accept connections
####Server
Waiting for postgres...
PostgreSQL started :)
yarn install v1.22.18
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
Done in 71.81s.
yarn run v1.22.18
$ sass wger/core/static/scss/main.scss:wger/core/static/yarn/bootstrap-compiled.css
Done in 10.00s.
Running in production mode, running collectstatic now
5723 static files copied to '/home/wger/static', 295 unmodified.
Using gunicorn...
[2022-04-23 06:37:47 +0000] [58] [INFO] Starting gunicorn 20.1.0
[2022-04-23 06:37:47 +0000] [58] [INFO] Listening at: http://0.0.0.0:8000 (58)
[2022-04-23 06:37:47 +0000] [58] [INFO] Using worker: sync
[2022-04-23 06:37:50 +0000] [59] [INFO] Booting worker with pid: 59
Waiting for postgres...
PostgreSQL started :)
yarn install v1.22.18
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 0.75s.
yarn run v1.22.18
$ sass wger/core/static/scss/main.scss:wger/core/static/yarn/bootstrap-compiled.css
Done in 9.37s.
Running in production mode, running collectstatic now
2 static files copied to '/home/wger/static', 6016 unmodified.
Using gunicorn...
[2022-04-23 06:45:30 +0000] [50] [INFO] Starting gunicorn 20.1.0
[2022-04-23 06:45:30 +0000] [50] [INFO] Listening at: http://0.0.0.0:8000 (50)
[2022-04-23 06:45:30 +0000] [50] [INFO] Using worker: sync
[2022-04-23 06:45:30 +0000] [51] [INFO] Booting worker with pid: 51
######DB
PostgreSQL Database directory appears to contain a database; Skipping initialization
2022-04-23 06:45:08.305 UTC [1] LOG: starting PostgreSQL 12.10 on aarch64-unknown-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
2022-04-23 06:45:08.305 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2022-04-23 06:45:08.305 UTC [1] LOG: listening on IPv6 address "::", port 5432
2022-04-23 06:45:08.428 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-04-23 06:45:08.689 UTC [22] LOG: database system was shut down at 2022-04-23 06:44:56 UTC
2022-04-23 06:45:08.737 UTC [1] LOG: database system is ready to accept connections
Thanks for any help.
At the moment some changes from upstream require manual steps like database migrations. On one hand it would be nice if this would happen during startup, on the other hand... they are db migrations that could potentially make the user lose all their data.
Needing some help with the latest update and migration. Everything went well.
My only issue is that the settings.py or prod.env is being overwritten or not applied by settings.global.
Any insight on why or what I can do to fix this?
Thanks
Hi, running into an issue with persistant data. I copied the persistant location via the docker-compose file. I get the docker running, but if I update the image all my data is gone. My static locations and media locations are all empty. Any thoughts or ideas?
Thanks
I've followed the instructions for "1 - Start":
docker-compose up -d
docker-compose exec web python3 manage.py sync-exercises
docker-compose exec web python3 manage.py download-exercise-images
docker-compose exec web wger load-online-fixtures
However, no web service was found.
Log Output:
pi@wgerpi:~/projects/wger-docker $ sudo docker-compose up -d
Creating network "wger-docker_default" with the default driver
Creating wger-docker_cache_1 ... done
Creating wger-docker_db_1 ... done
Creating wger-docker_web_1 ... done
Creating wger-docker_nginx_1 ... done
pi@wgerpi:~/projects/wger-docker $ sudo docker-compose logs -f
Attaching to wger-docker_nginx_1, wger-docker_web_1, wger-docker_cache_1, wger-docker_db_1
db_1 |
db_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1 |
db_1 | 2021-09-17 17:14:43.246 UTC [1] LOG: starting PostgreSQL 12.8 on aarch64-unknown-linux-musl, compiled by gcc (Alpine 10.3.1_git20210424) 10.3.1 20210424, 64-bit
db_1 | 2021-09-17 17:14:43.246 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
db_1 | 2021-09-17 17:14:43.246 UTC [1] LOG: listening on IPv6 address "::", port 5432
db_1 | 2021-09-17 17:14:44.556 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1 | 2021-09-17 17:14:44.648 UTC [22] LOG: database system was shut down at 2021-09-17 17:01:45 UTC
db_1 | 2021-09-17 17:14:44.721 UTC [1] LOG: database system is ready to accept connections
cache_1 | 1:C 17 Sep 2021 17:14:37.545 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
cache_1 | 1:C 17 Sep 2021 17:14:37.545 # Redis version=6.2.5, bits=64, commit=00000000, modified=0, pid=1, just started
cache_1 | 1:C 17 Sep 2021 17:14:37.545 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
cache_1 | 1:M 17 Sep 2021 17:14:37.547 * monotonic clock: POSIX clock_gettime
cache_1 | 1:M 17 Sep 2021 17:14:37.570 * Running mode=standalone, port=6379.
cache_1 | 1:M 17 Sep 2021 17:14:37.571 # Server initialized
cache_1 | 1:M 17 Sep 2021 17:14:37.571 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
cache_1 | 1:M 17 Sep 2021 17:14:37.575 * Ready to accept connections
nginx_1 | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
nginx_1 | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
nginx_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
nginx_1 | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
nginx_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
nginx_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
nginx_1 | /docker-entrypoint.sh: Configuration complete; ready for start up
nginx_1 | 2021/09/17 17:15:31 [emerg] 1#1: host not found in upstream "web" in /etc/nginx/conf.d/nginx.conf:2
nginx_1 | nginx: [emerg] host not found in upstream "web" in /etc/nginx/conf.d/nginx.conf:2
web_1 | standard_init_linux.go:228: exec user process caused: exec format error
wger-docker_nginx_1 exited with code 1
wger-docker_web_1 exited with code 1
It looks like the issue is probably here:
web_1 | standard_init_linux.go:228: exec user process caused: exec format error
Are there any known issues with using your wger/devel:latest
image on a raspberry pi (aarch64)?
Attempting to install via the docker-compose file, I get a bunch of errors regarding GPG keys for Ubuntu Jammy where the server is currently running 16.04
(I know, it's not new).
Does wger require the latest Ubuntu version?
If so, would be good to have this made clear within the installation documentation. I can do that if confirmed.
~/wger/extras/docker [master ?] /: docker build base/
Sending build context to Docker daemon 4.608kB
Step 1/10 : FROM ubuntu:22.04
---> 08d22c0ceb15
Step 2/10 : LABEL maintainer="Roland Geider <[email protected]>"
---> Running in 1e495de2704b
Removing intermediate container 1e495de2704b
---> 94f1a80434c8
Step 3/10 : ENV DEBIAN_FRONTEND=noninteractive
---> Running in d2ff60bd3294
Removing intermediate container d2ff60bd3294
---> 63ae26f68f0e
Step 4/10 : RUN apt-get update && apt-get install --no-install-recommends -y git locales nodejs npm python3-venv python3-pip sqlite3 wget libpq5 && rm -rf /var/lib/apt/lists/* && npm install -g yarn sass && locale-gen en_US.UTF-8
---> Running in 8851dbd3500d
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Err:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Err:2 http://archive.ubuntu.com/ubuntu jammy InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Err:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [108 kB]
Err:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Reading package lists...
W: http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://security.ubuntu.com/ubuntu jammy-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://security.ubuntu.com/ubuntu jammy-security InRelease' is not signed.
W: http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://archive.ubuntu.com/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' is not signed.
W: http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://archive.ubuntu.com/ubuntu jammy-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' is not signed.
W: http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://archive.ubuntu.com/ubuntu jammy-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy-backports InRelease' is not signed.
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code
The command '/bin/sh -c apt-get update && apt-get install --no-install-recommends -y git locales nodejs npm python3-venv python3-pip sqlite3 wget libpq5 && rm -rf /var/lib/apt/lists/* && npm install -g yarn sass && locale-gen en_US.UTF-8' returned a non-zero code: 100
Hi all, i have a question.
I am kind of new with docker.
I have deployed my wger docker, all seems fine, but i don't see a nice html background. it's plain text with a white background.
This is local and from external.
I had disabled the nginx container and configured my nginx proxy manager to handle external traffic.
English is not my native language.
Kind regards, Nick
The main repo says:
If you want to host your own instance, take a look at the provided docker compose file. This config will persist your database and uploaded images
But then the docker compose file uses wger/devel
, which in its description says:
Please note that this image is intended for development
And then says to check out the docker compose file instead.
The other images (wger/apache
and wger/base
) are both also apparently not intended for production usage. So what am I meant to do if I want to deploy a production instance of wger via docker?
wger | Traceback (most recent call last):
wger | File "/usr/local/lib/python3.10/dist-packages/environ/environ.py", line 403, in get_value
wger | value = self.ENVIRON[var_name]
wger | File "/usr/lib/python3.10/os.py", line 679, in getitem
wger | raise KeyError(key) from None
wger | KeyError: 'FROM_EMAIL'
wger |
wger | The above exception was the direct cause of the following exception:
wger |
wger | Traceback (most recent call last):
wger | File "/usr/local/bin/invoke", line 8, in
wger | sys.exit(program.run())
wger | File "/usr/local/lib/python3.10/dist-packages/invoke/program.py", line 384, in run
wger | self.execute()
wger | File "/usr/local/lib/python3.10/dist-packages/invoke/program.py", line 569, in execute
wger | executor.execute(*self.tasks)
wger | File "/usr/local/lib/python3.10/dist-packages/invoke/executor.py", line 129, in execute
wger | result = call.task(*args, **call.kwargs)
wger | File "/usr/local/lib/python3.10/dist-packages/invoke/tasks.py", line 127, in call
wger | result = self.body(*args, **kwargs)
wger | File "/home/wger/src/wger/tasks.py", line 91, in bootstrap
wger | setup_django_environment(settings_path)
wger | File "/home/wger/src/wger/tasks.py", line 345, in setup_django_environment
wger | django.setup()
wger | File "/usr/local/lib/python3.10/dist-packages/django/init.py", line 19, in setup
wger | configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
wger | File "/usr/local/lib/python3.10/dist-packages/django/conf/init.py", line 82, in getattr
wger | self._setup(name)
wger | File "/usr/local/lib/python3.10/dist-packages/django/conf/init.py", line 69, in _setup
wger | self._wrapped = Settings(settings_module)
wger | File "/usr/local/lib/python3.10/dist-packages/django/conf/init.py", line 170, in init
wger | mod = importlib.import_module(self.SETTINGS_MODULE)
wger | File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
wger | return _bootstrap._gcd_import(name[level:], package, level)
wger | File "", line 1050, in _gcd_import
wger | File "", line 1027, in _find_and_load
wger | File "", line 1006, in _find_and_load_unlocked
wger | File "", line 688, in _load_unlocked
wger | File "", line 883, in exec_module
wger | File "", line 241, in _call_with_frames_removed
wger | File "/home/wger/src/settings.py", line 90, in
wger | WGER_SETTINGS['EMAIL_FROM'] = f'wger Workout Manager <{env.str("FROM_EMAIL")}>'
wger | File "/usr/local/lib/python3.10/dist-packages/environ/environ.py", line 213, in str
wger | value = self.get_value(var, cast=str, default=default)
wger | File "/usr/local/lib/python3.10/dist-packages/environ/environ.py", line 407, in get_value
wger | raise ImproperlyConfigured(error_msg) from exc
wger | django.core.exceptions.ImproperlyConfigured: Set the FROM_EMAIL environment variable
Document or configure nginx to support HTTPS, ideally we would support retrieving/renewing certificates from LetsEcrypt out of the box
The current file doesn't allow for data to persist over restarts and for data to be backed up easily
This is showing up when I go to my WebGUI
Not really seeing any errors as such in the logs just this when i try to access to UI
#
# Please consult the `Deployment` section in the readme if you want to deploy
# this. You need to keep this nginx service, even if you have your own, otherwise
# the static files will not be served correctly!
#
services:
web:
image: wger/server:latest
container_name: wger_server
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
env_file:
- stack.env
volumes:
- static:/home/wger/static
- media:/home/wger/media
# For development, mount your local git checkout
# - type: bind
# source: /path/to/wger/sourcecode
# target: /home/wger/src/
ports:
- "8005:8000"
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8000
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
nginx:
image: nginx:stable
container_name: wger_nginx
env_file:
- stack.env
depends_on:
- web
volumes:
- ./config/nginx:/etc/nginx/conf.d/
- static:/wger/static:ro
- media:/wger/media:ro
ports:
- "80:80"
healthcheck:
test: service nginx status
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
db:
image: postgres:12-alpine
container_name: wger_db
env_file:
- stack.env
environment:
- POSTGRES_USER=wger
- POSTGRES_PASSWORD=wger
- POSTGRES_DB=wger
volumes:
- postgres-data:/var/lib/postgresql/data/
expose:
- 5432
healthcheck:
test: pg_isready -U wger
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
cache:
image: redis
env_file:
- stack.env
container_name: wger_cache
expose:
- 6379
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
postgres-data:
static:
media:
networks:
default:
name: wger_network
Copy of my docker-compose I used.
Version:
Latest
Description:
When executing the command wger load-online-fixtures
within the container, the command seems to be run, but never finishes.
The console reports back
Downloading fixture data from https://github.com/wger-project/data/raw/master/fixtures/ingredients.json.zip...
but afterwards nothing happens.
To test it, I left it running overnight, but nothing changes.
Ingredients are also not added to the setup.
Hi, I have had wger working in a previous docker install, but I am having trouble re-instating it in a new VM.
Container seems to start fine.
Then when I open the webui, non of the images are displayed and I get these errors in the logs.
Checking the volumes and the images are there.
My docker compose:
version: '3.7'
services:
web:
restart: always
image: wger/server:latest
volumes:
- /var/lib/docker/volumes/wger_static:/home/wger/static:rw
- /var/lib/docker/volumes/wger_media:/home/wger/media:rw
ports:
- 8084:8000
# env_file:
# - ./.prod.env # cannot figure out how to get .env files to be pulled by portainer
environment:
- DJANGO_DB_ENGINE=django.db.backends.postgresql
- DJANGO_DB_DATABASE=wger
- DJANGO_DB_USER=wger
- DJANGO_DB_PASSWORD=wger
- DJANGO_DB_HOST=db
- DJANGO_DB_PORT=5432
- DJANGO_CACHE_BACKEND=django_redis.cache.RedisCache
- DJANGO_CACHE_LOCATION=redis://cache:6379/1
- DJANGO_CACHE_TIMEOUT=1296000 # 60*60*24*15, 15 Days
- DJANGO_CACHE_CLIENT_CLASS=django_redis.client.DefaultClient
- DJANGO_MEDIA_ROOT=/home/wger/media
- SECRET_KEY= wger-docker-secret-key # Change the secret key to a random string if you are running this instance publicly
- ALLOW_REGISTRATION=True
- ALLOW_GUEST_USERS=False
- [email protected] # The 'from' address used when sending emails
- DJANGO_DEBUG=False
- WGER_USE_GUNICORN=True
- TIME_ZONE=UTZ
- SITE_URL=http://localhost:8084
- ENABLE_EMAIL=True
- EMAIL_HOST=smtp.gmail.com
- EMAIL_PORT=465
- [email protected]
- EMAIL_HOST_PASSWORD=password
- EMAIL_USE_TLS=False
- EMAIL_USE_SSL=True
depends_on:
- db
- cache
# nginx:
# build: ./nginx
# volumes:
# - static:/wger/static:ro
# - media:/wger/media:ro
# ports:
# - 80:80
# depends_on:
# - web
db:
restart: always
image: postgres:12-alpine
volumes:
- /var/lib/docker/volumes/wger_postgres-data:/var/lib/postgresql/data/
expose:
- 5432
environment:
- POSTGRES_USER=wger
- POSTGRES_PASSWORD=wger
- POSTGRES_DB=wger
cache:
restart: always
image: redis:latest
volumes:
- /var/lib/docker/volumes/wger_redis-data:/data
expose:
- 6379
Any help would be appreciated :)
docker-compose exec web wger load-online-fixtures Leads to Command: 'invoke load-online-fixtures' Exit code: -9
docker-compose exec web wger load-online-fixtures
*** No settings given, using /home/wger/src/settings.py
Downloading fixture data from https://github.com/wger-project/data/raw/master/fixtures/ingredients.json.zip...
-> fixture size: 5.03 MB
-> saving to temp file /tmp/tmpp4vq6u0i.json.zip
Traceback (most recent call last):
File "/usr/local/bin/wger", line 33, in <module>
sys.exit(load_entry_point('wger', 'console_scripts', 'wger')())
File "/home/wger/src/wger/__main__.py", line 40, in main
run(invoke_cmd + ' '.join(args), pty=True)
File "/usr/local/lib/python3.9/dist-packages/invoke/__init__.py", line 48, in run
return Context().run(command, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/invoke/context.py", line 95, in run
return self._run(runner, command, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/invoke/context.py", line 102, in _run
return runner.run(command, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/invoke/runners.py", line 380, in run
return self._run_body(command, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/invoke/runners.py", line 442, in _run_body
return self.make_promise() if self._asynchronous else self._finish()
File "/usr/local/lib/python3.9/dist-packages/invoke/runners.py", line 509, in _finish
raise UnexpectedExit(result)
invoke.exceptions.UnexpectedExit: Encountered a bad command exit code!
Command: 'invoke load-online-fixtures'
Exit code: -9
Stdout: already printed
Stderr: n/a (PTYs have no stderr)
Importing exercise images went well without any errors
Commands used;
docker-compose exec web python3 manage.py sync-exercises
docker-compose exec web python3 manage.py download-exercise-images
In the dockerfile is ffmpeg missing and should be added for video functionality.
When adding excercises to a workout and having language set to Czech, I can't find excercises that are not translated. Workaround is switching to English, no problem there.
Here is an excersise not translated to czech.
Here is a screenshot of me trying to add this excersise to a workout.
I'm running the latest release in docker, excercises pullled this morning. My language is mostly set to Czech, but due to some problems, I switch to English.
I'm almost there! I am having a few issues, and I haven't been able to figure out what to do about this. This is what I get when I try to open the port on my browser
Environment:
Request Method: GET
Request URL: http://192.168.1.9/en/software/features
Django Version: 3.1.5
Python Version: 3.8.5
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.messages',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.staticfiles',
'django_extensions',
'storages',
'wger.config',
'wger.core',
'wger.mailer',
'wger.exercises',
'wger.gym',
'wger.manager',
'wger.nutrition',
'wger.software',
'wger.utils',
'wger.weight',
'captcha',
'django.contrib.sitemaps',
'easy_thumbnails',
'compressor',
'crispy_forms',
'rest_framework',
'rest_framework.authtoken',
'django_filters',
'django_bootstrap_breadcrumbs',
'corsheaders')
Installed Middleware:
('corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'wger.utils.middleware.JavascriptAJAXRedirectionMiddleware',
'wger.utils.middleware.WgerAuthenticationMiddleware',
'wger.utils.middleware.RobotsExclusionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.locale.LocaleMiddleware')
Traceback (most recent call last):
File "/home/wger/src/wger/utils/language.py", line 55, in load_language
language = Language.objects.get(short_name=used_language)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 429, in get
raise self.model.DoesNotExist(
During handling of the above exception (Language matching query does not exist.), another exception occurred:
File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/wger/src/wger/software/views.py", line 35, in features
return render(request, 'features.html', context)
File "/usr/local/lib/python3.8/dist-packages/django/shortcuts.py", line 19, in render
content = loader.render_to_string(template_name, context, request, using=using)
File "/usr/local/lib/python3.8/dist-packages/django/template/loader.py", line 62, in render_to_string
return template.render(context, request)
File "/usr/local/lib/python3.8/dist-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 168, in render
with context.bind_template(self):
File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.8/dist-packages/django/template/context.py", line 244, in bind_template
updates.update(processor(self.request))
File "/home/wger/src/wger/utils/context_processor.py", line 29, in processor
language = load_language()
File "/home/wger/src/wger/utils/language.py", line 58, in load_language
language = Language.objects.get(short_name="en")
File "/usr/local/lib/python3.8/dist-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 429, in get
raise self.model.DoesNotExist(
Exception Type: DoesNotExist at /en/software/features
Exception Value: Language matching query does not exist.
Likewise, this is the error on the *-web
container
Waiting for postgres...,
PostgreSQL started :),
yarn install v1.22.5
,
[1/5] Validating package.json...
,
[2/5] Resolving packages...
,
[3/5] Fetching packages...
,
[4/5] Linking dependencies...
,
warning " > [email protected]" has unmet peer dependency "popper.js@^1.16.1".
,
[5/5] Building fresh packages...
,
Done in 20.74s.
,
yarn run v1.22.5
,
$ sass wger/core/static/scss/main.scss:wger/core/static/yarn/bootstrap-compiled.css
,
Done in 7.45s.
,
Running in production mode, running collectstatic now,
,
4514 static files copied to '/home/wger/static', 279 unmodified.,
Using gunicorn...,
[2021-01-14 04:45:34 +0000] [59] [INFO] Starting gunicorn 20.0.4,
[2021-01-14 04:45:34 +0000] [59] [INFO] Listening at: http://0.0.0.0:8000 (59),
[2021-01-14 04:45:34 +0000] [59] [INFO] Using worker: sync,
[2021-01-14 04:45:35 +0000] [61] [INFO] Booting worker with pid: 61,
Internal Server Error: /en/software/features,
Traceback (most recent call last):,
File "/home/wger/src/wger/utils/language.py", line 55, in load_language,
language = Language.objects.get(short_name=used_language),
File "/usr/local/lib/python3.8/dist-packages/django/db/models/manager.py", line 85, in manager_method,
return getattr(self.get_queryset(), name)(*args, **kwargs),
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 429, in get,
raise self.model.DoesNotExist(,
wger.core.models.Language.DoesNotExist: Language matching query does not exist.,
,
During handling of the above exception, another exception occurred:,
,
Traceback (most recent call last):,
File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/exception.py", line 47, in inner,
response = get_response(request),
File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/base.py", line 181, in _get_response,
response = wrapped_callback(request, *callback_args, **callback_kwargs),
File "/home/wger/src/wger/software/views.py", line 35, in features,
return render(request, 'features.html', context),
File "/usr/local/lib/python3.8/dist-packages/django/shortcuts.py", line 19, in render,
content = loader.render_to_string(template_name, context, request, using=using),
File "/usr/local/lib/python3.8/dist-packages/django/template/loader.py", line 62, in render_to_string,
return template.render(context, request),
File "/usr/local/lib/python3.8/dist-packages/django/template/backends/django.py", line 61, in render,
return self.template.render(context),
File "/usr/local/lib/python3.8/dist-packages/django/template/base.py", line 168, in render,
with context.bind_template(self):,
File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__,
return next(self.gen),
File "/usr/local/lib/python3.8/dist-packages/django/template/context.py", line 244, in bind_template,
updates.update(processor(self.request)),
File "/home/wger/src/wger/utils/context_processor.py", line 29, in processor,
language = load_language(),
File "/home/wger/src/wger/utils/language.py", line 58, in load_language,
language = Language.objects.get(short_name="en"),
File "/usr/local/lib/python3.8/dist-packages/django/db/models/manager.py", line 85, in manager_method,
return getattr(self.get_queryset(), name)(*args, **kwargs),
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 429, in get,
raise self.model.DoesNotExist(,
wger.core.models.Language.DoesNotExist: Language matching query does not exist.,
Do you understand what is wrong with this and how I can make it work?
Thank you very much!
While the DB can be set via environmental variables, currently there is no way to edit the other things in settings.py without getting overwritten with a new image pull
Hi!
I'm running the docker-compose image of wger behind NPM.
Today I updated the images, and now I get the error "403 CSFR-Verification failed".
I updated docker-compose.yml, prod.env and nginx.conf as well and rebuilt - still same problem.
After rollback to my backup, usage of wger through NPM works perfectly fine again.
Can you help me fix this issue?
Kind regards!
My wger container has the DJANGO_DEBUG
option set to False:
$ docker compose exec -T wgerweb env | grep DJANGO_DEBUG
DJANGO_DEBUG=False
But browsing to an invalid URL shows the Django debug page, including the text at the bottom:
You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
So it looks like this isn't being picked up by Django?
I can't quite tell which Dockerfile is being used to build the wger image on Docker Hub, so am unsure where to go to debug this. Is it the one in this directory?
Hello people,
thanks for this amazing project.
I'm trying to deploy an instance of wger in RPi3 for myself but I cannot install PostgreSQL. So I want to know if it is possible to install it using my existing MYSQL DB or at least use the demo image but storing the SQLite DB in a volume.
Regarding the first option (use MYSQL) I didn't find any information of note in the documentation.
Regarding the second option (use the demo image) I tried to attach 3 volume to the container, in the following path:
here is the compose-file:
version: "3.3"
services:
wger:
container_name: wger
image: wger/demo:latest
volumes:
- /selfhosted_volume/wger/static/:/home/wger/static
- /selfhosted_volume/wger/media/:/home/wger/media
- /selfhosted_volume/wger/db/:/home/wger/db/
ports:
- 8000
environment:
- DJANGO_MEDIA_ROOT=/home/wger/media
- ALLOW_REGISTRATION=True
- ALLOW_GUEST_USERS=False
- DJANGO_DEBUG=False
The container starts but when I try to access the webapp it give me the following exception:
Environment:
Request Method: GET
Request URL: http://wger.homenetwork.pi/en/software/features
Django Version: 3.2.11
Python Version: 3.9.5
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.messages',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.staticfiles',
'django_extensions',
'storages',
'wger.config',
'wger.core',
'wger.mailer',
'wger.exercises',
'wger.gym',
'wger.manager',
'wger.nutrition',
'wger.software',
'wger.utils',
'wger.weight',
'wger.gallery',
'wger.measurements',
'captcha',
'django.contrib.sitemaps',
'easy_thumbnails',
'compressor',
'crispy_forms',
'rest_framework',
'rest_framework.authtoken',
'django_filters',
'django_bootstrap_breadcrumbs',
'corsheaders')
Installed Middleware:
('corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'wger.utils.middleware.JavascriptAJAXRedirectionMiddleware',
'wger.utils.middleware.WgerAuthenticationMiddleware',
'wger.utils.middleware.RobotsExclusionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.locale.LocaleMiddleware')
Traceback (most recent call last):
File "/home/wger/src/wger/utils/language.py", line 54, in load_language
language = Language.objects.get(short_name=used_language)
File "/home/wger/venv/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/wger/venv/lib/python3.9/site-packages/django/db/models/query.py", line 435, in get
raise self.model.DoesNotExist(
During handling of the above exception (Language matching query does not exist.), another exception occurred:
File "/home/wger/venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/home/wger/venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/wger/src/wger/software/views.py", line 37, in features
return render(request, 'features.html', context)
File "/home/wger/venv/lib/python3.9/site-packages/django/shortcuts.py", line 19, in render
content = loader.render_to_string(template_name, context, request, using=using)
File "/home/wger/venv/lib/python3.9/site-packages/django/template/loader.py", line 62, in render_to_string
return template.render(context, request)
File "/home/wger/venv/lib/python3.9/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/home/wger/venv/lib/python3.9/site-packages/django/template/base.py", line 168, in render
with context.bind_template(self):
File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/home/wger/venv/lib/python3.9/site-packages/django/template/context.py", line 244, in bind_template
updates.update(processor(self.request))
File "/home/wger/src/wger/utils/context_processor.py", line 28, in processor
language = load_language()
File "/home/wger/src/wger/utils/language.py", line 57, in load_language
language = Language.objects.get(short_name="en")
File "/home/wger/venv/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/wger/venv/lib/python3.9/site-packages/django/db/models/query.py", line 435, in get
raise self.model.DoesNotExist(
Exception Type: DoesNotExist at /en/software/features
Exception Value: Language matching query does not exist.
I'm almost sure this problem is caused by the fact that I'm mounting a local directory into the container to store the the sqlite db, because I noticed that if I try to remove the volume from db everything works well.
Do you have any suggestion on how I can fix this problem?
Thanks in advance
Hello,
Thanks for providing your app as a docker image! However, it's a bit of an anti-pattern to require manual shell commands on startup.
It would be more typical to run on container startup, with perhaps a flag set in an env var to enable or disable.
Would you be open to a PR which implements this? Something like:
ON_STARTUP_SYNC_EXERCISES=true
First time using docker to install a program sequence such as this one. I may need a little hand-holding or the right repo to follow instructions from. Anyone have the 411 on that?
When I load home page there is no CSS or pictures at all.
Console:
GET http://192.168.1.248:8005/static/CACHE/css/output.bb29faf5c6cc.css net::ERR_ABORTED 404 (Not Found)
features:55 GET http://192.168.1.248:8005/static/CACHE/js/output.47a47acd93ca.js net::ERR_ABORTED 404 (Not Found)
features:329 GET http://192.168.1.248:8005/static/yarn/shariff/dist/shariff.min.js net::ERR_ABORTED 404 (Not Found)
features:158 GET http://192.168.1.248:8005/static/images/weight-chart.png 404 (Not Found)
features:173 GET http://192.168.1.248:8005/static/images/calendar.png 404 (Not Found)
features:218 GET http://192.168.1.248:8005/static/images/rest-api.png 404 (Not Found)
features:203 GET http://192.168.1.248:8005/static/images/gym-management.png 404 (Not Found)
features:188 GET http://192.168.1.248:8005/static/images/muscle-overview.png 404 (Not Found)
favicon.png:1 GET http://192.168.1.248:8005/static/images/favicon.png 404 (Not Found)
Please help
After I restarted my docker container, my users data did not persist. I can see 3 users (default admin, the pre-reboot admin, the pre-reboot user) but the pre-reboot users names are some random alphanumeric string, and I can't login with the username/password I had setup previously.
I had only started using it, so I'm not sure about the other workout data. But I am wondering what else I need to do/may have missed to make this persistent across restarts of the container.
My docker-compose.yml:
1 version: '3.7'
2 services:
3 wger:
4 container_name: wger
5 image: wger/server:latest
6 volumes:
7 - ./static:/home/wger/static
8 - ./media:/home/wger/media
9 ports:
10 - 8097:8000
11 environment:
12 PUID: 1000
13 PGID: 1000
14 TZ: Australia/Sydney
15 env_file:
16 - ./prod.env
17 depends_on:
18 - db
19 - cache
20 restart: unless-stopped
21
22 db:
23 image: postgres:12-alpine
24 volumes:
25 - ./postgres-data:/var/lib/postgresql/data/
26 expose:
27 - 5432
28 environment:
29 - POSTGRES_USER=wger
30 - POSTGRES_PASSWORD=wger
31 - POSTGRES_DB=wger
32
33 cache:
34 restart: unless-stopped
35 image: redis:latest
36 expose:
37 - 6379
Hi,
Please could someone help me with what the Docker compose needs to be for a local/lan only (no ngix) set up?
I’ve tried what i can, and have got the following, so far, which is not quite working as expected ...
version: '3'
services:
web:
image: wger/server:latest
container_name: wger_server
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
environment:
- SECRET_KEY=wger-docker-supersecret-key
- SIGNING_KEY=wger-docker-secret-jwtkey
- [email protected]
- TIME_ZONE=Europe/London
- ALLOW_REGISTRATION=True
- ALLOW_GUEST_USERS=True
- ALLOW_UPLOAD_VIDEOS=True
- MIN_ACCOUNT_AGE_TO_TRUST=18
- SYNC_EXERCISES_ON_STARTUP=True
- DOWNLOAD_EXERCISE_IMAGES_ON_STARTUP=True
# Database
- DJANGO_DB_ENGINE=django.db.backends.postgresql
- DJANGO_DB_DATABASE=wger
- DJANGO_DB_USER=wger
- DJANGO_DB_PASSWORD=wger
- DJANGO_DB_HOST=db
- DJANGO_DB_PORT=5432
- DJANGO_PERFORM_MIGRATIONS=True
# Cache
- DJANGO_CACHE_BACKEND=django_redis.cache.RedisCache
- DJANGO_CACHE_LOCATION=redis://cache:6379/1
# 60*60*24*15, 15 Days
- DJANGO_CACHE_TIMEOUT=12
- DJANGO_CACHE_CLIENT_CLASS=django_redis.client.DefaultClient
# Brute force login attacks - https://django-axes.readthedocs.io/en/latest/index.html
- AXES_ENABLED=True
- AXES_FAILURE_LIMIT=10
# in minutes
- AXES_COOLOFF_TIME=30
- AXES_HANDLER=axes.handlers.cache.AxesCacheHandler
# Others
- DJANGO_DEBUG=False
- WGER_USE_GUNICORN=True
- EXERCISE_CACHE_TTL=10
- SITE_URL=http://localhost
# JWT auth - The lifetime duration of the access token, in minutes
- ACCESS_TOKEN_LIFETIME=10
# The lifetime duration of the refresh token, in hours
- REFRESH_TOKEN_LIFETIME=24
# Other possible settings
# RECAPTCHA_PUBLIC_KEY
# RECAPTCHA_PRIVATE_KEY
# NOCAPTCHA
# https://docs.djangoproject.com/en/4.1/topics/email/#smtp-backend
# ENABLE_EMAIL
# EMAIL_HOST
# EMAIL_PORT
# EMAIL_HOST_USER
# EMAIL_HOST_PASSWORD
# EMAIL_USE_TLS
# EMAIL_USE_SSL
# DJANGO_MEDIA_ROOT
# DJANGO_STATIC_ROOT
volumes:
- /share/Container/wger/static:/home/wger/static
- /share/Container/wger/media:/home/wger/media
ports:
- "8000"
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8000
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
db:
image: postgres:12-alpine
container_name: wger_db
environment:
- POSTGRES_USER=wger
- POSTGRES_PASSWORD=wger
- POSTGRES_DB=wger
volumes:
- postgres-data:/var/lib/postgresql/data/
expose:
- 5432
healthcheck:
test: pg_isready -U wger
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
cache:
image: redis
container_name: wger_cache
expose:
- 6379
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
postgres-data:
static:
media:
networks:
default:
name: wger_network
I can access Wger and register but the ui is very basic? See below.. (any ideas)?
While the version of postgres we're using is still supported, we should think on a strategy on how to update it. This will be a breaking change since it will be necessary to perform some manual steps so this will need to be tested,.documented and communicated.
When I try to add an image to an exercise I got the error Key (id)=(4) already exists. If I keep trying the number will be increasing and sometimes it will eventually work. It happen after a fresh install from version 2.0-dev using docker-compose (as described in https://github.com/wger-project/docker). If I try to do it on another exercise the problem is the same and the key (id) keeps increasing by one at time. Can I change key ID by an Unix timestamp?
(Request Method: | POST
-- | --
http://10.0.0.10/pt/exercise/image/160/image/add
3.1.7
IntegrityError
duplicate key value violates unique constraint "exercises_exerciseimage_pkey" DETAIL: Key (id)=(4) already exists.
/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py, line 84, in _execute
/usr/bin/python3
3.8.5
['/usr/local/bin', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/dist-packages', '/home/wger/src', '/usr/lib/python3/dist-packages']
Thu, 25 Mar 2021 16:32:54 +0100)
Request Method: POST
Request URL: http://10.0.0.10/pt/exercise/image/160/image/add
Django Version: 3.1.7
Python Version: 3.8.5
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.messages',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.staticfiles',
'django_extensions',
'storages',
'wger.config',
'wger.core',
'wger.mailer',
'wger.exercises',
'wger.gym',
'wger.manager',
'wger.nutrition',
'wger.software',
'wger.utils',
'wger.weight',
'captcha',
'django.contrib.sitemaps',
'easy_thumbnails',
'compressor',
'crispy_forms',
'rest_framework',
'rest_framework.authtoken',
'django_filters',
'django_bootstrap_breadcrumbs',
'corsheaders')
Installed Middleware:
('corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'wger.utils.middleware.JavascriptAJAXRedirectionMiddleware',
'wger.utils.middleware.WgerAuthenticationMiddleware',
'wger.utils.middleware.RobotsExclusionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.locale.LocaleMiddleware')
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
The above exception (duplicate key value violates unique constraint "exercises_exerciseimage_pkey"
DETAIL: Key (id)=(4) already exists.
) was the direct cause of the following exception:
File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/home/wger/src/wger/utils/generic_views.py", line 199, in dispatch
return super(WgerFormMixin, self).dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/mixins.py", line 52, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/mixins.py", line 85, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/views/generic/base.py", line 98, in dispatch
return handler(request, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/views/generic/edit.py", line 172, in post
return super().post(request, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/views/generic/edit.py", line 142, in post
return self.form_valid(form)
File "/home/wger/src/wger/exercises/views/images.py", line 99, in form_valid
return super(ExerciseImageAddView, self).form_valid(form)
File "/home/wger/src/wger/utils/generic_views.py", line 246, in form_valid
return super(WgerFormMixin, self).form_valid(form)
File "/usr/local/lib/python3.8/dist-packages/django/views/generic/edit.py", line 125, in form_valid
self.object = form.save()
File "/usr/local/lib/python3.8/dist-packages/django/forms/models.py", line 460, in save
self.instance.save()
File "/home/wger/src/wger/exercises/models.py", line 502, in save
super(ExerciseImage, self).save(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 753, in save
self.save_base(using=using, force_insert=force_insert,
File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 790, in save_base
updated = self._save_table(
File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 895, in _save_table
results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 933, in _do_insert
return manager._insert(
File "/usr/local/lib/python3.8/dist-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 1254, in _insert
return query.get_compiler(using=using).execute_sql(returning_fields)
File "/usr/local/lib/python3.8/dist-packages/django/db/models/sql/compiler.py", line 1397, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 98, in execute
return super().execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
Exception Type: IntegrityError at /pt/exercise/image/160/image/add
Exception Value: duplicate key value violates unique constraint "exercises_exerciseimage_pkey"
DETAIL: Key (id)=(4) already exists.
After running.
docker-compose exec web python3 manage.py sync-exercises
*** Synchronizing categories...
done!
*** Synchronizing muscles...
done!
*** Synchronizing equipment...
done!
*** Synchronizing exercises...
Saved new exercise 2 Handed Kettlebell Swing
Traceback (most recent call last):
File "/home/wger/src/wger/exercises/management/commands/sync-exercises.py", line 104, in sync_exercises
exercise = Exercise.objects.get(uuid=exercise_uuid)
File "/usr/local/lib/python3.10/dist-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/django/db/models/query.py", line 435, in get
raise self.model.DoesNotExist(
wger.exercises.models.exercise.Exercise.DoesNotExist: Exercise matching query does not exist.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.ForeignKeyViolation: insert or update on table "exercises_exercisebase" violates foreign key constraint "exercises_exercisebase_license_id_7d658f59_fk_core_license_id"
DETAIL: Key (license_id)=(2) is not present in table "core_license".
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/wger/src/manage.py", line 25, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.10/dist-packages/django/core/management/init.py", line 419, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.10/dist-packages/django/core/management/init.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/home/wger/src/wger/exercises/management/commands/sync-exercises.py", line 84, in handle
self.sync_exercises(headers, remote_url)
File "/home/wger/src/wger/exercises/management/commands/sync-exercises.py", line 125, in sync_exercises
base.save()
File "/usr/local/lib/python3.10/dist-packages/django/db/models/base.py", line 739, in save
self.save_base(using=using, force_insert=force_insert,
File "/usr/local/lib/python3.10/dist-packages/django/db/models/base.py", line 776, in save_base
updated = self._save_table(
File "/usr/local/lib/python3.10/dist-packages/django/db/models/base.py", line 881, in _save_table
results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
File "/usr/local/lib/python3.10/dist-packages/django/db/models/base.py", line 919, in _do_insert
return manager._insert(
File "/usr/local/lib/python3.10/dist-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/django/db/models/query.py", line 1270, in _insert
return query.get_compiler(using=using).execute_sql(returning_fields)
File "/usr/local/lib/python3.10/dist-packages/django/db/models/sql/compiler.py", line 1416, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/utils.py", line 79, in _execute
with self.db.wrap_database_errors:
File "/usr/local/lib/python3.10/dist-packages/django/db/utils.py", line 90, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.10/dist-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.IntegrityError: insert or update on table "exercises_exercisebase" violates foreign key constraint "exercises_exercisebase_license_id_7d658f59_fk_core_license_id"
DETAIL: Key (license_id)=(2) is not present in table "core_license".
Hello,
I can't get your example working, I get the following error in the web docker-compose logs:
web_1 | Waiting for postgres...
web_1 | PostgreSQL started :)
web_1 | Traceback (most recent call last):
web_1 | File "/usr/bin/wger", line 33, in <module>
web_1 | sys.exit(load_entry_point('wger', 'console_scripts', 'wger')())
web_1 | File "/usr/bin/wger", line 22, in importlib_load_entry_point
web_1 | for entry_point in distribution(dist_name).entry_points
web_1 | File "/usr/lib/python3.9/importlib/metadata.py", line 524, in distribution
web_1 | return Distribution.from_name(distribution_name)
web_1 | File "/usr/lib/python3.9/importlib/metadata.py", line 187, in from_name
web_1 | raise PackageNotFoundError(name)
web_1 | importlib.metadata.PackageNotFoundError: wger
web_1 | Running in production mode, running collectstatic now
Thanks for looking into this, sorry that I don't have anything else to add.
Expected results:
working videoupload
Actual results:
Limited file size by nginx setting
Needs some additional command in nginx wger folder for higher bodysize limit
As the main purpose of docker containers is the quick, easy, and scalable deployment of software, having to manage multiple of them for a single app can be tedious when one plans to host multiple wger instances.
Additionally I suspect some of the problems that arise in the docker in regards to data persistence, volumes, and binding local directories can be traced back to permissions errors between the different containers. A singular container allows for tighter controls of these and properly setup with environment variables like "GID" and "UID" would allow for rootless operation, which is an important feature to have.
Finally it would allow for the cleanup of environment variables, as some might not be needed anymore and simplify the nginx setup.
I know this is a tall order and probably a good bit of work, but it would make for much easier deployment, more consistency, and likely fix some errors reported here along the way.
It seems the FROM_EMAIL
is getting lost somewhere:
Originally posted by TryCatchCrash October 23, 2022
I've set up prod.env for email (i know the settings are fine since i have a non-docker instance running and sending mails with the same settings) and it seems to ignore the FROM_EMAIL setting.
I see in the wger_server log:
smtplib.SMTPDataError: (553, b'Relaying disallowed as [email protected]')
FROM_EMAIL is set to admin@<mydomain.ext>
Am I doing something wrong or is this a bug?
Hello,
I'm having a similar issue as #36 but the steps used to resolve the error don't seem to be fully working for me. Not sure what to do next any info would be greatly appreciated! Logs from the docker container:
`yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
Done in 7.11s.
yarn run v1.22.19
$ sass wger/core/static/scss/main.scss:wger/core/static/yarn/bootstrap-compiled.css
Done in 3.52s.
Running in production mode, running collectstatic now
5726 static files copied to '/home/wger/static', 10012 unmodified.
Synchronizing exercises
*** Synchronizing languages...
done!
*** Synchronizing categories...
done!
*** Synchronizing muscles...
done!
*** Synchronizing equipment...
done!
*** Synchronizing exercises...
updated exercise cfb6a754-57be-431b-b8d0-d9963120bd5a
Good day
I do not know if this issue has been raised, and I do not know how to search for it. I am running wger in docker, but all of a sudden it looks like the attached photo. Please help. I can't seem to fix it. It looks like it doesn't see or load the CSS on the page, but I'm not sure. It happens in all browsers, so it's not a plugin causing it.
Thank you
Darius
web_1 | Exercise 2b0205ef-40cc-49d3-b982-d42b60f05ebb has no base, this should not happen!Skipping...
web_1 | Exercise a9f2d62a-6a3c-4b20-b3ff-cb3654bf3195 has no base, this should not happen!Skipping...
web_1 | Exercise 9baf0689-e7d6-4809-9318-01a043860a82 has no base, this should not happen!Skipping...
web_1 | Exercise c81fa1a0-9bfe-474b-b78f-195ef791e499 has no base, this should not happen!Skipping...
web_1 | Exercise ebdd3ac2-dfa2-4c36-8c41-fbcbec16a042 has no base, this should not happen!Skipping...
web_1 | Exercise 9eb10e6a-97e1-46e1-b9ac-226bb25ca080 has no base, this should not happen!Skipping...
web_1 | Exercise ae308b2f-ceb2-4517-93b8-3b90f37fad47 has no base, this should not happen!Skipping...
web_1 | Exercise 87d5edb6-3ecf-4ff3-aa52-38a764e95120 has no base, this should not happen!Skipping...
web_1 | Exercise 2ac4a5f9-2b47-436e-843a-655580746aa3 has no base, this should not happen!Skipping...
web_1 | Exercise 1de6fe0a-f267-4509-84bc-2ecefbe5652d has no base, this should not happen!Skipping...
web_1 | Exercise 6f43fa49-d64e-4132-bebc-2fd722da6997 has no base, this should not happen!Skipping...
web_1 | Exercise d721e53c-afc2-4535-b0ff-61e158dd25f9 has no base, this should not happen!Skipping...
web_1 | Exercise 84794882-9d1d-480b-89ad-4861647b8f82 has no base, this should not happen!Skipping...
Just an FYI
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.