# Error using Vikunja in Portainer

**URL:** <https://community.vikunja.io/t/error-using-vikunja-in-portainer/1673>\
**Category:** Support\
**Created:** [2 October 2023 09:03 UTC](https://community.vikunja.io/t/error-using-vikunja-in-portainer/1673 "2023-10-02T09:03:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![puppet9](https://community.vikunja.io/letter_avatar_proxy/v4/letter/p/a88e4f/32.png) [@puppet9](https://community.vikunja.io/u/puppet9)\
**Post date:** [2 October 2023 09:03 UTC](https://community.vikunja.io/t/error-using-vikunja-in-portainer/1673/1 "2023-10-02T09:03:18Z")

</div>

Hello,

this is my first post so I want to thank the vikunja ppl and the community for this terrific tool 🙂

I had Vikunja running for some weeks in my local network only with no problems. Then I decided to make it available from outside using my Domain, SSL and **nginx proxy manager** using **portainer** but ran into some strange behaviour making it impossible to use vikunja.

**The Symtoms:**

- The Loginpage wasn´t reachable using the Domain. I had to use the IP of my host system to create my user. Error: API wasn´t reachable. Althoug I´m gettin a response from [https://myDomain.tld/api/v1](https://myDomain.tld/api/v1)
- Sometimes my Tasks dont show up and it shows a “Internal Server Error” in the left bottom corner of the screen. After refreshing the page… everythings loads fine.
- I´m getting this error 500 in my API logs from time to time (maybe 50% of connections)

 ![Bildschirmfoto 2023-10-02 um 11.04.46](https://community.vikunja.io/uploads/default/original/1X/1e63b71c0f69ed8d3a80750a6b25fe04c60358eb.png)

```auto
2023-10-02T08:50:06.290581029Z: ERROR	▶ handler/ReadAllWeb 1812 Error 1698 (28000): Access denied for user 'vikunja'@'172.24.0.9'

```

Pinging the DB from API Container is possible without any errors and I can´t see any container beeing unstable or rebooting…

Here is my docker-compose.yaml…

```auto
version: '3'

services:
  db:
    image: mariadb:10
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    environment:
      MYSQL_ROOT_PASSWORD: SOMEPASSWORD
      MYSQL_USER: vikunja
      MYSQL_PASSWORD: SOMEPASSWORD
      MYSQL_DATABASE: vikunja
    volumes:
      - /home/manu/volumes/vikunja/db:/var/lib/mysql
    restart: unless-stopped
    networks:
      - nginxproxymanager_default
  api:
    image: vikunja/api
    environment:
      VIKUNJA_DATABASE_HOST: db
      VIKUNJA_DATABASE_PASSWORD: SOMEPASSWORD
      VIKUNJA_DATABASE_TYPE: mysql
      VIKUNJA_DATABASE_USER: vikunja
      VIKUNJA_DATABASE_DATABASE: vikunja
      VIKUNJA_SERVICE_JWTSECRET: SOMEPASSWORD
      VIKUNJA_SERVICE_FRONTENDURL: https://todos.mydomain.de/
    volumes: 
      - /home/manu/volumes/vikunja/files:/app/vikunja/files
    depends_on:
      - db
    restart: unless-stopped
    networks:
      - nginxproxymanager_default
  frontend:
    image: vikunja/frontend
    restart: unless-stopped
    networks:
      - nginxproxymanager_default
  proxy:
    image: nginx
    ports:
      - 8081:80
    volumes:
      - /home/manu/volumes/vikunja/nginx.conf:/etc/nginx/conf.d/default.conf:ro
    depends_on:
      - api
      - frontend
    restart: unless-stopped
    networks:
      - nginxproxymanager_default
networks:
  nginxproxymanager_default:
    name: nginxproxymanager_default
    external: true

```

Here is some more info on my network: (docker ps)

```auto
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
893d8fb1a340 nginx "/docker-entrypoint.…" 57 minutes ago Up 57 minutes 0.0.0.0:8081->80/tcp, :::8081->80/tcp vikunja-proxy-1
b617da98b978 vikunja/api "/sbin/tini -g -- /e…" 57 minutes ago Up 57 minutes 3456/tcp vikunja-api-1
f6387b9d94cb mariadb:10 "docker-entrypoint.s…" 57 minutes ago Up 57 minutes 3306/tcp vikunja-db-1
d5f27eca07c1 vikunja/frontend "/docker-entrypoint.…" 57 minutes ago Up 57 minutes 80/tcp vikunja-frontend-1
adb2b4aa9c4d nextcloud "/entrypoint.sh apac…" 2 hours ago Up 2 hours 0.0.0.0:8084->80/tcp, :::8084->80/tcp nextcloud
bdcf8636481b mariadb "docker-entrypoint.s…" 2 hours ago Up 2 hours 3306/tcp maria-db
5280a1b77548 lscr.io/linuxserver/duplicati:latest "/init" 20 hours ago Up 20 hours 0.0.0.0:8082->8200/tcp, :::8082->8200/tcp duplicati
b79b2b68a530 jc21/nginx-proxy-manager:latest "/init" 24 hours ago Up 23 hours 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp, 0.0.0.0:8080->81/tcp, :::8080->81/tcp nginxproxymanager-app-1
b63442530005 jc21/mariadb-aria:latest "/scripts/run.sh" 24 hours ago Up 23 hours 3306/tcp nginxproxymanager-db-1
fd19786dbf3a portainer/portainer-ce:latest "/portainer" 5 days ago Up 23 hours 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 0.0.0.0:9443->9443/tcp, :::9443->9443/tcp, 9000/tcp portainer

```

Thank you!

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [3 October 2023 09:24 UTC](https://community.vikunja.io/t/error-using-vikunja-in-portainer/1673/2 "2023-10-03T09:24:51Z")

</div>

> [@puppet9](#):
>
> The Loginpage wasn´t reachable using the Domain. I had to use the IP of my host system to create my user. Error: API wasn´t reachable. Althoug I´m gettin a response from [https://myDomain.tld/api/v1](https://myDomain.tld/api/v1)

Did you expose the api and frontend?

Did you set up cors so that it is reachable via the domain?

> [@puppet9](#):
>
> Althoug I´m gettin a response from [https://myDomain.tld/api/v1](https://myDomain.tld/api/v1)

Which response? Any errors in the logs?

---

<div class="post-metadata">

**Author:** ![puppet9](https://community.vikunja.io/letter_avatar_proxy/v4/letter/p/a88e4f/32.png) [@puppet9](https://community.vikunja.io/u/puppet9)\
**Post date:** [3 October 2023 11:43 UTC](https://community.vikunja.io/t/error-using-vikunja-in-portainer/1673/3 "2023-10-03T11:43:49Z")

</div>

Hello,

when I visit [https://myDomain.tld/api/v1](https://mydomain.tld/api/v1) in the browser, im getting this response:  
`{"message":"missing or malformed jwt"}`

I did not set up CORS but vikunja is handling 50% of the requests fine, so I didn´t think it could be a CORS problem. I´ll give it a try anyway.

Thank you!

---

<div class="post-metadata">

**Author:** ![puppet9](https://community.vikunja.io/letter_avatar_proxy/v4/letter/p/a88e4f/32.png) [@puppet9](https://community.vikunja.io/u/puppet9)\
**Post date:** [3 October 2023 12:02 UTC](https://community.vikunja.io/t/error-using-vikunja-in-portainer/1673/4 "2023-10-03T12:02:40Z")

</div>

When i log in, sometimes my Projects are not showing up, but after hitting F5 for a couple of times the projects and tasks are suddenly loading.

This is the error in the API-Log:

```auto
2023-10-03T12:00:26.576951672Z: ERROR	▶ handler/ReadAllWeb 5a20 Error 1045 (28000): Access denied for user 'vikunja'@'172.24.0.9' (using password: YES)

```

Looks like the API sometimes cant access the DB. But I cant see why…

It looks like CORS is enabled by default.

> **[Config options | Vikunja](https://vikunja.io/docs/config-options/)**

---

<div class="post-metadata">

**Author:** ![puppet9](https://community.vikunja.io/letter_avatar_proxy/v4/letter/p/a88e4f/32.png) [@puppet9](https://community.vikunja.io/u/puppet9)\
**Post date:** [3 October 2023 12:11 UTC](https://community.vikunja.io/t/error-using-vikunja-in-portainer/1673/5 "2023-10-03T12:11:35Z")

</div>

hmm, I just tried to access vikunja using the local IP of my host and I´m getting the same errors. Looks like some DB problem to me.

---

<div class="post-metadata">

**Author:** ![puppet9](https://community.vikunja.io/letter_avatar_proxy/v4/letter/p/a88e4f/32.png) [@puppet9](https://community.vikunja.io/u/puppet9)\
**Post date:** [3 October 2023 12:56 UTC](https://community.vikunja.io/t/error-using-vikunja-in-portainer/1673/6 "2023-10-03T12:56:17Z")

</div>

ok, I switched to sqlite. Everything works fine now… Problem solved 🙂
