Skip to content

[Bug]: Database SSL/TLS generation errors (mongodb) #5625

@LaurenceJJones

Description

@LaurenceJJones

Error Message and Logs

When enabling SSL/TLS on a database resource and clicking start the deployment fails as unhealthy and there a few things that can happen:

  • Either the server.pem does not exist and docker creates a directory:
root@coolify-test:~# ls -la /data/coolify/databases/sk80s8o8sw0swo4oc004cg4g/ssl/server.pem
total 8
drwxr-xr-x 2 root root 4096 Apr 16 10:59 .
drwxr-xr-x 3 root root 4096 Apr 16 10:59 ..
  • Hitting generate SSL certificate if the directory appears replaces the directory with an empty file owned by root:root
root@coolify-test:~# ls -la /data/coolify/databases/sk80s8o8sw0swo4oc004cg4g/ssl/server.pem
-rw-r--r-- 1 root root 0 Apr 16 10:59 /data/coolify/databases/sk80s8o8sw0swo4oc004cg4g/ssl/server.pem
  • Hitting generate again will then successfully create the server.pem file
root@coolify-test:~# ls -la /data/coolify/databases/sk80s8o8sw0swo4oc004cg4g/ssl/server.pem
-rw------- 1 root root 1374 Apr 16 11:00 /data/coolify/databases/sk80s8o8sw0swo4oc004cg4g/ssl/server.pem

However, the final issue is mongodb cannot read this file due to permissions on the file.

Steps to Reproduce

  1. Generate a database resource and enabled SSL
  2. Click start without hitting generate SSL certificate
  3. Inspect docker container to see where the file is mounted and go check what was generated
  4. Keep hitting generate SSL as you cycle through directory -> empty file -> file owned by root

Example Repository URL

No response

Coolify Version

latest

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 Possible BugReported issues that need to be reproduced by the team.🔍 TriageIssues that need assessment and prioritization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions