Batch task can’t start (AX 2012)

Recently I’ve struggled with the following issue on the DAX 2012: the batch headers are set to Executing state while the batch tasks are set to Ready state, and then nothing hapens. The batch server works fine but the tasks are not executing.

I’ve tried all known options without success:

  • Recompile CIL (Ctrl +D > Build > Generate Full CIL)
  • Make sure the Server configuration form contains a valid AOS, Is batch server checked, Maximum batch threads specified, batch server group is selected (System administration > Setup > System > Server configuration)
  • Check that batch jobs (that are in the Ready state) has a valid AOS assignment (Batch jobs > View tasks > General fast tab > AOS instance name)

The root cause of my issue was the user accounts under which the batch jobs have been created: Batch job > Created by field. This account is used to run a batch task ‘on bahalf of’. I checked the users and they were enabled and with System administration role assigned (System administration > Users > Enabled field). But it appears that someone deletes some user from an Active Directory. I cleared the Enable checkbox and set it back for an User and got the following “The Active Directory user or group does not exist. Contact your network administrator” message.

So since some Users were removed from an Active Directory the batch server can’t start jobs under these users and get stuck.  

To fix the issue I’ve updated all batch users to an Admin for the BatchJob.CreatedBy, Batch.CreatedBy, BatchJobAlerts.CreatedBy fields.