-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Bug report) v0.90.4 docker does not read USER_UID and USER_GID from environment #331
Comments
@yu-jingrui , thank you for the detailed report. I believe this got broken when we switched from I've pushed a fix to If not, you could always fall back to an older version and move to the next stable release, which I think will only come in a few weeks (we'll release some betas for internationalization first). |
I tried develop and it seems to be working correctly. Thanks for the quick fix. I will wait for the next stable release and use 0.90.3 for the moment. |
TriliumNext Version What operating system are you using? Yes, I encountered the same error as well. I haven't attempted your fix on the # https://github.com/TriliumNext/Notes
# Running `docker-compose up` will create/use the "trilium-data" directory in the user home
# Run `TRILIUM_DATA_DIR=/path/of/your/choice docker-compose up` to set a different directory
# To run in the background, use `docker-compose up -d`
services:
trilium:
# Optionally, replace `latest` with a version tag like `v0.90.3`
# Using `latest` may cause unintended updates to the container
image: triliumnext/notes:v0.90.4
container_name: triliumnext-notes
# Restart the container unless it was stopped by the user
restart: unless-stopped
environment:
TRILIUM_DATA_DIR: ${TRILIUM_DATA_DIR}
USER_UID: ${USER_UID}
USER_GID: ${USER_GID}
ports:
# By default, Trilium will be available at http://localhost:8080
# It will also be accessible at http://<host-ip>:8080
# You might want to limit this with something like Docker Networks, reverse proxies, or firewall rules, such as UFW
- '9991:8080'
networks:
- proxy
volumes:
# Unless TRILIUM_DATA_DIR is set, the data will be stored in the "trilium-data" directory in the home directory.
# This can also be changed with by replacing the line below with `- /path/of/your/choice:/home/node/trilium-data
- ${TRILIUM_DATA_DIR:-~/trilium-data}:/home/node/trilium-data
networks:
proxy:
external: true No USER_UID specified, leaving 1000
No USER_GID specified, leaving 1000
./start-docker.sh: 3: [[: not found
./start-docker.sh: 4: [[: not found
(node:9) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
node:fs:1372
const result = binding.mkdir(
^
Error: ENOENT: no such file or directory, mkdir '/home/mrcl/Adocker/Project-TEST/August_2024/TriliumNext/my-data/'
at Object.mkdirSync (node:fs:1372:26)
at getTriliumDataDir (file:///usr/src/app/src/services/data_dir.js:33:16)
at file:///usr/src/app/src/services/data_dir.js:47:26
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) {
errno: -2,
code: 'ENOENT',
syscall: 'mkdir',
path: '/home/mrcl/Adocker/Project-TEST/August_2024/TriliumNext/my-data/'
} EDIT with One thing I don't understand, if I set However if I comment-out the
Everything works perfectly clear!! |
This bug still exists; I'm using triliumnext/notes:latest as of today (2024-12-30) |
@PDiracDelta , could you please provide more info? Is it the same issue as the OP, or is it something slightly different? |
Indeed it's a bit different. To clarify, I'm talking about the issue mentioned below, from OP's last reply. Should I make a different ticket? ... if I set TRILIUM_DATA_DIR (and I checked it before running docker compose with docker compose config that everything will be on their right places) - the container FAILED with the above error. However if I comment-out the TRILIUM_DATA_DIR and set the volumes directly ... Everything works perfectly clear!! |
TriliumNext Version
0.90.4
What operating system are you using?
Windows
What is your setup?
Local + server sync
Operating System Version
windows 11
Description
Docker server is deployed on synology DS920+ with container manager. After updating to 0.90.4 from 0.94.3, the docker instance shuts down with error code -13. It keeps setting uid and gid to 1000 although they are specified in environment. Here is the compose file:
Error logs
2024/8/11 16:09 stderr Node.js v20.15.1
2024/8/11 16:09 stderr
2024/8/11 16:09 stderr }
2024/8/11 16:09 stderr path: '/home/node/trilium-data/log'
2024/8/11 16:09 stderr " syscall: 'mkdir',"
2024/8/11 16:09 stderr " code: 'EACCES',"
2024/8/11 16:09 stderr " errno: -13,"
2024/8/11 16:09 stderr at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5) {
2024/8/11 16:09 stderr at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
2024/8/11 16:09 stderr at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
2024/8/11 16:09 stderr at file:///usr/src/app/src/services/log.js:6:8
2024/8/11 16:09 stderr at Object.mkdirSync (node:fs:1372:26)
2024/8/11 16:09 stderr "Error: EACCES: permission denied, mkdir '/home/node/trilium-data/log'"
2024/8/11 16:09 stderr
2024/8/11 16:09 stderr ^
2024/8/11 16:09 stderr const result = binding.mkdir(
2024/8/11 16:09 stderr node:fs:1372
2024/8/11 16:09 stderr (Use
node --trace-warnings ...
to show where the warning was created)2024/8/11 16:09 stderr (node:9) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
2024/8/11 16:09 stdout "No USER_GID specified, leaving 1000"
2024/8/11 16:09 stdout "No USER_UID specified, leaving 1000"
2024/8/11 16:09 stderr ./start-docker.sh: 4: [[: not found
2024/8/11 16:09 stderr ./start-docker.sh: 3: [[: not found
2024/8/11 16:09 stderr Node.js v20.15.1
2024/8/11 16:09 stderr
2024/8/11 16:09 stderr }
2024/8/11 16:09 stderr path: '/home/node/trilium-data/log'
2024/8/11 16:09 stderr " syscall: 'mkdir',"
2024/8/11 16:09 stderr " code: 'EACCES',"
2024/8/11 16:09 stderr " errno: -13,"
2024/8/11 16:09 stderr at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5) {
2024/8/11 16:09 stderr at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
2024/8/11 16:09 stderr at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
2024/8/11 16:09 stderr at file:///usr/src/app/src/services/log.js:6:8
2024/8/11 16:09 stderr at Object.mkdirSync (node:fs:1372:26)
2024/8/11 16:09 stderr "Error: EACCES: permission denied, mkdir '/home/node/trilium-data/log'"
2024/8/11 16:09 stderr
2024/8/11 16:09 stderr ^
2024/8/11 16:09 stderr const result = binding.mkdir(
2024/8/11 16:09 stderr node:fs:1372
2024/8/11 16:09 stderr (Use
node --trace-warnings ...
to show where the warning was created)2024/8/11 16:09 stderr (node:9) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
2024/8/11 16:09 stdout "No USER_GID specified, leaving 1000"
2024/8/11 16:09 stdout "No USER_UID specified, leaving 1000"
2024/8/11 16:09 stderr ./start-docker.sh: 4: [[: not found
2024/8/11 16:09 stderr ./start-docker.sh: 3: [[: not found
The text was updated successfully, but these errors were encountered: