TriliumNext / Notes

Build your personal knowledge base with TriliumNext Notes
https://triliumnext.github.io/Docs/
GNU Affero General Public License v3.0
1.04k stars 59 forks source link

Docker reporting container as not healthy #296

Closed eliandoran closed 3 months ago

eliandoran commented 3 months ago

Could be that the healthcheck script is broken. To investigate.

dariuszszyc commented 3 months ago

Same on my side, even though the logs don't mention any issues - only a successful migration. However I cannot see any Web UI and the desktop app cannot connect to the Server.

hulmgulm commented 3 months ago

That's the output form the health check:

file:///usr/src/app/docker_healthcheck.js:1 const http = require("http"); ^ ReferenceError: require is not defined in ES module scope, you can use import instead This file is being treated as an ES module because it has a '.js' file extension and '/usr/src/app/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension. at file:///usr/src/app/docker_healthcheck.js:1:14 at ModuleJob.run (node:internal/modules/esm/module_job:222:25) at async ModuleLoader.import (node:internal/modules/esm/loader:316:24) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5) Node.js v20.15.1

eliandoran commented 3 months ago

Same on my side, even though the logs don't mention any issues - only a successful migration. However I cannot see any Web UI and the desktop app cannot connect to the Server.

This sounds like a serious issue. Could you please try to take logs? Try restarting the container to have as much information as possible.

foux commented 3 months ago

Same issue on me, making it unavailable on Traefik

eliandoran commented 3 months ago

Same issue on me, making it unavailable on Traefik

@foux , is the container marked unhealthy, but is it working normally for you? Or are you having the same issue as @dariuszszyc who is unable to access the Trilium instance?

foux commented 3 months ago

The container is marked as unhealthy. If I expose the port, I can access Trillium on myhost:port. But the Traefik proxy doesn't work, because Traefik doesn't create proxy for unhealthy containers.

So my issue is really only the unhealthy container. Traefik not creatink the proxy is directly because of this.

eliandoran commented 3 months ago

@foux , thank you for the clarification. In this case, I'll prioritize fixing the healthcheck. I should have a fix available by the end of the day.

dariuszszyc commented 3 months ago

My case is also with Traefik, sorry for not mentioning this earlier.

eliandoran commented 3 months ago

@foux , @dariuszszyc ,

The issue should be solved now, please have a look at https://hub.docker.com/layers/triliumnext/notes/develop/images/sha256-2a88629322894d86e73011b454820ca2a04cb31bd00654855aa659f67a94cb69?context=explore and let me know if it works out for you.

I have taken the time to add a build step in the CI to check if the healthcheck passes to make sure we don't run into it again.

I will not deploy a new version yet with just this change, but expect a new release in a couple of days.

dariuszszyc commented 3 months ago

@eliandoran it did fix the issue for me. I can now access the Web version and the Desktop also can now sync with server.

eliandoran commented 3 months ago

@dariuszszyc , thank you for the very prompt response.

foux commented 3 months ago

Sorry for the late reply it's OK for me too on arm64, thanks! But it seems the image hasn't been pushed for amd64.

eliandoran commented 3 months ago

@foux , that was me trying to fix multiplatform builds. It's not finished yet and we should develop soon on all previously compatible platforms.