Access denied inside the DB container #21

Closed
opened 2025-11-01 20:44:33 -05:00 by GiteaMirror · 12 comments
Owner

Originally created by @rheaalleen on GitHub (Nov 16, 2021).

Tried to give this a spin under docker, I saw a similar problem over on kolaente.dev but this one is even working less.

Using the docker-compose.yml from the docs, only replacing the IP of my host, the two containers come up.

The frontend has the same problems as described on other issues site:

  • I've got an "Info" box with no content, am I even connected to the back end?

  • If I just click Log In, it just says "Request failed with status code 405". What does that mean?

Also the Register Button is missing, the entire layout is misaligned. I can browse there with the subpath but otherwise it wouldn't be accessible.

The problem is that with the provided docker-compose.yml from the docs the db user vikunja cant access the database, docker logs of the container show the error "Access denied for user 'vikunja'@'docker-ip' (Using password: yes)". If I exec into the container and log myself in (mysql -u vikunja -p) I get in just fine. The user vikunja isn't restricted from which host ('vikunja'@'%').

So far I have no idea why the provided standard docker-compose would do that. Any ideas?

Originally created by @rheaalleen on GitHub (Nov 16, 2021). Tried to give this a spin under docker, I saw a similar problem over on [kolaente.dev](https://kolaente.dev/vikunja/api/issues/837) but this one is even working less. Using the [docker-compose.yml](https://vikunja.io/docs/full-docker-example/#example-without-any-proxy) from the docs, only replacing the IP of my host, the two containers come up. The frontend has the same problems as described on other issues [site](https://kolaente.dev/vikunja/api/issues/986): - > I've got an "Info" box with no content, am I even connected to the back end? - > If I just click Log In, it just says "Request failed with status code 405". What does that mean? Also the Register Button is missing, the entire layout is misaligned. I can browse there with the subpath but otherwise it wouldn't be accessible. The problem is that with the provided docker-compose.yml from the docs the db user vikunja cant access the database, docker logs of the container show the error "Access denied for user 'vikunja'@'_docker-ip_' (Using password: yes)". If I exec into the container and log myself in (mysql -u vikunja -p) I get in just fine. The user vikunja isn't restricted from which host ('vikunja'@'%'). So far I have no idea why the provided standard docker-compose would do that. Any ideas?
Author
Owner

@kolaente commented on GitHub (Nov 16, 2021):

Did you configure the api URL as described in the docs you linked?

There's a few cases of the issue you're describing in the forum:

https://community.vikunja.io/t/new-install-no-register-button

https://community.vikunja.io/t/after-fresh-install-only-access-to-the-login-page-with-red-empty-box-under-the-form-buttons

I think there's more but those were the first two I found.

@kolaente commented on GitHub (Nov 16, 2021): Did you configure the api URL as described in the docs you linked? There's a few cases of the issue you're describing in the forum: https://community.vikunja.io/t/new-install-no-register-button https://community.vikunja.io/t/after-fresh-install-only-access-to-the-login-page-with-red-empty-box-under-the-form-buttons I think there's more but those were the first two I found.
Author
Owner

@rheaalleen commented on GitHub (Nov 17, 2021):

Using the docker-compose.yml from the docs, only replacing the IP of my host, the two containers come up.

As I mentioned, yes, I did replace the API URL. If my host would be 1.1.1.1 I would edit the line:

VIKUNJA_API_URL: http://1.1.1.1:3456/api/v1

@rheaalleen commented on GitHub (Nov 17, 2021): > Using the docker-compose.yml from the docs, only replacing the IP of my host, the two containers come up. As I mentioned, yes, I did replace the API URL. If my host would be 1.1.1.1 I would edit the line: ` VIKUNJA_API_URL: http://1.1.1.1:3456/api/v1 `
Author
Owner

@kolaente commented on GitHub (Nov 17, 2021):

Sorry, seems like I overlooked that.

Can you verify the api is reachable at http://1.1.1.1:3456/api/v1/info?

I'm guessing the access denied comes from the mysql container not yet being ready as it can take a while to initialize. The api container will restart in that case. Does it work if you wait a while (a few minutes max)?

@kolaente commented on GitHub (Nov 17, 2021): Sorry, seems like I overlooked that. Can you verify the api is reachable at `http://1.1.1.1:3456/api/v1/info`? I'm guessing the access denied comes from the mysql container not yet being ready as it can take a while to initialize. The api container will restart in that case. Does it work if you wait a while (a few minutes max)?
Author
Owner

@rheaalleen commented on GitHub (Nov 17, 2021):

Ah, I forgot to mention that from the Frontend Docker, the logs show a 405 returned for the request to the API. That would mean that a POST was not allowed (tried to register) but at the same time that the DB container is accessible.

I'll restart both of them and wait a bit

@rheaalleen commented on GitHub (Nov 17, 2021): Ah, I forgot to mention that from the Frontend Docker, the logs show a 405 returned for the request to the API. That would mean that a POST was not allowed (tried to register) but at the same time that the DB container is accessible. I'll restart both of them and wait a bit
Author
Owner

@rheaalleen commented on GitHub (Nov 17, 2021):

Okay, either this is new or I was just too tired yesterday and didn't see it.

The Frontend and MariaDB container just start fine but the API doesn't, it's always restarting. In the logs I see that the error is

Config File "config" not found Not Found in "[/app/vikunja /etc/vikunja /app/vikunja/.config/vikunja]

Critical: migration/Migrate 002 Migration failed: Error 1045: Access denied for user 'vikunja'@'docker-ip' (Using password: YES)

So far I didn't know that a config file was needed, so I created an empty one inside the files folder.

  1. The error says a config file is not found, if created the error stays
  2. Since the error shows a different path (/app/vikunja), I edit the line from the api service volume:
  • ./files:/app/vikunja/files to - ./files:/app/vikunja/ (Tried with a trailing / and without)

Then the error changes to (config file still inside files folder)

sh: /app/vikunja/vikunja: not found

usermod: no changes

If going back to the original docker-compose.yml (./files:/app/vikunja/files) and check the config docs it says the config is named config.yml. Is this the same one since it's

  1. Named differently
  2. Placed inside the root folder and not files folder?

Moving the file into the root folder, alongside the docker-compose.yml results in the same error as above, Config File not found and Migration failed

========================

While writing the section above I left the containers running, for some reason the API container still continues to restart but stays up between. If you check with docker ps and see it running someone could falsely assume it's working.

@rheaalleen commented on GitHub (Nov 17, 2021): Okay, either this is new or I was just too tired yesterday and didn't see it. The Frontend and MariaDB container just start fine but the API doesn't, it's always restarting. In the logs I see that the error is > Config File "config" not found Not Found in "[/app/vikunja /etc/vikunja /app/vikunja/.config/vikunja] > Critical: migration/Migrate 002 Migration failed: Error 1045: Access denied for user 'vikunja'@'_docker-ip_' (Using password: YES) So far I didn't know that a config file was needed, so I created an empty one inside the files folder. 1. The error says a config file is not found, if created the error stays 2. Since the error shows a different path (/app/vikunja), I edit the line from the api service volume: > - ./files:/app/vikunja/files to - ./files:/app/vikunja/ (Tried with a trailing / and without) Then the error changes to (config file still inside files folder) > sh: /app/vikunja/vikunja: not found > usermod: no changes If going back to the original docker-compose.yml (./files:/app/vikunja/files) and check the config [docs](https://vikunja.io/docs/config-options/) it says the config is named config.yml. Is this the same one since it's 1. Named differently 2. Placed inside the root folder and not files folder? Moving the file into the root folder, alongside the docker-compose.yml results in the same error as above, Config File not found and Migration failed ======================== While writing the section above I left the containers running, for some reason the API container still continues to restart but stays up between. If you check with docker ps and see it running someone could falsely assume it's working.
Author
Owner

@kolaente commented on GitHub (Nov 17, 2021):

Is there any useful logging output from the mariadb container?

So far I didn't know that a config file was needed

You don't need one as long as you have env variables configured. The error message is only about the file not being found, but it uses config from env variables nevertheless.

Then the error changes to (config file still inside files folder)

sh: /app/vikunja/vikunja: not found

The binary is located in /app/vikunja/vikunja in the container. If you mount some folder over to that directory, there's no binary the container can run on startup. That's why it fails.

and check the config docs it says the config is named config.yml. Is this the same one since it's

Going back to the error message :

Config File "config" not found Not Found in "[/app/vikunja /etc/vikunja /app/vikunja/.config/vikunja]

Vikunja is looking for a config file in one of the folders /app/vikunja (that's the root path where the binary is located), /etc/vikunja or /app/vikunja/.config/vikunja. A config file can be either yaml or toml and should be named config.yml or config.toml.

The ./files mount from the original example is only to store uploaded files and others. Vikunja does not look for a config file there.

Moving the file into the root folder, alongside the docker-compose.yml results in the same error as above, Config File not found and Migration failed

The container does not have access to your host file system. It can't know that you placed a file there unless you mount it into the container.

@kolaente commented on GitHub (Nov 17, 2021): Is there any useful logging output from the mariadb container? > So far I didn't know that a config file was needed You don't need one as long as you have env variables configured. The error message is only about the file not being found, but it uses config from env variables nevertheless. > Then the error changes to (config file still inside files folder) > > sh: /app/vikunja/vikunja: not found The binary is located in /app/vikunja/vikunja in the container. If you mount some folder over to that directory, there's no binary the container can run on startup. That's why it fails. > and check the config docs it says the config is named config.yml. Is this the same one since it's Going back to the error message : > Config File "config" not found Not Found in "[/app/vikunja /etc/vikunja /app/vikunja/.config/vikunja] Vikunja is looking for a config file in one of the folders `/app/vikunja` (that's the root path where the binary is located), `/etc/vikunja` or `/app/vikunja/.config/vikunja`. A config file can be either yaml or toml and should be named `config.yml` or `config.toml`. The `./files` mount from the original example is only to store uploaded files and others. Vikunja does not look for a config file there. > Moving the file into the root folder, alongside the docker-compose.yml results in the same error as above, Config File not found and Migration failed The container does not have access to your host file system. It can't know that you placed a file there unless you mount it into the container.
Author
Owner

@rheaalleen commented on GitHub (Nov 17, 2021):

Tried my best with RTFM, that's why I tinkered a bit with the docker-compose.

It's a bit confusing since some examples include the config files and others do not and it isn't clear in some points, but that's just my impression.

The container does not have access to your host file system. It can't know that you placed a file there unless you mount it into the container.

Forgot to say that I tried mounting it correctly, basically I just went around with the file/volumes trying for different results.

Is there any useful logging output from the mariadb container?

Not really, mysqld: ready for connections, some InnoDB information (no errors), and then only lines with the access denied warning.

For recap, docker-compose.yml from the docs, Host IP for the API URL edited in and a blank folder. After starting the db/files folder are generated. No config file included or mounted

@rheaalleen commented on GitHub (Nov 17, 2021): Tried my best with RTFM, that's why I tinkered a bit with the docker-compose. It's a bit confusing since some examples include the config files and others do not and it isn't clear in some points, but that's just my impression. > The container does not have access to your host file system. It can't know that you placed a file there unless you mount it into the container. Forgot to say that I tried mounting it correctly, basically I just went around with the file/volumes trying for different results. > Is there any useful logging output from the mariadb container? Not really, mysqld: ready for connections, some InnoDB information (no errors), and then only lines with the access denied warning. For recap, docker-compose.yml from the docs, Host IP for the API URL edited in and a blank folder. After starting the db/files folder are generated. No config file included or mounted
Author
Owner

@rheaalleen commented on GitHub (Nov 17, 2021):

I tried this on a different host again, prior this was under an ESXi Hypervisor, now a Synology NAS.

Screenshots are from Synology Host, NOT from the host I opened the issue for. The everything comes up but it still doesn't work. If I somehow can solve the problem on the first host that not even my db user can login there is a chance the following problem would also happen.

ESXi does get the images through a proxy and runs a Debian 10 VM where I installed docker and tried to run the docker-compose from the docks.

====== Synology Screenshots ======
API:
image

Maria:
image

Frontend:
image

docker ps:
image

@rheaalleen commented on GitHub (Nov 17, 2021): I tried this on a different host again, prior this was under an ESXi Hypervisor, now a Synology NAS. Screenshots are from Synology Host, **NOT** from the host I opened the issue for. The everything comes up but it still doesn't work. If I somehow can solve the problem on the first host that not even my db user can login there is a chance the following problem would also happen. ESXi does get the images through a proxy and runs a Debian 10 VM where I installed docker and tried to run the docker-compose from the docks. ====== Synology Screenshots ====== API: ![image](https://user-images.githubusercontent.com/52893816/142214022-f6a0940a-db08-40db-b559-2c58ac66349b.png) Maria: ![image](https://user-images.githubusercontent.com/52893816/142214666-6d7507bd-6b24-43b5-95c0-710096d42390.png) Frontend: ![image](https://user-images.githubusercontent.com/52893816/142214794-cb9d6505-b614-49e0-8e06-ca075f17273d.png) docker ps: ![image](https://user-images.githubusercontent.com/52893816/142215210-cbc19ce9-2047-4334-a2a6-152ecb94657e.png)
Author
Owner

@rheaalleen commented on GitHub (Nov 17, 2021):

Another update: I went ahead and tried it again on the ESXi with the docker walkthrough section. And behold, it worked 🙃

I can't fathom why this is "broken" without a proxy.

@rheaalleen commented on GitHub (Nov 17, 2021): Another update: I went ahead and tried it again on the ESXi with the [docker walkthrough section](https://vikunja.io/docs/docker-walkthrough/). And behold, it worked :upside_down_face: I can't fathom why this is "broken" without a proxy.
Author
Owner

@kolaente commented on GitHub (Nov 17, 2021):

Glad it seems to work now.

Since the original issue seems to be caused by a mariadb container, you might want to try it with the postgres example. It does not make any sense why this should work with a proxy and not without one.

@kolaente commented on GitHub (Nov 17, 2021): Glad it seems to work now. Since the original issue seems to be caused by a mariadb container, you might want to try it with the [postgres example](https://vikunja.io/docs/full-docker-example/#postgresql). It does not make any sense why this should work with a proxy and not without one.
Author
Owner

@kolaente commented on GitHub (Nov 22, 2021):

Closing as resolved, feel free to ping if you have other issues.

@kolaente commented on GitHub (Nov 22, 2021): Closing as resolved, feel free to ping if you have other issues.
Author
Owner

@VincentSC commented on GitHub (Sep 28, 2024):

It does not make any sense why this should work with a proxy and not without one.

Because there is another docker-compose where you exposed the database to the proxy. So check with docker container ls | grep "db" and see none of these are exposed to the proxy

@VincentSC commented on GitHub (Sep 28, 2024): > It does not make any sense why this should work with a proxy and not without one. Because there is another docker-compose where you exposed the database to the proxy. So check with `docker container ls | grep "db"` and see none of these are exposed to the proxy
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#21