If you are hosting in a cloud foundry environment, you will need an additional file storage service. In a cloud foundry environment, all file objects will be lost when you restart the app. this causes problems with the sync because the DB still sees the file objects in the database, but they are empty objects.
Either add on a file storage service, or delete the empty objects and the sync should start working.
Important to note when checking the file document objects, don’t use the hasContents attribute to check, as this may be true even if the file is missing. rather check that the contents attribute is != empty