I had the same problem with my ranger. But it’s not a bug, it’s probably just your pet that sometimes gets in the way. When auto-attack stops working look at the top of the screen; if the bar is green instead of red you have your pet as the target. Quickly click Tab (or whatever key you use to select a target) and auto-attack should work again.