Skip to content
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) Check failed: module->status() == kLinked || module->status() == kEvaluated. #408

Closed
phamleduy04 opened this issue Sep 10, 2024 · 24 comments

Comments

@phamleduy04
Copy link

TriliumNext Version

0.90.4

What operating system are you using?

Other (specify below)

What is your setup?

Server access only

Operating System Version

Ubuntu 24.04 LTS

Description

I tried with latest tag and develop tag but always showing this error.

docker-compose file

# 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:sha-d7ab990
    # Restart the container unless it was stopped by the user
    restart: unless-stopped
    environment:
      - TRILIUM_DATA_DIR=/home/node/trilium-data
    # 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
      # - '8080:8080'
    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
      - nas:/home/node/trilium-data
    networks:
      - proxy

volumes:
  nas:
    driver: local
    driver_opts:
      type: cifs
      o: "username=,password=,vers=3.0,file_mode=0777,dir_mode=0777"
      device: "//IP_ADDRESS/notes"

networks:
  proxy:
    external: true

Error logs

$ sudo docker compose logs -f
trilium-1  | No USER_UID specified, leaving 1000
trilium-1  | No USER_GID specified, leaving 1000
trilium-1  | (node:9) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
trilium-1  | (Use `node --trace-warnings ...` to show where the warning was created)
trilium-1  |
trilium-1  |
trilium-1  | #
trilium-1  | # Fatal error in , line 0
trilium-1  | # Check failed: module->status() == kLinked || module->status() == kEvaluated.
trilium-1  | #
trilium-1  | #
trilium-1  | #
trilium-1  | #FailureMessage Object: 0x7ffffa582060
trilium-1  | ----- Native stack trace -----
trilium-1  |
trilium-1  |  1: 0xd36951  [node]
trilium-1  |  2: 0x216c041 V8_Fatal(char const*, ...) [node]
trilium-1  |  3: 0x13fe852 v8::internal::SourceTextModule::Evaluate(v8::internal::Isolate*, v8::internal::Handle<v8::internal::SourceTextModule>) [node]
trilium-1  |  4: 0xf0fafa v8::Module::Evaluate(v8::Local<v8::Context>) [node]
trilium-1  |  5: 0xc6811b node::loader::ModuleWrap::Evaluate(v8::FunctionCallbackInfo<v8::Value> const&) [node]
trilium-1  |  6: 0xf562bf v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [node]
trilium-1  |  7: 0xf56b2d  [node]
trilium-1  |  8: 0xf56ff5 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
trilium-1  |  9: 0x1961df6  [node]
trilium-1  | Trace/breakpoint trap (core dumped)
trilium-1 exited with code 0
@eliandoran
Copy link
Contributor

eliandoran commented Sep 10, 2024

@phamleduy04 , is the server on a Raspberry Pi? If so, what version?
We had this issue before but we thought we fixed it.

cc. @perfectra1n

@phamleduy04
Copy link
Author

phamleduy04 commented Sep 10, 2024

Hi, I currently using Intel CPU (Xeon X5660) not on Pi. I using Proxmox VE as OS and created a Ubuntu VM inside it if it helps. Thanks

@eliandoran
Copy link
Contributor

@phamleduy04 , thank you for the clarification.

I'm not able to reproduce the issue on my side but it appears to be an issue with V8 (Node JS runtime engine), see https://issues.chromium.org/issues/361611791 for reference.

Please note that you are currently testing the nightly/unstable build. I would recommend trying the latest beta build (v0.90.6-beta) but also the latest stable build (v0.90.4).

@phamleduy04
Copy link
Author

I have tried v0.90.6-beta and v0.90.4 tag. Both get same issue. This is v0.90.4 log

trilium-1  | No USER_UID specified, leaving 1000
trilium-1  | No USER_GID specified, leaving 1000
trilium-1  | ./start-docker.sh: 3: [[: not found
trilium-1  | ./start-docker.sh: 4: [[: not found
trilium-1  | (node:9) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
trilium-1  | (Use `node --trace-warnings ...` to show where the warning was created)
trilium-1  |
trilium-1  |
trilium-1  | #
trilium-1  | # Fatal error in , line 0
trilium-1  | # Check failed: module->status() == kLinked || module->status() == kEvaluated.
trilium-1  | #
trilium-1  | #
trilium-1  | #

@eliandoran
Copy link
Contributor

@phamleduy04 , thank you for trying.

I was suspecting it might have been caused by our internationalization efforts but it couldn't have affected the server on such an old version.

I think it might be caused by our switch from Node 16 to Node 20. I think I'm going to give it a try to update to Node 22 to see if it fixes the issue for you.

It could also be that there is some kind of incompatibility with your architecture, since the CPU is from 2010 (maybe missing instruction set?).

@phamleduy04
Copy link
Author

I also think that too, the CPU is missing the AVX instruction since mine can't run MongoDB 5.0, I will try running this on a newer CPU to see. Thanks

@phamleduy04
Copy link
Author

Hi, I have tried to use another Proxmox VE host that use the newer CPU (Ryzen 7 3700X). The error still there with v0.90.4 tag

@eliandoran
Copy link
Contributor

@phamleduy04 , if you try to run the server directly in a virtual machine or container, is it the same issue? See the releases section for the tarball.

@phamleduy04
Copy link
Author

phamleduy04 commented Sep 10, 2024

Hi, both my servers working using version 0.90.4

$ ./trilium.sh
(node:40028) 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)
Generated session secret
DB not initialized, please visit setup page - http://[your-server-host]:8080 to see instructions on how to initialize Trilium.
DB size: 4 KB
{
  "appVersion": "0.90.4",
  "dbVersion": 228,
  "nodeVersion": "v20.15.1",
  "syncVersion": 32,
  "buildDate": "2024-08-09T22:05:59Z",
  "buildRevision": "2a5c444eff3eb99389339716ea8bfc989be90ecd",
  "dataDirectory": "/home/<username>/.local/share/trilium-data",
  "clipperProtocolVersion": "1.0",
  "utcDateTime": "2024-09-10T18:18:34.023Z"
}
CPU model: QEMU Virtual CPU version 2.5+, logical cores: 2 freq: 0 Mhz
Trusted reverse proxy: false
App HTTP server starting up at port 8080
Listening on port 8080

@phamleduy04
Copy link
Author

So what is the issue here?

Ryzen 7 3700x

Distributor ID:	Ubuntu
Description:	Ubuntu 24.04.1 LTS
Release:	24.04
Codename:	noble
Docker version 27.2.1, build 9e34c9b

Intel Xeon X5660

Distributor ID:	Ubuntu
Description:	Ubuntu 24.04 LTS
Release:	24.04
Codename:	noble
Docker version 26.1.3, build b72abbb

@perfectra1n
Copy link

perfectra1n commented Sep 10, 2024

I have nearly the same setup as you @phamleduy04, but with 2699v3 CPUs on my Proxmox machine. I haven't been able to reproduce it just yet. Does the issue also happen when running the container directly, without compose?

docker run -v /root/localfolder:/home/node/trilium-data -p 8080:8080 triliumnext/notes:v0.90.6-beta

@phamleduy04
Copy link
Author

It did work. The problem is I'm trying to mount using smb. Switch to nfs fix the issue. Thanks for for your help!

@perfectra1n
Copy link

Interesting, I wonder what driver docker compose uses to mount SMB. I tested what would happen if the container isn't able to write to the /home/node/trilium-data folder and it returns:

 >  docker run -v /root/dne/test2:/home/node/trilium-data -p 8080:8080 triliumnext/notes:v0.90.6-beta
No USER_UID specified, leaving 1000
No USER_GID specified, leaving 1000
(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: EACCES: permission denied, mkdir '/home/node/trilium-data/log'
    at Object.mkdirSync (node:fs:1372:26)
    at file:///usr/src/app/src/services/log.js:6:8
    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: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/home/node/trilium-data/log'
}

Node.js v20.15.1

So something weird must be happening when Node tries to write to a file over SMB, provided by the docker compose driver...I have SMB already running in my environment, I'll give it a try to see if I can reproduce :)

@phamleduy04
Copy link
Author

i got that issue before. I use truenas so I just edit ACL to include the username as full control and the error went away

@doobes
Copy link

doobes commented Sep 11, 2024

or not

Mount the Docker volume:

sudo docker volume create --driver local
-o type=nfs
-o o=addr="192.168.10.10,rw,nfsvers=4"
-o device=:/volume1/trilium
nfs-trilium

Create/run the image:

sudo docker run -t -i -p 127.0.0.1:8080:8080 -v nfs-trilium:/home/node/trilium-data triliumnext/notes:v0.90.6-beta

docker: Error response from daemon: error while mounting volume '/var/lib/docker/volumes/nfs-trilium/_data': failed to mount local volume: mount :/volume1/trilium:/var/lib/docker/volumes/nfs-trilium/_data, data: addr=192.168.10.10,nfsvers=4: protocol not supported.

I've got my NFS permissions set to accept connections from 172.18.0.0/24.

Trouble is, I don't know exactly what ip address Docker is creating. I "think" it's 172.18.0.2.

This is the issue with NFS mounts.

Can we please fix the CIFS issue?

@phamleduy04
Copy link
Author

phamleduy04 commented Sep 11, 2024

@doobes, can you mount the nfs share from outside (without docker)?

FYI I'm not sure the command is 100% correct.

might need to create a folder first

sudo mkdir -p /mnt/trilium

add this to your /etc/fstab file

192.168.10.10:/volume1/trilium	/mnt/trilium nfs rw,bg,soft,intr,nosuid 0 0

restart the machine to get this to work. If you don't want to restart you have to use the mount command

sudo mount 192.168.10.10:/volume1/trilium /mnt/trilium

then run the container

sudo docker run -t -i -p 127.0.0.1:8080:8080 -v /mnt/trilium:/home/node/trilium-data triliumnext/notes:v0.90.6-beta

@doobes
Copy link

doobes commented Sep 11, 2024

Yep,

Share is mounted.

I changed the fstab to your version. Did a umount and then a mount -a

pi@trilium:~ $ sudo docker run -t -i -p 127.0.0.0:8080:8080 -v /mnt/trilium:/home/node/trilium-data triliumnext/notes:v0.90.6-beta
No USER_UID specified, leaving 1000
No USER_GID specified, leaving 1000
(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: EACCES: permission denied, mkdir '/home/node/trilium-data/log'
at Object.mkdirSync (node:fs:1372:26)
at file:///usr/src/app/src/services/log.js:6:8
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: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/home/node/trilium-data/log'
}

Node.js v20.15.1

@perfectra1n
Copy link

That error shows that the folder that was mounted to /home/node/trilium-data is not writeable by UID:GID 1000:1000.

@doobes
Copy link

doobes commented Sep 11, 2024

So......

What's the resolution?

@perfectra1n
Copy link

To allow the user with ID 1000, and group ID 1000 permissions to write to that folder. I'm not sure what permissions you have set on the folder, on the server that's sharing the NFS folder. So you'd want to make sure that UID:GID 1000 can write to it :)

@doobes
Copy link

doobes commented Sep 11, 2024

Here are my options in the Synology DSM:

image

I've tried all the mappings, doesn't make any difference.

@perfectra1n
Copy link

Can we please fix the CIFS issue?

@doobes PRs are more than welcome :)

@doobes
Copy link

doobes commented Sep 11, 2024

Can we please fix the CIFS issue?

@doobes PRs are more than welcome :)

Evidently I am not worthy....

@perfectra1n
Copy link

#415

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants