# Os/exec Operation Not Permitted when beats is imported

**URL:** https://discuss.elastic.co/t/os-exec-operation-not-permitted-when-beats-is-imported/164006
**Category:** Beats
**Created:** [January 12, 2019, 7:37pm UTC](https://discuss.elastic.co/t/os-exec-operation-not-permitted-when-beats-is-imported/164006 "2019-01-12T19:37:19Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tehmoon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tehmoon/32/24892_2.png) [@tehmoon](https://discuss.elastic.co/u/tehmoon)
#### Post date: [January 12, 2019, 7:37pm UTC](https://discuss.elastic.co/t/os-exec-operation-not-permitted-when-beats-is-imported/164006/1 "2019-01-12T19:37:19Z")

</div>

Hi!

It looks like when importing os/exec and using it to spawn command, on linux amd64, it fails with an Operation not permitted.

This is a code sample [https://play.golang.com/p/kriZT9RpYlr](https://play.golang.com/p/kriZT9RpYlr) that you should be able to reproduce after loading the beater from main.  
I used a docker container on the `alpine` image after installing `musl-dev, git, go`

If I remove the import `github.com/elastic/beats/libbeats/beat` with the same `os/exec` it works. I suspect, there is a vendored library that is messing something.

The issue is located here:

```
[pid 27396] syscall_18446744073709551615(0xc000032160, 0xc00002e230, 0xc00045e0b0, 0, 0, 0) = -1 (errno 1)
[pid 27396] write(9, "\1\0\0\0\0\0\0\0", 8) = 8
[pid 27396] exit(253) = ?
[pid 27396] +++ exited with 253 +++

```

if I systrace it but I don't know how to dig further.

Let me know how I can help, I was trying to upgrade the `libbeat` for my `cmdlinebeat` project: [https://github.com/tehmoon/cmdlinebeat](https://github.com/tehmoon/cmdlinebeat)

Regards,

---

<div class="post-metadata">

### Author: ![tehmoon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tehmoon/32/24892_2.png) [@tehmoon](https://discuss.elastic.co/u/tehmoon)
#### Post date: [January 12, 2019, 7:41pm UTC](https://discuss.elastic.co/t/os-exec-operation-not-permitted-when-beats-is-imported/164006/2 "2019-01-12T19:41:11Z")

</div>

I did not see this post before posting: [Operation not permitted \<= New Beat](https://discuss.elastic.co/t/operation-not-permitted-new-beat/147459/2)

---

<div class="post-metadata">

### Author: ![tehmoon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tehmoon/32/24892_2.png) [@tehmoon](https://discuss.elastic.co/u/tehmoon)
#### Post date: [January 12, 2019, 7:42pm UTC](https://discuss.elastic.co/t/os-exec-operation-not-permitted-when-beats-is-imported/164006/3 "2019-01-12T19:42:55Z")

</div>

Well `-E seccomp.enabled=false` did it... I feel so bad, I've tried a lot of things and could not figure it out...

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [February 9, 2019, 9:42pm UTC](https://discuss.elastic.co/t/os-exec-operation-not-permitted-when-beats-is-imported/164006/4 "2019-02-09T21:42:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
