Forum: 

tklbam-backup fails, AssertionError

Inveneo'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
CREATING /TKLBAM
Traceback (most recent call last):
  File "/usr/bin/tklbam-backup", line 266, in <module>
    main()
  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
    limits=conf.overrides.db)
  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
AssertionError
 
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:
                    continue
                assert _match_name(statement) == table.name
                table.addrow(statement)
def mysql2fs(fh, outdir, limits=[], callback=None):
    MyFS_Writer(outdir, limits).fromfile(fh, callback)
 
Any ideas?
Inveneo's picture

 

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
...when:
  • 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