I've been getting the same error message and experiencing similar problems for several months. At one point, I spent over an hour troubleshooting with Apple technical support over the phone. Nothing they could suggest was working.
Recreating my library as per the instructions at the following url fixed the issue!
I know this is from a long while ago, but just wondering if you lost all your playlists when you did this? Seems the file it tells you to drag to the trash has the playlists in it... Right now the sync issue is just annoying but not causing any other issues so I'd rather not lose the 100+ playlists I have to fix this... Any insight would be appreciated.