coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
31.14k stars 1.58k forks source link

[Bug]: Permission denied on mongod.conf when using MongoDB service #2862

Open ReCREWt-Philipp opened 1 month ago

ReCREWt-Philipp commented 1 month ago

Description

When I provide a mongod.conf definition via the "Custom MongoDB Configuration" field for the MongoDB service the service is not able to start due to a permission denied error (see "Exception or Error" below)

Minimal Reproduction (if possible, example repository)

I created a completely new MongoDB service.

I added following configuration in the "Custom MongoDB Configuration" field:

net:
   tls:
      mode: requireTLS
      certificateKeyFile: /data/mongo/mongodb.pem
      CAFile: /data/mongo/mongodb-cert.crt

Maybe also important: On the localhost coolify is configured in root mode. The MongoDB service is installed on a remote server, where coolify is acting in non-root mode

Exception or Error

Error: EACCES: permission denied, open '/etc/mongo/mongod.conf'
error: unexpected "js-yaml.js" output while parsing config:
grep: /etc/mongo/mongod.conf: Permission denied

Version

v4.0.0-beta.315

andrasbacsai commented 1 month ago

Do you have a volume mount to /data/mongo/ configured? Or how do you set those mongodb configuration files on the server/container?

ReCREWt-Philipp commented 1 month ago

Yes,I provided it via a volume mount. (Sidenote: Using file mounts does also not work in this service. I receive following error Undefined variable $fs_path)

ksaitor commented 1 month ago

Yes,I provided it via a volume mount. (Sidenote: Using file mounts does also not work in this service. I receive following error Undefined variable $fs_path)

same error while mounting a file

image

image

njoguamos commented 7 hours ago

I am getting same error when mounting a file.

Screenshot 2024-09-07 at 23 12 22 Screenshot 2024-09-07 at 23 12 25