node_exporter icon indicating copy to clipboard operation
node_exporter copied to clipboard

msg="error while sending encoded metrics: write tcp xxx.xxx.xxx.xxx:9100->xxx.xxx.xxx.xxx:44202: write: broken pipe\n" source="log.go:172"

Open pedroj84 opened this issue 8 years ago • 8 comments

Hi, I think we are facing some issues with node_exporter running in postgresql_node. That machine also runs different exporters:

  • prometheus-postgresql-adapter
  • postgres_exporter
  • node_exporter
  • postgresql db 10 including pg_prometheus and timescaledb

Host operating system: output of uname -a

ec2-user@XCPAMIDPS901 ~]$ uname -a Linux 3.10.0-862.3.2.el7.x86_64 #1 SMP Tue May 15 18:22:15 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux

node_exporter version: output of node_exporter --version

node_exporter, version (branch: , revision: ) build user: build date: go version: go1.10.2

We make 'make' command by default and generated the output: /root/go/bin/node_exporter

node_exporter command line flags

none

What did you do that produced an error?

Just let the system work for a day. It crashes randomly

What did you expect to see?

No crashes at all

What did you see instead?

May 31 19:05:36 ip-xxx-xxx-xxx-xxx dhclient[28624]: DHCPREQUEST on eth0 to <postgre_sql_gateway> port 67 (xid=0x676bbe31) May 31 19:05:36 ip-xxx-xxx-xxx-xxx dhclient[28624]: DHCPACK from 10.209.28.1 (xid=0x676bbe31) May 31 19:05:38 ip-xxx-xxx-xxx-xxx NetworkManager[592]: [1527793538.0823] dhcp4 (eth0): address <postgre_sql_host> May 31 19:05:38 ip-xxx-xxx-xxx-xxx NetworkManager[592]: [1527793538.1766] dhcp4 (eth0): plen 26 (mask) May 31 19:05:38 ip-xxx-xxx-xxx-xxx NetworkManager[592]: [1527793538.2375] dhcp4 (eth0): gateway <postgre_sql_gateway> May 31 19:05:38 ip-xxx-xxx-xxx-xxx NetworkManager[592]: [1527793538.3553] dhcp4 (eth0): lease time 3600 May 31 19:05:38 ip-xxx-xxx-xxx-xxx NetworkManager[592]: [1527793538.4821] dhcp4 (eth0): hostname 'ip-xxx-xxx-xxx-xxx' May 31 19:05:38 ip-xxx-xxx-xxx-xxx NetworkManager[592]: [1527793538.5757] dhcp4 (eth0): nameserver '<dns_server>' May 31 19:05:38 ip-xxx-xxx-xxx-xxx NetworkManager[592]: [1527793538.7860] dhcp4 (eth0): state changed bound -> bound May 31 19:05:39 ip-xxx-xxx-xxx-xxx dhclient[28624]: bound to <postgre_sql_host> -- renewal in 1392 seconds.

May 31 19:05:40 ip-xxx-xxx-xxx-xxx dbus[521]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' May 31 19:05:43 ip-xxx-xxx-xxx-xxx systemd: Starting Network Manager Script Dispatcher Service... May 31 19:06:05 ip-xxx-xxx-xxx-xxx dbus[521]: [system] Failed to activate service 'org.freedesktop.nm_dispatcher': timed out May 31 19:06:08 ip-xxx-xxx-xxx-xxx systemd: Started Network Manager Script Dispatcher Service. May 31 19:06:09 ip-xxx-xxx-xxx-xxx node_exporter: time="2018-05-31T19:06:09Z" level=error msg="error while sending encoded metrics: write tcp <postgre_sql_host>:9100-><prometheus_server>:44202: write: broken pipe\n" source="log.go:172"

Thanks

pedroj84 avatar Jun 01 '18 07:06 pedroj84

There is a known bug with CGO and Go 1.10. You may be running into the same issue as https://github.com/prometheus/node_exporter/issues/870.

SuperQ avatar Jun 01 '18 13:06 SuperQ

Thanks SuperQ. It looks like so. Indeed I opened the ticket expecting somehow this kind of answer. I will try to build with a different Go Version and come back If results are interesting for the community.

Best Regards

pedroj84 avatar Jun 05 '18 07:06 pedroj84

@pedroj84 If you get any stack traces, or have an additional info, please post to #870. We have had a difficult time reproducing this bug. ☹️

SuperQ avatar Jun 05 '18 07:06 SuperQ

Hi SuperQ, At the end we managed to stabilize our platform. The issue looked like config issue between postgre_exporter and postgresqldb. What we did is to change WAL size in postgresql.conf file setting it to 2Gb instead to 1Gb (provided value by default)

This change has generated that the platform remains stablished for 1 week now. I hope this helps.

Best Regards

pedroj84 avatar Jun 25 '18 06:06 pedroj84

@SuperQ I met this problem too, But i found my browser can get node exporter data normally. my server runs exporters: node_exporter nginx_exporter trafficserver_exporter

My node exporter logs is:

time="2018-07-24T15:26:49+08:00" level=error msg="error while sending encoded metrics: write tcp xxx:62003->xxx:53808: write: broken pipe\n" source="<autogenerated>:1"
time="2018-07-24T15:27:04+08:00" level=error msg="ERROR: cpu collector failed after 0.001553s: open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: no such file or directory" source="collector.go:136"
time="2018-07-24T15:27:04+08:00" level=error msg="error while sending encoded metrics: write tcp xxx:62003->xxx:53880: write: broken pipe\n" source="<autogenerated>:1"
time="2018-07-24T15:27:19+08:00" level=error msg="ERROR: cpu collector failed after 0.001186s: open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: no such file or directory" source="collector.go:136"
time="2018-07-24T15:27:19+08:00" level=error msg="error while sending encoded metrics: write tcp xxx:62003->xxx:53952: write: broken pipe\n" source="<autogenerated>:1"
time="2018-07-24T15:27:34+08:00" level=error msg="ERROR: cpu collector failed after 0.001830s: open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: no such file or directory" source="collector.go:136"
time="2018-07-24T15:27:34+08:00" level=error msg="error while sending encoded metrics: write tcp xxx:62003->xxx:54028: write: connection reset by peer\n" source="<autogenerated>:1"
time="2018-07-24T15:27:49+08:00" level=error msg="ERROR: cpu collector failed after 0.001014s: open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: no such file or directory" source="collector.go:136"
time="2018-07-24T15:27:49+08:00" level=error msg="error while sending encoded metrics: write tcp xxx:62003->xxx:54100: write: broken pipe\n" source="<autogenerated>:1"
time="2018-07-24T15:28:04+08:00" level=error msg="ERROR: cpu collector failed after 0.001120s: open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: no such file or directory" source="collector.go:136"
time="2018-07-24T15:28:04+08:00" level=error msg="error while sending encoded metrics: write tcp xxx:62003->xxx:54172: write: broken pipe\n" source="<autogenerated>:1"
time="2018-07-24T15:28:19+08:00" level=error msg="ERROR: cpu collector failed after 0.003549s: open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: no such file or directory" source="collector.go:136"
time="2018-07-24T15:28:19+08:00" level=error msg="error while sending encoded metrics: write tcp xxx:62003->xxx:54248: write: broken pipe\n" source="<autogenerated>:1"
time="2018-07-24T15:28:34+08:00" level=error msg="ERROR: cpu collector failed after 0.001047s: open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: no such file or directory" source="collector.go:136"
time="2018-07-24T15:28:34+08:00" level=error msg="error while sending encoded metrics: write tcp xxx:62003->xxx:54326: write: connection reset by peer\n" source="<autogenerated>:1"
time="2018-07-24T15:28:49+08:00" level=error msg="ERROR: cpu collector failed after 0.001941s: open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: no such file or directory" source="collector.go:136"
time="2018-07-24T15:28:49+08:00" level=error msg="error while sending encoded metrics: write tcp xxx:62003->xxx:54398: write: connection reset by peer\n" source="<autogenerated>:1"
time="2018-07-24T15:29:04+08:00" level=error msg="ERROR: cpu collector failed after 0.001166s: open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: no such file or directory" source="collector.go:136"
time="2018-07-24T15:29:04+08:00" level=error msg="error while sending encoded metrics: write tcp xxx:62003->xxx:54470: write: broken pipe\n" source="<autogenerated>:1"

Operate system:

[root@XNOP061-CT-ZJTZ-C-24-40 node_exporter]# uname -a
Linux XNOP061-CT-ZJTZ-C-24-40 3.12.6-112 #1 SMP Fri Jan 8 00:01:09 CST 2016 x86_64 x86_64 x86_64 GNU/Linux

Node exporter version:

[root@XNOP061-CT-ZJTZ-C-24-40 node_exporter]# ./node_exporter --version
node_exporter, version 0.16.0-rc.3 (branch: HEAD, revision: 575d8950d367987ab8792e90fb2cf00c3fee1c10)
  build user:       root@d986ef46b6d6
  build date:       20180427-15:51:15
  go version:       go1.9.5

I do not know what difference with my browser and prometheus server....

thank you

Atlas-SZ avatar Jul 24 '18 07:07 Atlas-SZ

@damoyelang1992 I don't understand the encoding error. The error with scaling_cur_freq is related to https://github.com/prometheus/node_exporter/issues/644. Work is being done to fix this.

The other option is to update your Linux kernel to fix the bug in the old version.

SuperQ avatar Jul 24 '18 07:07 SuperQ

I have about 1000 machines run node exporter and I never seen this encoding error too. it seems only prometheus can not read the metrics, browser can get exporter data correctly. I will test if it is the version of prometheus or exporter version caused this problem.

Atlas-SZ avatar Jul 24 '18 10:07 Atlas-SZ

I guess this is just an error due to the partial response? Either way, let's move the discussion to cpufreq #644

discordianfish avatar Jul 24 '18 20:07 discordianfish