# Freeipmi.plugin - internal system error

**URL:** <https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145>\
**Category:** Help\
**Tags:** agent\
**Created:** [April 6, 2021, 5:05pm UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145 "2021-04-06T17:05:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/alex/32/618_2.png) [@Alex](https://community.netdata.cloud/u/Alex)\
**Post date:** [April 6, 2021, 5:05pm UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/1 "2021-04-06T17:05:42Z")

</div>

Hi,

I need help. In my Centos7 the freeipmi don’t work because this error:

- freeipmi.plugin ERROR : MAIN : ipmi\_monitoring\_sensor\_readings\_by\_record\_id(): internal system error (errno 9, Bad file descriptor)
- freeipmi.plugin FATAL : freeipmi.plugin : freeipmi.plugin: data collection failed. # : Success

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/netdata2/original/1X/64eff0d582a92fcb95180cc72da359d532f3a96c.png)

Does anyone know how to solve?

---

<div class="post-metadata">

**Author:** ![vlvkobal](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/vlvkobal/32/219_2.png) [@vlvkobal](https://community.netdata.cloud/u/vlvkobal)\
**Post date:** [April 8, 2021, 8:55am UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/2 "2021-04-08T08:55:54Z")

</div>

@Saruspete any thoughts?

---

<div class="post-metadata">

**Author:** ![Saruspete](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/saruspete/32/549_2.png) [@Saruspete](https://community.netdata.cloud/u/Saruspete)\
**Post date:** [April 8, 2021, 10:16am UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/3 "2021-04-08T10:16:50Z")

</div>

The issue seems to come from freeipmi. “internal system error” message maps to `libipmimonitoring/ipmi_monitoring.c :: ipmi_monitoring_errmsgs`

The “errno 9, Bad file descriptor” looks like a syscall that failed, most likely due to a hardware specific implementation issue.

To get more details without recompiling freeipmi in debug, strace should help to get the culprit. @Alex can you run the following command, and post the (lengthy) result (as a file or a gist-like if possible)

```auto
sudo strace -fyy -s 1024 ./freeipmi.plugin

```

---

<div class="post-metadata">

**Author:** ![Alex](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/alex/32/618_2.png) [@Alex](https://community.netdata.cloud/u/Alex)\
**Post date:** [April 8, 2021, 1:48pm UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/4 "2021-04-08T13:48:13Z")

</div>

Hi @Saruspete ,

On the server in question I can debug freeipmi smoothly and run. ERROR only gives when running Netdata daemon.

In debug mode, that’s ok:

- sudo strace -fyy -s 1024 ./freeipmi.plugin:  
[https://www.mediafire.com/file/gu3xbsyqgn218dn/freeipmi\_debug.txt/file](https://www.mediafire.com/file/gu3xbsyqgn218dn/freeipmi_debug.txt/file)

- /opt/netdata/netdata-plugins/plugins.d/freeipmi.plugin 5 debug  

- /opt/netdata/netdata-plugins/plugins.d/freeipmi.plugin 5

---

<div class="post-metadata">

**Author:** ![Saruspete](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/saruspete/32/549_2.png) [@Saruspete](https://community.netdata.cloud/u/Saruspete)\
**Post date:** [April 8, 2021, 2:00pm UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/5 "2021-04-08T14:00:03Z")

</div>

Ok, so it’s working as expected when you’re running it with an interactive user, but not when running as a service, is that correct ?

If you’re running the daemon netdata in foreground ( `sbin/netdata -D`) as the target user, does it also fails with the errror ?  
I suspect it’s due to the sandboxing from systemd service definition.

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [April 8, 2021, 2:33pm UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/6 "2021-04-08T14:33:54Z")

</div>

> it’s working as expected when you’re running it with an interactive user, but not when running as a service

If it is due to CapabilityBoundingSet restrictions, i would try to reset it and see if it helps.

```auto
# as root
mkdir /etc/systemd/system/netdata.service.d
echo -e '[Service]\nCapabilityBoundingSet=~' | tee /etc/systemd/system/netdata.service.d/unset-capability-bounding-set.conf
systemctl daemon-reload
systemctl restart netdata.service

```

---

<div class="post-metadata">

**Author:** ![Alex](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/alex/32/618_2.png) [@Alex](https://community.netdata.cloud/u/Alex)\
**Post date:** [April 8, 2021, 3:25pm UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/7 "2021-04-08T15:25:18Z")

</div>

I’m running the netdata daemon in the foreground and it doesn’t give an error, but it stays here:

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/netdata2/original/1X/a214b61252e17691b19c91d0e480f75e03690893.png)

---

<div class="post-metadata">

**Author:** ![Saruspete](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/saruspete/32/549_2.png) [@Saruspete](https://community.netdata.cloud/u/Saruspete)\
**Post date:** [April 8, 2021, 4:05pm UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/8 "2021-04-08T16:05:36Z")

</div>

it doesn’t send a lot of output in stdout, as soon as the logfiles are created all logging goes there.  
So you should be able to connect to the interface and see if IPMI is displayed.

can you please test what @ilyam8 proposed ? It’s a clean override for systemd definition of the service.

---

<div class="post-metadata">

**Author:** ![Alex](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/alex/32/618_2.png) [@Alex](https://community.netdata.cloud/u/Alex)\
**Post date:** [April 8, 2021, 5:17pm UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/9 "2021-04-08T17:17:02Z")

</div>

Thanks, the @ilyam8 solution worked.

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/netdata2/original/1X/523fa4dc17dfa2fb736d18f37ef3f9645be80fd6.png)

---

<div class="post-metadata">

**Author:** ![Alex](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/alex/32/618_2.png) [@Alex](https://community.netdata.cloud/u/Alex)\
**Post date:** [April 9, 2021, 11:25am UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/10 "2021-04-09T11:25:45Z")

</div>

@ilyam8 and @Saruspete  
After all it only worked on some servers … not on all!  
Some servers continue with the same error.

---

<div class="post-metadata">

**Author:** ![Saruspete](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/saruspete/32/549_2.png) [@Saruspete](https://community.netdata.cloud/u/Saruspete)\
**Post date:** [April 9, 2021, 1:03pm UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/11 "2021-04-09T13:03:29Z")

</div>

can you check the override file is correctly used by systemd, with `systemctl cat netdata.service` ?

---

<div class="post-metadata">

**Author:** ![Alex](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/alex/32/618_2.png) [@Alex](https://community.netdata.cloud/u/Alex)\
**Post date:** [April 9, 2021, 1:42pm UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/12 "2021-04-09T13:42:21Z")

</div>

yes, file is correctly used.

#/etc/systemd/system/netdata.service.d/startup.conf  
[Unit]  
Wants=fscrypt.service  
After=  
After=fscrypt.service  
#/etc/systemd/system/netdata.service.d/unset-capability-bounding-set.conf  
[Service]  
CapabilityBoundingSet=~

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [April 9, 2021, 8:05pm UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/13 "2021-04-09T20:05:07Z")

</div>

@Alex same symptoms? Works when running in the debug mode and doesn’t work when running as a service?

---

<div class="post-metadata">

**Author:** ![Alex](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/alex/32/618_2.png) [@Alex](https://community.netdata.cloud/u/Alex)\
**Post date:** [April 12, 2021, 8:26am UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/14 "2021-04-12T08:26:31Z")

</div>

yes @ilyam8 , exactly the same symptoms.  
On the servers that were ok, I changed the CapabilityBoundingSet again, and instead of CapabilityBoundingSet = ~, just be CapabilityBoundingSet = CAP\_SYS\_RAWIO

In those that do not work I let it stay the same CapabilityBoundingSet = ~

---

<div class="post-metadata">

**Author:** ![Alex](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/alex/32/618_2.png) [@Alex](https://community.netdata.cloud/u/Alex)\
**Post date:** [April 20, 2021, 8:54am UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/15 "2021-04-20T08:54:32Z")

</div>

Hi @ilyam8 and @Saruspete ,

I installed the megacli on all servers, and it does not work on servers where the ipmi is also having problems. It seems to me to be a situation common to both.  
Both are working well in debug mode, they just don’t work on the netdata daemon.  
Do you have any idea what may be causing this problem and how to solve it?

---

<div class="post-metadata">

**Author:** ![Saruspete](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/saruspete/32/549_2.png) [@Saruspete](https://community.netdata.cloud/u/Saruspete)\
**Post date:** [April 20, 2021, 1:30pm UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/16 "2021-04-20T13:30:06Z")

</div>

As it’s a CentOS7, is there any selinux enabled (`getenforce` ) ?

Note: is there a script that can do these checks / reporting currently, of did it stay as an idea ?

---

<div class="post-metadata">

**Author:** ![Alex](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/alex/32/618_2.png) [@Alex](https://community.netdata.cloud/u/Alex)\
**Post date:** [April 20, 2021, 2:48pm UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/17 "2021-04-20T14:48:15Z")

</div>

It is not a problem with selinux.  
All server configurations are the same (those that are and are not working).  
I even have a server on which the IPMI was working without giving such an error, and as soon as I put the new configurations to work also the MegaCli, it stopped working. And he started to make that mistake.

---

<div class="post-metadata">

**Author:** ![Saruspete](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/saruspete/32/549_2.png) [@Saruspete](https://community.netdata.cloud/u/Saruspete)\
**Post date:** [April 21, 2021, 12:27am UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/18 "2021-04-21T00:27:03Z")

</div>

Even if there’s low chance, still asking it: is there any way we could have access to the server ?  
Such symptoms seems to be environment related, and as such highly difficult to reproduce and fix.

Else, maybe check any limitation per-user, like cgroups, ulimits, etc… ? freeipmi & megacli both require privileges to read /dev/ipmi/0 and /dev/sd\*  
Maybe we can do a strace of the netdata daemon in the systemd service, but as both plugins require caps or setuid to work, if i reember well, tracing will cause them to lose these privileges, hence fail to work. Maybe we can also try running netdata as root (changing the systemd unit & netdata config)

```auto
[Service]
ExecStart=
ExecStart=/usr/bin/strace -fyytt -s 1024 -o /tmp/netdata.strace /home/netdata/usr/sbin/netdata -P /run/netdata/netdata.pid -D

```

Note: the empty `ExecStart` is required before.

---

<div class="post-metadata">

**Author:** ![Alex](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/alex/32/618_2.png) [@Alex](https://community.netdata.cloud/u/Alex)\
**Post date:** [April 21, 2021, 4:29pm UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/19 "2021-04-21T16:29:25Z")

</div>

Thanks @Saruspete for your time spent helping me.

But after all, the problem was with systemd. I updated the systemd and were soon giving the plugins.

---

<div class="post-metadata">

**Author:** ![AGI-chandler](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/agi-chandler/32/2541_2.png) [@AGI-chandler](https://community.netdata.cloud/u/AGI-chandler)\
**Post date:** [January 15, 2023, 10:46am UTC](https://community.netdata.cloud/t/freeipmi-plugin-internal-system-error/1145/20 "2023-01-15T10:46:36Z")

</div>

I had the same problem on Debian 11 and this resolved it.

Also `/usr/libexec/netdata/plugins.d/freeipmi.plugin` came with `root` group membership from the `netdata-plugin-freeipmi` package. Before I found the solution above, I was seeing the error `sh: 1: exec: /usr/libexec/netdata/plugins.d/freeipmi.plugin: Permission denied` (in `/var/log/netdata/error.log`). Since everything else in `/usr/libexec/netdata/plugins.d/` was in `netdata` group, I ran `chgrp netdata freeipmi.plugin` and that’s when I started seeing the new error messages in OP.
