github / gh-ost

GitHub's Online Schema-migration Tool for MySQL
MIT License
12.44k stars 1.26k forks source link

FATAL ERROR 1105 (HY000): Failed to register slave: too long 'report-host' #734

Open ealter opened 5 years ago

ealter commented 5 years ago

I have been running into this issue when running gh-ost inside of some of our docker containers. When the hostname of the docker container is at least 61 characters in length, I get the following error when trying to run gh-ost.

$ cat /tmp/ghost_user.cnf
[client]
user = ghost
$ /usr/bin/gh-ost --database yelp_pushplan_execution --table pushplan_run --alter ENGINE=InnoDB --conf /tmp/ghost_user.cnf --host xx.xx.xx.xx --chunk-size 500 --force-table-names 1557255792_pushplan_run --assume-rbr
2019/05/07 20:20:05 binlogsyncer.go:79: [info] create BinlogSyncer with config {99999 mysql 10.121.133.170 3306 ghost   false false <nil>}
2019/05/07 20:20:05 binlogsyncer.go:246: [info] begin to sync binlog from position (mysql-bin.000008, 951800672)
2019/05/07 20:20:05 binlogsyncer.go:139: [info] register slave for master server 10.121.133.170:3306
2019-05-07 20:20:05 FATAL ERROR 1105 (HY000): Failed to register slave: too long 'report-host'

The docker container is running on Ubuntu Bionic.

When I specified --hostname when creating the same docker container to be 61 characters instead, gh-ost ran without any issues.

The error message comes from https://github.com/mysql/mysql-server/blob/124c7ab1d6f914637521fd4463a993aa73403513/sql/rpl_master.cc#L161 and it looks like hostname is chosen from https://github.com/siddontang/go-mysql/blob/master/replication/binlogsyncer.go#L495

Let me know if you need any other information to reproduce this.

shlomi-noach commented 5 years ago

Thank you for investigating! I'd say this is an issue for https://github.com/siddontang/go-mysql ; fixing it in gh-ost is probably not the best idea.

ealter commented 5 years ago

Sounds good. I filed https://github.com/siddontang/go-mysql/issues/388