pt-sift error: PREFIX: unbound variable

Bug #1022851 reported by Raghavendra D Prabhu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Medium
Daniel Nichter

Bug Description

$ pt-sift .
/mine/bin/site_perl/pt-sift: line 124: PREFIX: unbound variable

Here is the xtrace output: http://sprunge.us/aZCG?sh

Following is the fix

=======
--- pt-sift 2012-06-12 21:34:14.000000000 +0530
+++ pt-sift.fixed 2012-07-10 13:17:25.980001591 +0530
@@ -85,6 +85,7 @@
    ARG="${1:-.}"
    if [ -d "${ARG}" ]; then
       BASEDIR="$(echo "${ARG}" | sed -e 's!/$!!')"
+ PREFIX=""
    elif [ -f "${ARG}" -o -f "${ARG}-df" -o -f "${ARG}df" ]; then
       BASEDIR="$(dirname "${ARG}")"
       PREFIX="$(echo "${ARG}" | sed -e 's/-[a-z1]*$//' -e 's!^.*/!!')"
===========

Revision history for this message
Baron Schwartz (baron-xaprb) wrote :

Thanks. BTW, I prefer all information for a bug report to be in the report itself, rather than an external site. Here is the pastebin contents:

 1 bash -x /mine/bin/site_perl/pt-sift .
 2 + TOOL=pt-sift
 3 + set -u
 4 + PT_TMPDIR=
 5 + '[' pt-sift = pt-sift ']'
 6 + main .
 7 + ARG=.
 8 + '[' -d . ']'
 9 ++ echo .
10 ++ sed -e 's!/$!!'
11 + BASEDIR=.
12 + for prog in pt-diskstats pt-pmp pt-mext pt-align
13 + prog_base=diskstats
14 + which pt-diskstats
15 ++ which pt-diskstats
16 + eval PR_diskstats=/mine/bin/site_perl/pt-diskstats
17 ++ PR_diskstats=/mine/bin/site_perl/pt-diskstats
18 + for prog in pt-diskstats pt-pmp pt-mext pt-align
19 + prog_base=pmp
20 + which pt-pmp
21 ++ which pt-pmp
22 + eval PR_pmp=/mine/bin/site_perl/pt-pmp
23 ++ PR_pmp=/mine/bin/site_perl/pt-pmp
24 + for prog in pt-diskstats pt-pmp pt-mext pt-align
25 + prog_base=mext
26 + which pt-mext
27 ++ which pt-mext
28 + eval PR_mext=/mine/bin/site_perl/pt-mext
29 ++ PR_mext=/mine/bin/site_perl/pt-mext
30 + for prog in pt-diskstats pt-pmp pt-mext pt-align
31 + prog_base=align
32 + which pt-align
33 ++ which pt-align
34 + eval PR_align=/mine/bin/site_perl/pt-align
35 ++ PR_align=/mine/bin/site_perl/pt-align
36 + mk_tmpdir
37 + local dir=
38 + '[' -n '' ']'
39 + local tool=pt-sift
40 + local pid=38646
41 ++ mktemp -d -t pt-sift.38646.XXXXXX
42 + PT_TMPDIR=/tmp/pt-sift.38646.6rrMt9
43 + ls .
44 + grep -- '-df$'
45 + cut -d- -f1
46 + sort
47 /mine/bin/site_perl/pt-sift: line 124: PREFIX: unbound variable

tags: added: crash pt-sift
Changed in percona-toolkit:
status: New → Triaged
milestone: none → 2.1.3
tags: added: unbound-variable
Changed in percona-toolkit:
importance: Undecided → Medium
Changed in percona-toolkit:
status: Triaged → In Progress
assignee: nobody → Daniel Nichter (daniel-nichter)
summary: - pt-sift fails with directory
+ pt-sift crashes with error "PREFIX: unbound variable"
Revision history for this message
Daniel Nichter (daniel-nichter) wrote : Re: pt-sift crashes with error "PREFIX: unbound variable"

This and a host of other issues are fixed in the linked branch.

Changed in percona-toolkit:
status: In Progress → Fix Committed
summary: - pt-sift crashes with error "PREFIX: unbound variable"
+ pt-sift error: PREFIX: unbound variable
Changed in percona-toolkit:
status: Fix Committed → Fix Released
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-554

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.