Firefox sync error

The last few weeks (since the upgrade to 4.0.1 I think) I got an error in Firefox sync.

Firefox Sync encountered an error while syncing: Unknown error

Thanks to a post on Ghabuntu I fixed the problem.

Go to your sync account, log in, and click “clear your sync data”.
Then click the Sync now button on the error message, or select synchronise now from the Firefox menu.