pt-query digest SIGPIPE error using /bin/mail

Bug #1648770 reported by Miguel Gonzalez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Invalid
Undecided
Unassigned

Bug Description

Running Percona-Server-5.5 and percona toolkit in CentOS 6.8.

pt-query-digest with no option runs fine agains slow query log. Trying to mail the report shows a SIGPIPE error that never showed up before.

Revision history for this message
Sveta Smirnova (svetasmirnova) wrote :

Thank you for the report.

I cannot repeat described behavior:

$ ~/src/percona-toolkit/bin/pt-query-digest slow.log | mail -s "Bug #1648770" root@Thinkie
$

root@Thinkie:/home/sveta/src/percona-server# mail
"/var/mail/root": 1 message 1 new
>N 1 Sveta Cum Ara 9 23:30 25/1059 Bug #1648770
? 1
Return-Path: <sveta@Thinkie>
X-Original-To: root@Thinkie
Delivered-To: root@Thinkie
Received: by Thinkie (Postfix, from userid 1000)
 id 9028817C1C73; Fri, 9 Dec 2016 23:30:09 +0300 (+03)
Subject: Bug #1648770
To: <root@Thinkie>
X-Mailer: mail (GNU Mailutils 2.99.99)
Message-Id: <20161209203009.9028817C1C73@Thinkie>
Date: Fri, 9 Dec 2016 23:30:09 +0300 (+03)
From: sveta@Thinkie (Sveta)

# 15.8s user time, 20ms system time, 47.62M rss, 113.88M vsz
# Current date: Fri Dec 9 23:30:09 2016
# Hostname: Thinkie
# Files: slow.log
# Overall: 0 total, 1 unique, 0 QPS, 0x concurrency ______________________
# Attribute total min max avg 95% stddev median
# ============ ======= ======= ======= ======= ======= ======= =======
# Query size 2.07M 2.07M 2.07M 2.07M 2.07M 0 2.07M

# Profile
# Rank Query ID Response time Calls R/Call V/M Item
# =========== =========== =========== =========== =========== ===== ======
?

Please send exact command you use to pipe output from the tool to mail.

Changed in percona-toolkit:
status: New → Incomplete
Revision history for this message
Miguel Gonzalez (miguel-3-gonzalez) wrote :

This is the command I use in cron, but in command line happens the same:

root@mymachine [~]# /usr/bin/pt-query-digest /var/lib/mysql/log-slow-queries.log | /bin/mail -s "slow queries report" <email address hidden>
/var/lib/mysql/log-slow-queries.log: 53% 00:26 remain
/var/lib/mysql/log-slow-queries.log: 99% 00:00 remain
# Caught SIGPIPE.
# Exiting on SIGPIPE.

Thanks!

Revision history for this message
Sveta Smirnova (svetasmirnova) wrote :

Thank you for the feedback.

How big is your log file? Did you close it before using pt-query-digest on it or is it attached to running server?

Changed in percona-toolkit:
status: Incomplete → New
status: New → Confirmed
status: Confirmed → Incomplete
Revision history for this message
Miguel Gonzalez (miguel-3-gonzalez) wrote :

It´s attached to a running Percona server. Right now it´s around 850 Mb. Do you suggest to truncate it?

Revision history for this message
Miguel Gonzalez (miguel-3-gonzalez) wrote :

I have truncated the file to 0 size and still getting the SIGPIPE signal:

root@mymachine [/var/lib/mysql]# ls -lh log-slow-queries.log
-rw-r--r--. 1 mysql mysql 0 Dec 12 16:01 log-slow-queries.log

root@mymachine [/var/lib/mysql]# pt-query-digest log-slow-queries.log |mail -s "test" <email address hidden>
# Caught SIGPIPE.

Changed in percona-toolkit:
status: Incomplete → New
Revision history for this message
Sveta Smirnova (svetasmirnova) wrote :

Thank you for the feedback.

What is the output of `cat log-slow-queries.log |mail -s "test" <email address hidden>`?

Changed in percona-toolkit:
status: New → Incomplete
Revision history for this message
Miguel Gonzalez (miguel-3-gonzalez) wrote :

Sorry to bother you. You gave me the key, for some reason mailx package was acting up. Reinstalling it made it work back again.

So you can close this bug report.

Changed in percona-toolkit:
status: Incomplete → Invalid
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-1403

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.