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

4

8

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

Jeanniejeannine answered 7/7, 2016 at 12:23 Comment(3)
Do you have a table name (or something) with a % in it?Osteomalacia
hey @RickJames , nope nothing like that. Did you get a chance to check out the bug-report (link above) by any chance.Jeanniejeannine
although I do have it in my queries where I have used it for prefix and suffix ignore matchJeanniejeannine
E
8

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

Ellary answered 10/12, 2016 at 1:14 Comment(0)
S
1

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.

Silesia answered 27/4, 2018 at 6:39 Comment(0)
S
0

i found error in this version percona-toolkit-3.0.12-1.el7.x86_64.rpm and percona-toolkit-3.0.10-1.el7.x86_64.rpm is fine, percona-toolkit is very useful to me

at ./pt-query-digest line 9302.
Terminating pipeline because process 4 (iteration) caused too many errors.
Stegosaur answered 29/11, 2018 at 1:49 Comment(0)
L
0

Note that you will see the error message: "Redundant argument in sprintf at"

if you forget to put a % in front of your format spec (first argument).

Lodging answered 17/8, 2021 at 23:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.