# Errors with exec2 plugin

**URL:** <https://discuss.hashicorp.com/t/errors-with-exec2-plugin/69648>\
**Category:** Nomad\
**Tags:** nomad\
**Created:** [August 29, 2024, 9:47pm UTC](https://discuss.hashicorp.com/t/errors-with-exec2-plugin/69648 "2024-08-29T21:47:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsleeuw](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jsleeuw/32/42743_2.png) [@jsleeuw](https://discuss.hashicorp.com/u/jsleeuw)\
**Post date:** [August 29, 2024, 9:47pm UTC](https://discuss.hashicorp.com/t/errors-with-exec2-plugin/69648/1 "2024-08-29T21:47:17Z")

</div>

I’ve got the exec2 plugin installed and recognized as such on my client node, but job runs fail with a driver failure error.

I see this from `journalctl -u nomad.service`:

```auto
-client nomad[3586]: 2024-08-29T15:55:22.123-0400 [ERROR] agent.plugin_loader: error encountered while scanning stdout: plugin_dir=/opt/nomad/data/plugins error="read |0: file already closed"
Aug 29 15:55:32 nomad-client nomad[3586]: 2024-08-29T15:55:22.123-0400 [INFO] agent.plugin_loader: plugin process exited: plugin_dir=/opt/nomad/data/plugins plugin=/opt/nomad/data/plugins/nomad-driver-exec2 id=3595
Aug 29 15:55:32 nomad-client nomad[3586]: 2024-08-29T15:55:22.137-0400 [ERROR] agent.plugin_loader: error encountered while scanning stdout: plugin_dir=/opt/nomad/data/plugins error="read |0: file already closed"
Aug 29 15:55:32 nomad-client nomad[3586]: 2024-08-29T15:55:22.137-0400 [INFO] agent.plugin_loader: plugin process exited: plugin_dir=/opt/nomad/data/plugins plugin=/opt/nomad/data/plugins/nomad-driver-exec2 id=3601
Aug 29 15:55:32 nomad-client nomad[3586]: 2024-08-29T15:55:22.137-0400 [INFO] agent: detected plugin: name=docker type=driver plugin_version=0.1.0
Aug 29 15:55:32 nomad-client nomad[3586]: 2024-08-29T15:55:22.137-0400 [INFO] agent: detected plugin: name=exec2 type=driver plugin_version=v2.0.0

```

And the web UI for the client node is showing a number of these client events:

```auto
Aug 29, '24 17:40:06 -0400 Driver exec2 Healthy
Aug 29, '24 17:40:06 -0400 Driver exec2 failed to fingerprint driver

```

Is this an error with the install?

---

<div class="post-metadata">

**Author:** ![seth.hoenig](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/seth.hoenig/32/27213_2.png) [@seth.hoenig](https://discuss.hashicorp.com/u/seth.hoenig)\
**Post date:** [August 30, 2024, 2:53pm UTC](https://discuss.hashicorp.com/t/errors-with-exec2-plugin/69648/2 "2024-08-30T14:53:31Z")

</div>

Hi @jsleeuw! Not sure what’s going on given the limited information produced in the logs. Can you post more complete information about your system / environment? It’s easiest to debug things if we can reproduce them.

---

<div class="post-metadata">

**Author:** ![jsleeuw](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jsleeuw/32/42743_2.png) [@jsleeuw](https://discuss.hashicorp.com/u/jsleeuw)\
**Post date:** [August 30, 2024, 7:27pm UTC](https://discuss.hashicorp.com/t/errors-with-exec2-plugin/69648/3 "2024-08-30T19:27:05Z")

</div>

Thanks Seth, of course, let me provide that.

I’m setting up a local lab environment on my (Apple Silicon) Mac. I’ve used Multipass to provision nomad client and server vms running Ubuntu 24.04. Nomad version is 1.8.3, revision 63b636e5cbaca312cf6ea63e040f445f05f00478.

Here’s the client config:

```auto
data_dir = "/opt/nomad/data"
bind_addr = "0.0.0.0"
client {
  enabled = true
  servers = ["...."]
}
plugin "nomad-driver-exec2" {
  config {
    unveil_defaults = true
    unveil_paths = []
    unveil_by_task = true
  }
}

```

Here’s some output from `journalctl -u nomad`

Aug 30 15:20:24 nomad-client nomad[16476]: 2024-08-30T15:20:24.027-0400 [INFO] client.alloc\_runner.task\_runner: Task event: alloc\_id=b7ee0221-ca3e-8efa-3c01-08b7a9c471a6 task=example type=Received msg=“Task received by client” failed=false  
Aug 30 15:20:24 nomad-client nomad[16476]: 2024-08-30T15:20:24.040-0400 [INFO] client.alloc\_runner.task\_runner: Task event: alloc\_id=b7ee0221-ca3e-8efa-3c01-08b7a9c471a6 task=example type=“Task Setup” msg=“Building Task Directory” failed=false  
Aug 30 15:20:24 nomad-client nomad[16476]: 2024-08-30T15:20:24.258-0400 [ERROR] client.driver\_mgr: error encountered while scanning stdout: driver=exec2 error=“read |0: file already closed”  
Aug 30 15:20:24 nomad-client nomad[16476]: 2024-08-30T15:20:24.259-0400 [ERROR] client.driver\_mgr: plugin process exited: driver=exec2 plugin=/opt/nomad/data/plugins/nomad-driver-exec2 id=16567 error=“exit status 2”  
Aug 30 15:20:24 nomad-client nomad[16476]: 2024-08-30T15:20:24.259-0400 [WARN] client.driver\_mgr: failed to reattach to plugin, starting new instance: driver=exec2 error=“singleton plugin exited”  
Aug 30 15:20:24 nomad-client nomad[16476]: 2024-08-30T15:20:24.259-0400 [INFO] client.alloc\_runner.task\_runner: failed to start task because plugin shutdown unexpectedly; attempting to recover: alloc\_id=b7ee0221-ca3e-8efa-3c01-08b7a9c471a6 task=example  
Aug 30 15:20:24 nomad-client nomad[16476]: 2024-08-30T15:20:24.259-0400 [WARN] client.driver\_mgr: received fingerprint error from driver: driver=exec2 error=“plugin is shut down”  
Aug 30 15:20:24 nomad-client nomad[16476]: 2024-08-30T15:20:24.281-0400 [ERROR] client.driver\_mgr: plugin process exited: driver=exec2 plugin=/opt/nomad/data/plugins/nomad-driver-exec2 id=16714 error=“exit status 2”  
Aug 30 15:20:24 nomad-client nomad[16476]: 2024-08-30T15:20:24.282-0400 [WARN] client.driver\_mgr: received fingerprint error from driver: driver=exec2 error=“plugin is shut down”  
Aug 30 15:20:24 nomad-client nomad[16476]: 2024-08-30T15:20:24.282-0400 [WARN] client.driver\_mgr: failed to reattach to plugin, starting new instance: driver=exec2 error=“singleton plugin exited”  
Aug 30 15:20:24 nomad-client nomad[16476]: 2024-08-30T15:20:24.283-0400 [INFO] client.alloc\_runner.task\_runner: Task event: alloc\_id=b7ee0221-ca3e-8efa-3c01-08b7a9c471a6 task=example type=“Driver Failure” msg=“failed to start task after driver exited unexpectedly: plugin is shut down” failed=false  
Aug 30 15:20:24 nomad-client nomad[16476]: 2024-08-30T15:20:24.284-0400 [ERROR] client.alloc\_runner.task\_runner: running driver failed: alloc\_id=b7ee0221-ca3e-8efa-3c01-08b7a9c471a6 task=example error=“failed to start task after driver exited unexpectedly: plugin is shut down”  
Aug 30 15:20:24 nomad-client nomad[16476]: 2024-08-30T15:20:24.284-0400 [INFO] client.alloc\_runner.task\_runner: not restarting task: alloc\_id=b7ee0221-ca3e-8efa-3c01-08b7a9c471a6 task=example reason=“Error was unrecoverable”  
Aug 30 15:20:24 nomad-client nomad[16476]: 2024-08-30T15:20:24.284-0400 [INFO] client.alloc\_runner.task\_runner: Task event: alloc\_id=b7ee0221-ca3e-8efa-3c01-08b7a9c471a6 task=example type=“Not Restarting” msg=“Error was unrecoverable” failed=true  
Aug 30 15:20:28 nomad-client nomad[16476]: 2024-08-30T15:20:28.347-0400 [WARN] client.alloc\_runner.task\_runner.task\_hook.logmon.nomad: timed out waiting for read-side of process output pipe to close: alloc\_id=b7ee0221-ca3e-8efa-3c01-08b7a9c471a6 task=example @module=logmon timestamp=2024-08-30T15:20:28.342-0400  
Aug 30 15:20:28 nomad-client nomad[16476]: 2024-08-30T15:20:28.347-0400 [WARN] client.alloc\_runner.task\_runner.task\_hook.logmon.nomad: timed out waiting for read-side of process output pipe to close: alloc\_id=b7ee0221-ca3e-8efa-3c01-08b7a9c471a6 task=example @module=logmon timestamp=2024-08-30T15:20:28.346-0400  
Aug 30 15:20:28 nomad-client nomad[16476]: 2024-08-30T15:20:28.353-0400 [INFO] client.alloc\_runner.task\_runner.task\_hook.logmon: plugin process exited: alloc\_id=b7ee0221-ca3e-8efa-3c01-08b7a9c471a6 task=example plugin=/usr/bin/nomad id=16704  
Aug 30 15:20:28 nomad-client nomad[16476]: 2024-08-30T15:20:28.355-0400 [INFO] client.gc: marking allocation for GC: alloc\_id=b7ee0221-ca3e-8efa-3c01-08b7a9c471a6  
Aug 30 15:20:28 nomad-client nomad[16476]: 2024-08-30T15:20:28.561-0400 [INFO] client.alloc\_runner.task\_runner: Task event: alloc\_id=e34952d2-b51a-4c43-6e2f-c1c40c38fd5a task=example type=Received msg=“Task received by client” failed=false  
Aug 30 15:20:28 nomad-client nomad[16476]: 2024-08-30T15:20:28.568-0400 [INFO] client.alloc\_runner.task\_runner: Task event: alloc\_id=e34952d2-b51a-4c43-6e2f-c1c40c38fd5a task=example type=“Task Setup” msg=“Building Task Directory” failed=false  
Aug 30 15:20:28 nomad-client nomad[16476]: 2024-08-30T15:20:28.697-0400 [ERROR] client.driver\_mgr: plugin process exited: driver=exec2 plugin=/opt/nomad/data/plugins/nomad-driver-exec2 id=16720 error=“exit status 2”  
Aug 30 15:20:28 nomad-client nomad[16476]: 2024-08-30T15:20:28.698-0400 [INFO] client.alloc\_runner.task\_runner: failed to start task because plugin shutdown unexpectedly; attempting to recover: alloc\_id=e34952d2-b51a-4c43-6e2f-c1c40c38fd5a task=example  
Aug 30 15:20:28 nomad-client nomad[16476]: 2024-08-30T15:20:28.698-0400 [WARN] client.driver\_mgr: failed to reattach to plugin, starting new instance: driver=exec2 error=“singleton plugin exited”  
Aug 30 15:20:28 nomad-client nomad[16476]: 2024-08-30T15:20:28.699-0400 [WARN] client.driver\_mgr: received fingerprint error from driver: driver=exec2 error=“plugin is shut down”  
Aug 30 15:20:28 nomad-client nomad[16476]: 2024-08-30T15:20:28.713-0400 [ERROR] client.driver\_mgr: plugin process exited: driver=exec2 plugin=/opt/nomad/data/plugins/nomad-driver-exec2 id=16735 error=“exit status 2”  
Aug 30 15:20:28 nomad-client nomad[16476]: 2024-08-30T15:20:28.713-0400 [WARN] client.driver\_mgr: failed to reattach to plugin, starting new instance: driver=exec2 error=“singleton plugin exited”
