1

Why am I getting LSOpenURLsWithRole() failed with error -610 when I try to open a .dmg on the command line?

user@host Downloads % open buskill-mac-x86_64.dmg
LSOpenURLsWithRole() failed with error -610 for the file /Users/user/Downloads/buskill-mac-x86_64.dmg.
user@host Downloads %

I'm downloaded a .dmg file with wget, and now I want to open it. But when I do, I get the above error.

What does this LSOpenURLsWithRole() failed with error -610 error mean, and how do I fix it?

1

1 Answer 1

1

Here's the official Apple API reference documentation for LSOpenURLsWithRole()

Unfortunately, MacOS reference documenation is terrible and it doesn't say what erorr "-610" is.

Rather, like most thing with Apple, you can try to reverse-engineer it by grepping through C header files:

user@host ~ % cd /Library/Developer/CommandLineTools/SDKs 
user@host SDKs % 

user@host SDKs % grep -ir '\-610' * 
...
noUserInteractionAllowed      = -610  /* no user interaction allowed */
...
user@host SDKs %

So in this case it appears that -610 translates to noUserInteractionAllowed. And a quick google leads back to the official Apple reference documentation, which is completely useless:

In my case, I found that the issue was that I wasn't logged-into the GUI.

My machine is headless, and I was only logged-in to the CLI via ssh. As soon as I logged-into the GUI and re-ran the command, the error went away.

2
  • It's usually a permissions error; no permission to execute. It could mean the file was quarantined. apple.stackexchange.com/search?q=LSOpenURLsWithRole
    – Tetsujin
    Commented Jan 16, 2023 at 7:26
  • The issue goes away as soon as I log into the GUI. This one -610 is not a permissions error, which is why I posted this Q&A Commented Jan 16, 2023 at 15:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .