When I attempt to export files (as JPEGs) from Lightroom CC, some, but not all files fail to export (error message Lightroom could not open files.)
A second attempt results in DIFFERENT successes and failures.
After repeated attempts to export just the failed files, success is eventually achieved.
I tried optimising catalogue, but that did not help.
This is obviously not the way things are supposed to happen and is quite frustrating.
So how come the files export eventually but not at the first attempt?
See this topic in the official Adobe feedback forum: Lightroom 6 does not export all selected images. That thread contains workarounds that have worked for others. Please add your vote and details of your problem to make it more likely Adobe will prioritize a fix. And please continue discussion there so that everyone benefits.