I keep having problems getting this thing going and humbly request some assistance or at least insight. I’m using docker compose. I’ve tried this on two separate Docker hosts. I’m using the nginx proxy in front so that I can access API on the same address/port as the frontend. I’ve tried mysql and postgres.
In either case, I hit frontend and get this:
An error occurred:
AxiosError: Network Error
Please check if the api url is correct.
Whereas I can hit the API URL http://192.168.2.169/api/v1/info
and get back what looks like good info:
{"version":"v0.21.0","frontend_url":"https://192.168.2.169/","motd":"","link_sharing_enabled":true,"max_file_size":"20MB","registration_enabled":true,"available_migrators":["vikunja-file","ticktick"],"task_attachments_enabled":true,"enabled_background_providers":["upload"],"totp_enabled":true,"legal":{"imprint_url":"","privacy_policy_url":""},"caldav_enabled":true,"auth":{"local":{"enabled":true},"openid_connect":{"enabled":false,"redirect_url":"https://192.168.2.169/auth/openid/","providers":null}},"email_reminders_enabled":true,"user_deletion_enabled":true,"task_comments_enabled":true}
API seems to be working fine.
In the logs keeps happening with every refresh of frontend:
vikinja-frontend-1 | 172.18.0.5 - - [04/Aug/2023:00:16:40 +0000] "GET / HTTP/1.0" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" "-"
vikinja-proxy-1 | 192.168.1.16 - - [04/Aug/2023:00:16:40 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" "-"
vikinja-api-1 | 2023-08-04T00:16:40.620853082Z: WEB ▶ 172.18.0.5 GET 200 /api/v1/info 240.107µs - Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36
vikinja-proxy-1 | 192.168.1.16 - - [04/Aug/2023:00:16:40 +0000] "GET /api/v1/info HTTP/1.1" 200 595 "http://192.168.2.169/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" "-"
vikinja-api-1 | 2023-08-04T00:16:40.630136291Z: ERROR ▶ v1/UserShow 0b5 User does not exist [user id: 1]
vikinja-api-1 | 2023-08-04T00:16:40.630205171Z: WEB ▶ 172.18.0.5 GET 404 /api/v1/user 2.92875ms - Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36
vikinja-proxy-1 | 192.168.1.16 - - [04/Aug/2023:00:16:40 +0000] "GET /api/v1/user HTTP/1.1" 404 51 "http://192.168.2.169/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" "-"
Specifically the ERROR ▶ v1/UserShow 0b5 User does not exist [user id: 1]
is what seems to be the issue. I’m not at all sure what is going on here. This is a brand-new install. I’ve blown away the database folder many times prior to re-running, so I can’t say it’s like there’s a user there that shouldn’t be from a prior run.
Docker compose:
version: '3'
services:
db:
image: mariadb:10
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_ROOT_PASSWORD: supersecret
MYSQL_USER: vikunja
MYSQL_PASSWORD: secret
MYSQL_DATABASE: vikunja
volumes:
- ./db:/var/lib/mysql
restart: unless-stopped
api:
image: vikunja/api
environment:
VIKUNJA_DATABASE_HOST: db
VIKUNJA_DATABASE_PASSWORD: secret
VIKUNJA_DATABASE_TYPE: mysql
VIKUNJA_DATABASE_USER: vikunja
VIKUNJA_DATABASE_DATABASE: vikunja
VIKUNJA_SERVICE_JWTSECRET: secretiest-secret-ever
VIKUNJA_SERVICE_FRONTENDURL: https://192.168.2.169/
volumes:
- ./files:/app/vikunja/files
depends_on:
- db
restart: unless-stopped
frontend:
image: vikunja/frontend
restart: unless-stopped
proxy:
image: nginx
ports:
- 80:80
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- api
- frontend
restart: unless-stopped
nginx.conf:
server {
listen 80;
location / {
proxy_pass http://frontend:80;
}
location ~* ^/(api|dav|\.well-known)/ {
proxy_pass http://api:3456;
client_max_body_size 20M;
}
}
Is there something that I’m doing wrong?
Again, I tried this with mariadb, postgres. I haven’t yet attempted a run to see if I can get frontend to find backend outside of using the proxy. I can confirm that they are all under the same docker network (as that’s what compose does)… I haven’t found any such errors like this, I’ve read the docs a few times. I’m flummoxed.