Search code examples
ruby-on-railsrakexml-rpc

Why did my script error out with a Net::ReadTimeout error?


I wrote a RoR Rake script which interfaces with a Python ORM over XMLRPC to import thousands of products from one Postgres server to the Python ORM's server (also on Postgres).

The script was running fine. I stepped away from my computer and returned in 5 minutes to see the following error:

rake aborted!
Net::ReadTimeout: Net::ReadTimeout

What might have caused this error?

NOTE: I am writing this question with the intention of providing my own answer so as to help anyone in the future who might encounter this issue.


Solution

  • The error was caused due to my computer going to sleep, or at least the hard drive spinning down and going into low power mode.

    I know the cause of the error may seem obvious, but I figure it's worth throwing out there.

    I was running macOS Mojave 10.14.

    I addressed the error by going to System Preferences/Energy Saver/Power Adapter and checking "Prevent computer from sleeping automatically when the display is off" and unchecking "Put hard disks to sleep when possible" (although I doubt that second one was at all necessary, I did it just in case).