I have created a brand new cluster in linux and all the agents and servers are communicating well and showing their status in UI as well . Consul is also running fine . However when I submit a job I get the following errors.
Please note I am running as ROOT so there should not be any permission issue as such .
> 023-02-26T18:32:46.349-0500 [ERROR] client.alloc_runner.task_runner: prestart failed: alloc_id=6a633002-88b2-3f74-f8f1-ae13592072fd task=web error="prestart hook \"task_dir\" failed: mount: operation not permitted"
> 2023-02-26T18:32:46.349-0500 [INFO] client.alloc_runner.task_runner: not restarting task: alloc_id=6a633002-88b2-3f74-f8f1-ae13592072fd task=web reason="Error was unrecoverable"
> 2023-02-26T18:32:46.414-0500 [INFO] client.gc: marking allocation for GC: alloc_id=6a633002-88b2-3f74-f8f1-ae13592072fd
I have tried diff kind of jobs including Java and simple shell script or just sleep command like here and they all give same errors
job "test" {
datacenters = ["dc1"]
group "group1" {
task "sleep" {
driver = "raw_exec"
config {
command = "sleep"
args = ["infinity"]
}
resources {
cpu = 10
memory = 10
}
}
}
}
When I look at “nomad alloc status 831f9a6b” it shows the following
ID = 831f9a6b-61ba-9c5a-8b5e-b8d9a172c61f
Eval ID = a10d4f4d
Name = test.group1[0]
Node ID = 15ceea08
Node Name = <redacted>
Job ID = test
Job Version = 6
Client Status = failed
Client Description = Failed tasks
Desired Status = run
Desired Description = <none>
Created = 1m28s ago
Modified = 1m27s ago
Deployment ID = 6b2df708
Deployment Health = unhealthy
Reschedule Eligibility = 32s from now
Task "sleep" is "dead"
Task Resources
CPU Memory Disk Addresses
10 MHz 10 MiB 300 MiB
Task Events:
Started At = N/A
Finished At = 2023-02-26T23:56:34Z
Total Restarts = 0
Last Restart = N/A
Recent Events:
Time Type Description
2023-02-26T18:56:34-05:00 Not Restarting Error was unrecoverable
2023-02-26T18:56:34-05:00 Task hook failed task_dir: mount: operation not permitted
2023-02-26T18:56:34-05:00 Task Setup Building Task Directory
2023-02-26T18:56:34-05:00 Received Task received by client