When you say you've recorded before and this wasn't a problem, do you mean like, recently, using the same computer? Or three years ago, with a different setup? In other words, this same gear that you know for sure works is now causing an out-of-sync problem?
It would be helpful to know what equipment you are using, especially the audio interface, as that is often where sync problems originate. Many users of this forum add that information to their signature, so everyone who is trying to help can see it.
Also, have you recorded a track with a metronome on it, or are you using Sonar's built-in metronome, which does not record?