pt-online-schema-change fails with "Use of uninitialized value $host"

Can anyone help me out here? This is a localhost mysql db. User is root, pass is blank, as I am logged in as root on the server.

Installed version is percona-toolkit-2.2.6-1.noarch
Database version is Percona-Server-server-56-5.6.15-rel63.0.519.rhel6.x86_64

root@server1 [~]# pt-online-schema-change --alter “ENGINE=InnoDB” D=test,t=alterme,u=root --execute
Use of uninitialized value $host in string eq at /usr/bin/pt-online-schema-change line 4112.

root@server1 [~]# pt-online-schema-change --alter “ENGINE=InnoDB” D=test,t=alterme --execute
Use of uninitialized value $host in string eq at /usr/bin/pt-online-schema-change line 4112.

root@server1 [~]# pt-online-schema-change --alter “ENGINE=InnoDB” D=test,t=alterme,h=localhost --execute
Use of uninitialized value $host in string eq at /usr/bin/pt-online-schema-change line 4112.

root@server1 [~]# pt-online-schema-change --alter “ENGINE=InnoDB” D=test,t=alterme,h=server1 --execute
Use of uninitialized value $host in string eq at /usr/bin/pt-online-schema-change line 4112.

On the other hand, --dry-run always works, but of course executes nothing.

what version of pt-online-schema-change you are using ? Can you try with latest version ? Further, i would suggest to run it along PTDEBUG=1 and redirect the output to file and this will yield lot of debugging info which will help to identify the problem.

Thanks for responding, mirfan. I apparently don’t have my notifications set up properly and am late in replying to this. I found the problem, using the PTDEBUG. What I found is that the recursion-method is causing this to fail, since I don’t have any slaves. The fix was to use the “–recursion-method=none” flag to bypass that functionality. You can see the DEBUG below, as it may be a bug for single server topology regardless of the workaround?

truncated:..........

$DBD::mysql::VERSION: 4.013 $DBI::VERSION: 1.63

Cxn:3800 31918 DBI::db=HASH(0x1472f80) Setting dbh

Cxn:3805 31918 DBI::db=HASH(0x1472f80) SELECT @@server_id /!50038 , @@hostname/

Cxn:3807 31918 DBI::db=HASH(0x1472f80) hostname: server1.mydomain.com 101

Cxn:3788 31918 DBI::db=HASH(0x1472f80) Connected dbh to server1.mydomain.com

DSNParser:2157 31918 DSN string made from options:

DSNParser:2094 31918 No DSN to parse

DSNParser:2210 31918 DBI:mysql:test;;mysql_read_default_group=client

DSNParser:2259 31918 DBI:mysql:test;;mysql_read_default_group=client root undef mysql_enable_utf8=>0, ShowErrorStatement=>1, AutoCommit=>1, RaiseError=>1, PrintError=>0

DSNParser:2287 31918 DBI::db=HASH(0x14462c8) SELECT @@SQL_MODE

DSNParser:2418 31918 DBI::db=HASH(0x14462c8) SET SESSION innodb_lock_wait_timeout=1

DSNParser:2418 31918 DBI::db=HASH(0x14462c8) SET SESSION lock_wait_timeout=60

DSNParser:2418 31918 DBI::db=HASH(0x14462c8) SET SESSION wait_timeout=10000

DSNParser:2318 31918 DBI::db=HASH(0x14462c8) SET @@SQL_QUOTE_SHOW_CREATE = 1/!40101, @@SQL_MODE=‘NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION’/

DSNParser:2327 31918 DBH info: DBI::db=HASH(0x14462c8) $VAR1 = {

‘@@hostname’ => ‘server1.mydomain.com’,

‘CONNECTION_ID()’ => ‘1603992’,

‘DATABASE()’ => ‘test’,

‘VERSION()’ => ‘5.6.15-56-log’

};

Connection info: Localhost via UNIX socket Character set info: $VAR1 = [

{

Value => ‘latin1’,

Variable_name => ‘character_set_client’

},

{

Value => ‘latin1’,

Variable_name => ‘character_set_connection’

},

{

Value => ‘latin1’,

Variable_name => ‘character_set_database’

},

{

Value => ‘binary’,

Variable_name => ‘character_set_filesystem’

},

{

Value => ‘latin1’,

Variable_name => ‘character_set_results’

},

{

Value => ‘latin1’,

Variable_name => ‘character_set_server’

},

{

Value => ‘utf8’,

Variable_name => ‘character_set_system’

},

{

Value => ‘/usr/share/mysql/charsets/’,

Variable_name => ‘character_sets_dir’

}

];

$DBD::mysql::VERSION: 4.013 $DBI::VERSION: 1.63

Cxn:3800 31918 DBI::db=HASH(0x14462c8) Setting dbh

Cxn:3805 31918 DBI::db=HASH(0x14462c8) SELECT @@server_id /!50038 , @@hostname/

Cxn:3807 31918 DBI::db=HASH(0x14462c8) hostname: server1.mydomain.com 101

Cxn:3788 31918 DBI::db=HASH(0x14462c8) Connected dbh to server1.mydomain.com

Percona::XtraDB::Cluster:7569 31918 server1.mydomain.com SHOW VARIABLES LIKE ‘wsrep_on’

Percona::XtraDB::Cluster:7571 31918 $VAR1 = undef;

VersionParser:1949 31918 VersionParser got a dbh, trying to get the version

VersionParser:1997 31918 InnoDB support: DEFAULT

VersionParser:2009 31918 InnoDB version: 5.6.15-rel63.0

MasterSlave:4031 31918 Recursion methods: processlist hosts

MasterSlave:4041 31918 Connected to D=test,t=alterme,u=root

MasterSlave:4050 31918 SELECT @@SERVER_ID

MasterSlave:4052 31918 Working on server ID 101

MasterSlave:4085 31918 Looking for slaves on D=test,t=alterme,u=root using methods processlist hosts

MasterSlave:4092 31918 Finding slaves with _find_slaves_by_processlist

MasterSlave:4154 31918 DBI::db=HASH(0x1472f80) SHOW GRANTS FOR CURRENT_USER()

MasterSlave:4184 31918 DBI::db=HASH(0x1472f80) SHOW PROCESSLIST

Use of uninitialized value $host in string eq at /usr/bin/pt-online-schema-change line 4112.

Cxn:3878 31918 Destroying cxn

Cxn:3887 31918 DBI::db=HASH(0x14462c8) Disconnecting dbh on server1.mydomain.com

Cxn:3878 31918 Destroying cxn

Cxn:3887 31918 DBI::db=HASH(0x1472f80) Disconnecting dbh on server1.mydomain.com