Permission error with template stanza

I’m getting this error:

WARNING: This is a setup for development purposes only; in this mode your clusters may run unrealistically fast and data can be corrupted any time your computer shuts down uncleanly.
Error: unable to chown temp config file: chown /local/redpanda-3658880638524208918: operation not permitted, temp file removed from disk

It is related to this artifact + template. When I remove the template stanza things work.

  artifact {
    source = "https://gist.githubusercontent.com/c4milo/15e35f49e34d84bc6e1918e02b70baab/raw/fa3ecc72acd31852989fb0a7f7bd02cf207c8ddb/redpanda.yml.tpl"
  }

  template {
    source      = "local/redpanda.yml.tpl"
    destination = "local/redpanda.yml"
  }

Nomad 1.6.1

Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy

Full job here:

Agent was run like this:
sudo nomad agent -dev -bind=0.0.0.0 -network-interface=eth0 > ~/nomad_log 2>&1 &

Don’t run Nomad as root. What happens when you remove sudo?

Without sudo I get " * Constraint “missing drivers”: 1 nodes excluded by filter"

You have some permissions issue with your docker install. I don’t think the symlink was created. Check out this blurb:

Nomad uses a socket file to communicate with Docker and by default, this file is /var/run/docker.sock on Linux, Mac, and other Unix platforms, and /./pipe/docker_engine on Windows. Docker Desktop creates a symlink to this socket during installation.

If the Nomad client fails to detect the Docker driver with the error Constraint "missing drivers": 1 nodes excluded by filter, the issue may be this missing symlink. Additional information about this symlink for Mac and Windows is available.

More info here:

I’ve set up docker such that unprivileged users (including the one nomad is running under) can execute containers. I even gave global r/w access to the socket just to be sure. I restarted the nomad agent and I get the same error when it’s not root.