It could be a time out. You need to dig into the logs to figure out what it is exactly. You could also put some debugging calls in your program to see where it fails. If you suspect call xyz() to cause the problem, you could add:
rmr.str("about to call xyz")
xyz()
rmr.str("done with xyz")
Then you can examine the stderr logs to see if the failure happens before or after xyz.
To avoid time outs you just need to call status("some message") every few seconds. If the time out happens in a library call you can't modify and if it has an option to write a progress bar or some such, you can turn that on while at the same time surrounding it with a sink call as follows
sink(stderr())
long_library_call(...., verbose = TRUE)
sink(NULL)
I hope this helps.
Antonio