Unable to access Trilium server after upgrading #10587
|
Hi all, greetings from Spain. I´ve been using Trilium for a while happily with the following set up:
The virtual server configuration in Nginx:
The config.ini file inside the trilium-data directory:
Everything was working fine including the synchronization between server and desktop but yesterday, before seeing the world football cup final (that, by the way, we won) I decided to try to upgrade the server to 0.104.0 and something seems to have gone wrong as I can no longer access the site. In order to do the upgrade I wrote
Then I get in the command line: No USER_UID specified, leaving 1000 TRILIUM NOTES/ 0.104.0 Versions: app=0.104.0 db=238 sync=39 clipper=1.0 MCP server registered at /mcp (localhost only) DB not initialized, please visit setup page - http://[your-server-host]:8080 Listening on port 8080 Of course I try to open https://trilium.:8080 but all I see is a blank page with the message "the site can not be accessed" (in Spanish). If I try the address https://trilium., without the port number, I get a white page where "502 bat gateway" can be read. It makes no diference if the container is running or not. The command line gets frozen waiting for something repeating the line "200 GET /api .." again and again. Finaly all I can do is to type "Ctrl + C" and stop the container. I haven't touched the Nginx configuration nor the config.ini file in the Trilium directory. I haven't lost any data and my desktop application is working ok, except, obviously, it now can't synchronize. In /var/log/nginx/trilium.https.error.log there are many lines like this one:
Now I'm stucked and I don't know if the problem comes from Nginx, Docker, Trilium or all at once. I guess it's something related to the connection between Nginx and the new container, it seems Nginx doesn't recognize the new instance. Thanks in advance for your help. |
Replies: 2 comments 2 replies
|
¡Enhorabuena por la victoria! 🇪🇸 Now let's get your server back up. There are several issues stacking up here: 1. Your Nginx config is missing location / {
proxy_pass http://trilium; # references your upstream block
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}It's possible this was working before on an older Nginx config that you didn't paste in full, or that it got lost during editing — but it's definitely missing now. 2. The default port changed from environment:
- TRILIUM_NETWORK_PORT=80803. "DB not initialized" + "DB size: 4 KiB" means the container isn't seeing your data. You also ran both # Stop everything
docker stop $(docker ps -q)
# Verify your data is intact
ls ~/trilium-data/document.db # (adjust path to your actual data dir)
# Use ONLY docker-compose — edit your docker-compose.yml to ensure the volume is correct:
# volumes:
# - /your/actual/path/trilium-data:/home/node/trilium-data
docker compose up -d4. Set [Network]
trustedReverseProxy=trueOr via environment variable: In summary, the fix is: (1) stop all containers, (2) make sure To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
|
SOLVED Thanks Elian for your fast answer. Finaly I could make the server accesible. Instead of using the command
to start the container I used the command
It can be found in the documentation but not in the section about "Running with Docker Compose" (the steps I followed) but in the section about Running without Docker Compose (if the installation is intended for global access). That got me confussed. I'm not an expert on using Docker so I can't say how is this working despite having the "docker-compose.yml" file. I haven't edited any configuration file (nor Docker nor Nginx) so I'm using the same ports. I upgraded my desktop program too -easily, just download, unzip and launch the executable file- as the database schema has been changed and now both installations are working together smoothly. I've made some simple tests (synchronization, notes creation, notes edition, mobile view on my Android phone, etc) and everything seems to be fine. |
SOLVED
Thanks Elian for your fast answer.
Finaly I could make the server accesible. Instead of using the command
to start the container I used the command
It can be found in the documentation but not in the section about "Running with Docker Compose" (the steps I followed) but in the section about Running without Docker Compose (if the installation is intended for global access). That got me confussed. I'm not an expert on using Docker so I can't say how is this working despite having the "docker-compose.yml" file.
I haven't edited any configuration file…