I've got some code that was failing when Pardot would hit a trigger on the lead object. The problem is that the "Pardot" user is not a real user that can be queried. It gets a valid running user Id, but apparently the user record doesn't exist. So:
Id runningUserId = UserInfo.getUserId(); // runningUserId is a valid user id User u = [SELECT Id FROM User WHERE Id = :runningUserId LIMIT 1]; // if managed package like pardot is the running user then u == null
solved this by just adding a check to make sure that the user != null, but trying to understand more about this intangible managed package user. When is code actually running as this user? Specifically having issues with Pardot, but saw this same thing coming from Rollup Helper as well. Maybe something to do with scheduled jobs?