Hi @hilongo,
It sounds like you have some incomplete/invalid entries in your email_log
table. Run the following query:
select count(*) from email_log where assoc_id is null;
This should indicate the problem rows. You may want to remove them (after restoring your database from backup, before running the upgrade script).
Regards,
Alec Smecher
Public Knowledge Project Team