mas-cli / mas

:package: Mac App Store command line interface
MIT License
10.95k stars 275 forks source link

Can't uninstall Apps #637

Open RixzZ opened 1 week ago

RixzZ commented 1 week ago

Your Environment

mas Install Method

Describe the Bug

When trying to uninstall apps (previously installed from the GUI, if that matters somehow), it errors with the following:

Error: Runtime Error: Failed to revert ownership of deleted '/Applications/GarageBand.app' back to uid 501 & gid 20: delete result did not have a URL

To Reproduce

Steps to reproduce the behavior:

  1. Execute sudo mas uninstall 682658836.
  2. Provide password if requested.

Expected Behavior

It should be able to uninstall it.

Actual Behavior

It errors out and apparently does nothing to the app.

Screenshots, Terminal Output

% sudo mas uninstall 682658836
Error: Runtime Error: Failed to revert ownership of deleted '/Applications/GarageBand.app' back to uid 501 & gid 20: delete result did not have a URL

Additional Context

Add any other context about the problem here.

N/A

Did it work in a previous version?

I don't know. Just started using 'mas'.

rgoldberg commented 1 week ago

@RixzZ Did the app get moved to the trash, or did it remain under /Applications?

RixzZ commented 1 week ago

It's still in /Applications.

rgoldberg commented 1 week ago

@RixzZ was the app running while you uninstalled it?

Apps are deleted by using a scripting bridge to Finder. The actual delete process is fairly opaque. No errors could have been thrown, the Finder delete() function doesn't seem to have deleted the app folder for you, and the object returned by that function didn't have a file URL for the app folder since it wasn't deleted.

Since deletion works for me (albeit on a different version on macOS), it will be hard to investigate this without being able to reproduce it somewhere where I can debug, or without learning about reflection-like capabilities of Swift to output more info in this circumstance for you to send to me after running it.

Will get to this in a bit due to other more pressing issues.

RixzZ commented 1 week ago

No... in fact, I don't think it was ever opened since it was installed.

Also, the error thrown it's instant. It doesn't seem to do much before throwing it.

This Mac it updated with Open Core to a version not officially supported by that hardware (2014 Mac Mini). I didn't detect any limitation with any software (Apple's or 3rd Party), so I don't think it matters, but anyway, just in case.

rgoldberg commented 1 week ago

Thanks for info.

A successful uninstall should also be fairly instantaneous.

Will try to get to this next week, but might be busy with other stuff.