Skip to content

[Support]: container startup failure during init-db.sh聽#1026

Closed

Description

@alemonmk

馃摑 Inquiry

I'm running ZTNet in Nomad cluster and I cannot run any version after 0.8.0. Job definition are similar to docker-compose.yaml, only diff is that I have no volumes because it uses a remote database and manages a remote controller.

The container fails to start with these logs:

Creating .env file...
Applying migrations to the database...
npm notice run ztnet@0.1.0 npx
npm notice run 'prisma' migrate deploy
Error: Can't write to /usr/local/lib/node_modules/prisma/node_modules/@prisma/engines please make sure you install "prisma" with the right permissions.
An error occurred. Exiting...

If I take away user = "nextjs" so it should be root in container, it does not even run migration because it cannot create .env:

Creating .env file...
/app/init-db.sh: line 18: .env: Permission denied
An error occurred. Exiting...

Which is why I have that user designation since 0.7.0.

I have absolutely no idea how to make this work.

馃敄 Version

0.8.1+

馃敡 Deployment Type

  • Docker
  • Standalone

馃捇 Operating System

Other Linux

馃寪 Browser

Chrome

馃摎 Any Other Information That May Be Helpful

Nomad job definition:

job "zerotier-control-ui" {
  ...
  group "app" {
    ...
    task "ztnet" {
      driver = "docker"
      user   = "nextjs"

      config {
        image        = "sinamics/ztnet:0.8.4"
        work_dir     = "/app"
        cap_drop     = ["all"]
        ports        = ["http"]
        network_mode = "host"
      }

      template {
        data        = <<-EOT
        ...
        EOT
        destination = "${NOMAD_SECRETS_DIR}/env"
        env         = true
      }
      ...
    }
  }
}

Activity

  1. sinamics commented on Sep 24, 2026

    @sinamics
    Owner

    Since 0.8.1 the Prisma engine is missing from the image, so it gets downloaded at startup, which only works as root.
    Im not that into clusters, but try to run as root and remove the cap_drop = ["all"]. Does that makes any diffrence?

  2. alemonmk commented on Sep 24, 2026

    @alemonmk
    Author

    Since 0.8.1 the Prisma engine is missing from the image, so it gets downloaded at startup, which only works as root. Im not that into clusters, but try to run as root and remove the cap_drop = ["all"]. Does that makes any diffrence?

    Thanks, it runs after giving dac_override back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    supportsupport request for ZTNET

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions