Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pipeline process 5 (iteration) caused an error: Redundant argument in sprintf at /usr/bin/pt-query-digest line 2556

I am using percona-toolkit for analysing mysql-slow-query (logs). So the command is pretty basic:

pt-query-digest slowquery.log

Now the result(error) is:

18.2s user time, 100ms system time, 35.61M rss, 105.19M vsz

Current date: Thu Jul 7 17:18:43 2016

Hostname: Jammer

Files: slowquery.log

Pipeline process 5 (iteration) caused an error: Redundant argument in sprintf at /usr/bin/pt-query-digest line 2556. Will retry pipeline process 4 (iteration) 2 more times.

.. ..(same result prints twice) ..

The pipeline caused an error: Pipeline process 5 (iteration) caused an error: Redundant argument in sprintf at /usr/bin/pt-query-digest line 2556. Terminating pipeline because process 4 (iteration) caused too many errors.

Now the specifics for the environment, I am using Ubuntu 16.04 , MariaDB 10.1.14, Percona-Toolkit 2.2.16

I found something here bug-report, but it is like a workaround and does not actually solve the error. Even after applying the patch the command result doesn't look satisfying enough.


I am facing same problem on ubuntu 16.04 MySql. The contents of my slow query log is as follow.

/usr/sbin/mysqld, Version: 5.7.16-0ubuntu0.16.04.1-log ((Ubuntu)). started with: Tcp port: 3306 Unix socket: /var/run/mysqld/mysqld.sock Time Id Command Argument /usr/sbin/mysqld, Version: 5.7.16-0ubuntu0.16.04.1-log ((Ubuntu)). started with: Tcp port: 3306 Unix socket: /var/run/mysqld/mysqld.sock Time Id Command Argument Time: 2016-12-08T05:13:55.140764Z User@Host: root[root] @ localhost [] Id: 20 Query_time: 0.003770 Lock_time: 0.000200 Rows_sent: 1 Rows_examined: 2 SET timestamp=1481174035; SELECT COUNT(*) FROM INFORMATION_SCHEMA.TRIGGERS;

The error is same:

The pipeline caused an error: Pipeline process 5 (iteration) caused an error: Redundant argument in sprintf at /usr/bin/pt-query-digest line 2556.

Ubuntu 16.04 MySql Ver 14.14 Distrib 5.7.16 pt-query-digest 2.2.16

like image 745
Sagar Suri Avatar asked Jul 07 '16 12:07

Sagar Suri


2 Answers

The bug appears to be fixed in the current version of the toolkit (2.2.20), and apparently in previous ones, starting from 2.2.17.

This patch seems to do the trick for this particular place in pt-query-digest:

--- percona-toolkit-2.2.16/bin/pt-query-digest  2015-11-06 14:56:23.000000000 -0500
+++ percona-toolkit-2.2.20/bin/pt-query-digest  2016-12-06 17:01:51.000000000 -0500
@@ -2555,8 +2583,8 @@
    }
    return sprintf(
       $num =~ m/\./ || $n
-         ? "%.${p}f%s"
-         : '%d',
+         ? '%1$.'.$p.'f%2$s'
+         : '%1$d',
       $num, $units[$n]);
 }

But as mentioned in the original question and bug report, quite a few tools/functions were affected, the full bugfix consisted of a lot of small changes: https://github.com/percona/percona-toolkit/pull/73/files

like image 91
elenst Avatar answered Nov 03 '22 02:11

elenst


I might be late here. I want to share how I overcame that same error as it might help someone who is searching for an answer. At this time the latest tag of Percona toolkit is 3.0.9

I tried to run pt-query-digest after installing via apt, by downloading deb file as methods provided by Percona documentation, but any of it didn't help. It was this same error.

Pipeline process 5 (iteration) caused an error: 
Redundant argument in sprintf at /usr/bin/pt-query-digest line (some line)

1 - So I deleted/removed the installation of percona-toolkit

2 - first, I cleaned/updated perl version

sudo apt-get install perl

3 - then I installed Percona toolkit from source as mentioned in the repository's readme. like this. I used branch 3.0.

git clone [email protected]:percona/percona-toolkit.git
cd percona-toolkit
perl Makefile.PL
make
make test
make install

Thats it. Hope this help to someone.

like image 35
aimme Avatar answered Nov 03 '22 02:11

aimme