Tracked it down, it was a small bug in dvr_db.c in tvheadend, it was linking a new dvr entry just before the autorec entry was added to it. So the htsp server was sending a dvr add without knowing from the autorec yet.