Health Check for docker container falsely reports unhealthy when foundryvtt is running with inbuilt https server
Bug description
See https://github.com/felddy/foundryvtt-docker/issues/96 which details the same problem.
When enabling SSL communication within FoundryVTT (by populating the Certificate and Key fields in configuration), the docker container will falsely report that it is unhealthy even though the URL for the server is operating normally and properly utilizing the certificate file(s).
Per docker inspect command:
{
"Id": "5c374170d7afed5811cc3251f27b12de173beee2c7899a102e2e47fe9f90c426",
"Created": "2024-02-04T03:17:16.701460867Z",
"Path": "./entrypoint.sh",
"Args": [
"resources/app/main.mjs",
"--port=30000",
"--headless",
"--noupdate",
"--dataPath=/data"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 4395,
"ExitCode": 0,
"Error": "",
"StartedAt": "2024-02-04T19:55:57.66182608Z",
"FinishedAt": "2024-02-04T19:49:05.964040495Z",
"Health": {
**"Status": "unhealthy",**
"FailingStreak": 16,
"Log": [
{
"Start": "2024-02-04T15:04:28.485001389-05:00",
"End": "2024-02-04T15:04:28.52147859-05:00",
"ExitCode": 1,
"Output": ""
},
{
"Start": "2024-02-04T15:04:58.531513334-05:00",
"End": "2024-02-04T15:04:58.581211192-05:00",
"ExitCode": 1,
"Output": ""
},
{
"Start": "2024-02-04T15:05:28.590011407-05:00",
"End": "2024-02-04T15:05:28.634376391-05:00",
"ExitCode": 1,
"Output": ""
},
{
"Start": "2024-02-04T15:05:58.642992165-05:00",
"End": "2024-02-04T15:05:58.678409309-05:00",
"ExitCode": 1,
"Output": ""
},
{
"Start": "2024-02-04T15:06:28.689170661-05:00",
"End": "2024-02-04T15:06:28.725521568-05:00",
"ExitCode": 1,
"Output": ""
}
]
}
Removing the Certificate and Key, which reverts the internal web server to non-SSL mode, resolves the issue.
Steps to reproduce
- Obtain certificate files (certificate and private key)
- Copy both files into the top level /Config folder
- Populate the Certificate and key fields with the appropriate values.
- Restart container.
Expected behavior
The container should report as 'healthy' once it has completed startup.
Container metadata
com.foundryvtt.version = "11.315"
net.unraid.docker.icon = "https://foundryvtt.com/static/assets/icons/default-avatar.jpg"
net.unraid.docker.managed = "dockerman"
net.unraid.docker.webui = "https://*****.******.***:30000"
org.opencontainers.image.authors = "[email protected]"
org.opencontainers.image.created = "2024-01-05T17:39:23.478Z"
org.opencontainers.image.description = "An easy-to-deploy Dockerized Foundry Virtual Tabletop server."
org.opencontainers.image.licenses = "MIT"
org.opencontainers.image.revision = "18981628b89a04fa780f9faa1657be17aeaeb9b1"
org.opencontainers.image.source = "https://github.com/felddy/foundryvtt-docker"
org.opencontainers.image.title = "foundryvtt-docker"
org.opencontainers.image.url = "https://github.com/felddy/foundryvtt-docker"
org.opencontainers.image.vendor = "Geekpad"
org.opencontainers.image.version = "11.315.1"
Relevant log output
FoundryVTT | 2024-02-05 21:54:33 | [info] Software license verification succeeded
FoundryVTT | 2024-02-05 21:54:33 | [info] Server started and listening on port 30000
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
How are you "populating the Certificate and Key fields"?
I suspect that you are not using the environment variables: FOUNDRY_SSL_CERT, and FOUNDRY_SSL_KEY, which are used by the health check script.
I was populating through the GUI and not via the container. Once added, docker marked as healthy. Thanks!