There are tag mapping entries for non-existing titles. This may be a legacy issue, but select count(*) from tag_mapping where not exists (select 1 from titles where titles.title_id=tag_mapping.title_id) finds 162 entries. AT the very least they need to be deleted.
Anonymous
This is probably the result of some sort of title deletions (e.g., merging).
Checking the latest backups, I see that this query still finds 162 records, which suggests that the software problem is likely gone. Now we just need to delete the bad records.
Fixed in scripts/delete_bad_tag_mappings.sql 1.1. Installed in r2014-133 on 2014-03-05. Closing.