`LSOpenURLsWithRole() failed with error -1712 for the file ` when I attempt `open .` I suddenly came across this error when I attempted to do open . to open the current directory in Finder, a command that I use quite frequently:

ysim:~/Downloads$ open .
LSOpenURLsWithRole() failed with error -1712 for the file /Users/ysim/Downloads.


It persisted for a few minutes and went away by itself. I tried googling it but the only two hits I saw had to do with ImageMagick and Automator, neither of which I use. Does anyone know why it happens and how to prevent it?
That error means an Apple Event timed out.

error -1712 errAETimeout: the AppleEvent timed out 


You can either open Activity Monitor and look to see if you notice an Application or process that states Not responding or hit option command esc then force quit any non-responding application.

It's possible the application or process was already open and by using open . it tried to launch it for whatever reason. Often it's an Automator or AppleScript that is waiting for user interaction and "times out" waiting.