Usually, when it happens to me, it's because I hit the "Publish!" button before verifying that the attachment had finished the whole attachment process.
Seems like, if hitting "Publish!" before the process completes can cause the attachment to fail, then the "Publish!" button ought to remain greyed-out.
/shrug