TurnKey Linux Virtual Appliance Library

tklbam-backup fails, AssertionError

critchie's picture

I just noticed my backups have been failing for a while.  When I run tklbam-backup, I get this:

root@waldorf /home/critchie# tklbam-backup
Traceback (most recent call last):
  File "/usr/bin/tklbam-backup", line 266, in <module>
  File "/usr/bin/tklbam-backup", line 237, in main
    b = backup.Backup(conf)
  File "/usr/lib/tklbam/backup.py", line 251, in __init__
    self._create_extras(extras_paths, profile_paths, conf)
  File "/usr/lib/tklbam/backup.py", line 235, in _create_extras
  File "/usr/lib/tklbam/mysql.py", line 394, in backup
    mysql2fs(mysqldump_fh, myfs, **kws)
  File "/usr/lib/tklbam/mysql.py", line 217, in mysql2fs
    MyFS_Writer(outdir, limits).fromfile(fh, callback)
  File "/usr/lib/tklbam/mysql.py", line 213, in fromfile
    assert _match_name(statement) == table.name
I'm not sure what's happening, but here is mysql.py around line 213:
	elif statement.startswith("INSERT INTO"):
                if not database or not table:
                assert _match_name(statement) == table.name
def mysql2fs(fh, outdir, limits=[], callback=None):
    MyFS_Writer(outdir, limits).fromfile(fh, callback)
Any ideas?
Inveneo's picture

Seems related to a trigger


I commented out that assertion and the backup seems to be running now.
It seems that  tklbam-backup does not like it when you have a trigger that performs an action on a table other than the table the trigger is installed on.
So in my case, this line failed:
assert _match_name(statement) == table.name
  • table.name is:  network_radios
  • statement is:  INSERT INTO radios_radios SELECT...
Indeed, in my database the table network_radios has a trigger that does an insert into another table named radios_radios.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)