uldiseihenbergs / meshcentral-builds

An Docker image for MeshCentral 2. http://www.meshcommander.com/meshcentral2
Apache License 2.0
17 stars 7 forks source link

Error: ENOENT: no such file or directory, open '/home/node/meshcentral/meshcentral-data/meshcentral.db' #2

Closed Go2Engle closed 3 years ago

Go2Engle commented 3 years ago

Hopping you can assist! Im trying to get your container up and running using persistent volumes. When mapping the "/home/node/meshcentral/meshcentral-files" and "/home/node/meshcentral/meshcentral-data" folders to a volume I'm getting the below error. When running without volumes the container works fine. Please let me know if there is any other information you need.

Installing otplib@10.2.3...
ERR: /home/node/meshcentral/node_modules/nedb/lib/datastore.js:77
    if (err) { throw err; }
               ^
Error: ENOENT: no such file or directory, open '/home/node/meshcentral/meshcentral-data/meshcentral.db'
ERROR: Unable to write to mesherrors.txt.
{ Error: Command failed: /usr/local/bin/node /home/node/meshcentral/node_modules/meshcentral/meshcentral.js --launch 9
/home/node/meshcentral/node_modules/nedb/lib/datastore.js:77
    if (err) { throw err; }
               ^
Error: ENOENT: no such file or directory, open '/home/node/meshcentral/meshcentral-data/meshcentral.db'
    at ChildProcess.exithandler (child_process.js:275:12)
    at emitTwo (events.js:131:20)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
  killed: false,
  code: 1,
  signal: null,
  cmd: '/usr/local/bin/node /home/node/meshcentral/node_modules/meshcentral/meshcentral.js --launch 9' }
ERROR: MeshCentral failed with critical error, check MeshErrors.txt. Restarting in 5 seconds...

Also for context this is the compose file I'm using

version: "2"
services:
  remotely:
    container_name: meshcentral
    restart: unless-stopped
    image: uldiseihenbergs/meshcentral:latest
    ports:
      - 5080:80
      - 5443:443
    volumes:
      - mesh_files:/home/node/meshcentral/meshcentral-files:rw
      - mesh_data:/home/node/meshcentral/meshcentral-data:rw
uldiseihenbergs commented 3 years ago

Hi, it's a file permission error. meshcentral is running inside a container with user "node". you can:

Go2Engle commented 3 years ago

Awesome! so after the volumes were created I changed the _data directory of the volume to group and owner 1000. restarted the container and now its up and running! Thanks for that pointer!