What version of After Effects are you using? There have been major improvements in this are in After Effects CC (12).
I'm using After Effects CS6 Version 22.214.171.1248. It's at my place fo work so while I can recommend an upgrade, it's not likely to happen any time soon. Any advice regarding CS6?
First, install the updates. You are three major bug-fix updates behind.
That's not releated to your issue, but it's good advice.
Regarding your issue: There's not a simple answer other than being sure to keep your paths shorter.
I don't mean to be glib; it's a serious problem. That's why we spent a lot of time to fix this for After Effects CC (12).
“Long Path Tool” is very helpful for this error !
You can use to solve this problem.