Bug #74549 mysqldiskusage: ValueError
Submitted: 24 Oct 2014 11:58 Modified: 31 Jul 2015 5:21
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Utilities Severity:S3 (Non-critical)
Version:1.5.2 OS:Any
Assigned to: CPU Architecture:Any

[24 Oct 2014 11:58] Daniël van Eeden
Description:
mysqldiskusage gives a ValueError.

How to repeat:
$ mysqldiskusage --server=usr:pwd@my-srv001.foo.bar.local
WARNING: Using a password on the command line interface can be insecure.
# Source on my-srv001.foo.bar.local: ... connected.
Traceback (most recent call last):
  File "./.local/bin/mysqldiskusage", line 141, in <module>
    is_remote = not servers[0].is_alias("localhost")
  File "/home/user01/.local/lib/python2.6/site-packages/mysql/utilities/common/server.py", line 921, in is_alias
    return self._update_alias(host_or_ip, suffixes)
  File "/home/user01/.local/lib/python2.6/site-packages/mysql/utilities/common/server.py", line 774, in _update_alias
    host, _ = alias.rsplit('.')
ValueError: too many values to unpack
[24 Oct 2014 12:14] Daniël van Eeden
This is what it tries to do:
 host, _ "my-host.foo.bar.local".rsplit('.')

The alias is the name of the remote server.
[24 Oct 2014 12:16] Daniël van Eeden
Workaround: make a change in mysql/utilities/common/server.py:774

From:
host, _, = alias.rsplit('.')

To:
host, _, _, _ = alias.rsplit('.')

This is a quick & dirty workaround and will break the script if the number of dots in the hostname/alias is different
[8 Feb 2015 3:30] nicola tudino
I have same eroor in mysqluc 1.5.3 when i use ip as host name for registered credentials

mysqldiskusage --server=ub1010 --all
# Source on 192.168.211.130: ... connected.
Traceback (most recent call last):
  File "G:\ade\build\sb_0-13490314-1413914811.2\Python-2.7.6-windows-x86-32bit\lib\site-packages\cx_Freeze\initscripts\Console.py"
, line 27, in <module>
  File "scripts\mysqldiskusage.py", line 141, in <module>
  File ".\mysql\utilities\common\server.py", line 921, in is_alias
  File ".\mysql\utilities\common\server.py", line 774, in _update_alias
ValueError: too many values to unpack
[31 Jul 2015 5:21] MySQL Verification Team
Hello Daniël,

Thank you for the report.
I can't repeat this issue at my end, could you please try with latest builds and report us back if you are still seeing this issue?  If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

[root@my-srv001 ~]# hostname
my-srv001.foo.bar.local
[root@my-srv001 ~]#
[root@my-srv001 ~]# mysqldiskusage --server=root@my-srv001.foo.bar.local
# Source on my-srv001.foo.bar.local: ... connected.
# Database totals:
+---------------------+-------------+
| db_name             |      total  |
+---------------------+-------------+
| mydb                | 600,383     |
| mysql               | 40,228,630  |
| performance_schema  | 489,543     |
| test                | 127,403     |
+---------------------+-------------+

Total database disk usage = 41,445,959 bytes or 39.53 MB

#...done.
[root@my-srv001 ~]# mysqldiskusage --version
MySQL Utilities mysqldiskusage version 1.5.4
License type: GPLv2

[root@my-srv001 ~]# hostname
my-srv001.xyz.xyz.xyz.foo.bar.local
[root@my-srv001 ~]# mysqldiskusage --server=root@my-srv001.xyz.xyz.xyz.foo.bar.local
# Source on my-srv001.xyz.xyz.xyz.foo.bar.local: ... connected.
# Database totals:
+---------------------+-------------+
| db_name             |      total  |
+---------------------+-------------+
| mydb                | 600,383     |
| mysql               | 40,228,630  |
| performance_schema  | 489,543     |
| test                | 127,403     |
+---------------------+-------------+

Total database disk usage = 41,445,959 bytes or 39.53 MB

#...done.

Thanks,
Umesh