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

**URL:** <https://forums.percona.com/t/pt-online-schema-change-fails-with-use-of-uninitialized-value-host/3257>\
**Category:** Percona Toolkit\
**Created:** [February 6, 2014, 12:08pm UTC](https://forums.percona.com/t/pt-online-schema-change-fails-with-use-of-uninitialized-value-host/3257 "2014-02-06T12:08:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![knoxvilledba](https://avatars.discourse-cdn.com/v4/letter/k/e495f1/32.png) [@knoxvilledba](https://forums.percona.com/u/knoxvilledba)\
**Post date:** [February 6, 2014, 12:08pm UTC](https://forums.percona.com/t/pt-online-schema-change-fails-with-use-of-uninitialized-value-host/3257/1 "2014-02-06T12:08:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mirfan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mirfan/32/16890_2.png) [@mirfan](https://forums.percona.com/u/mirfan)\
**Post date:** [February 9, 2014, 3:36pm UTC](https://forums.percona.com/t/pt-online-schema-change-fails-with-use-of-uninitialized-value-host/3257/2 "2014-02-09T15:36:57Z")

</div>

what version of [pt-online-schema-change](http://www.percona.com/doc/percona-toolkit/2.2/pt-online-schema-change.html) 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.

---

<div class="post-metadata">

**Author:** ![knoxvilledba](https://avatars.discourse-cdn.com/v4/letter/k/e495f1/32.png) [@knoxvilledba](https://forums.percona.com/u/knoxvilledba)\
**Post date:** [March 4, 2014, 8:49pm UTC](https://forums.percona.com/t/pt-online-schema-change-fails-with-use-of-uninitialized-value-host/3257/3 "2014-03-04T20:49:59Z")

</div>

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](http://server1.mydomain.com) 101

# Cxn:3788 31918 DBI::db=HASH(0x1472f80) Connected dbh to [server1.mydomain.com](http://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](http://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](http://server1.mydomain.com) 101

# Cxn:3788 31918 DBI::db=HASH(0x14462c8) Connected dbh to [server1.mydomain.com](http://server1.mydomain.com)

# Percona::XtraDB::Cluster:7569 31918 [server1.mydomain.com](http://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](http://server1.mydomain.com)

# Cxn:3878 31918 Destroying cxn

# Cxn:3887 31918 DBI::db=HASH(0x1472f80) Disconnecting dbh on [server1.mydomain.com](http://server1.mydomain.com)
