The insane.bbclass grep in log.do_compile and log.do_install unconditionally, but there maybe no such logs when mirror the pkg from sstate cache file. We should check whether the log file exists or not before grep in it.
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=54d61ed9f759a38f7309f4428e1853249071667c