Hi Eric;
FWIW: I would suggest wrapping that code up in a TRY..CATCH so that at least you can gracefully recover from the I/O error.
No idea though what could be causing that. Maybe catching the Exception might give you some more clues as to the real problem.
HTH
Regards ... Chris