Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal Desktop fails to self-update with a non-admin user on OSX #1678

Closed
wdormann opened this issue Nov 2, 2017 · 27 comments
Closed

Signal Desktop fails to self-update with a non-admin user on OSX #1678

wdormann opened this issue Nov 2, 2017 · 27 comments

Comments

@wdormann
Copy link

wdormann commented Nov 2, 2017

  • [X ] I have searched open and closed issues for duplicates

Bug description

Describe here the issue that you are experiencing.

Signal Desktop on MacOS High Sierra has indicated that there's an update available. However, after clicking on Restart, the app closes, waits about 5 seconds, and then simply re-launches the same version without prompting the user for admin credentials.

Steps to reproduce

  • Install older Signal Desktop on MacOS as a non-admin user
  • Wait for update prompt
  • Click "Restart"

Actual result:
Signal Desktop closes, waits 5 seconds, and restarts without prompting the user for admin creds.

Expected result:
Signal Dessktop closes, MacOS prompts for admin user credentials, Signal Updates.

Screenshots

screen shot 2017-11-01 at 10 55 49 pm

Platform info

Operating System: MacOS 10.13.1 (17B48)
Signal version: v1.0.34

@peacememories
Copy link

I think the correct "fix" for this would be to update over the AppStore. element-hq/element-meta#1196 already requests distributing the app this way, but it seems apps not distributed via the AppStore can still use it as an update manager.

@wdormann
Copy link
Author

wdormann commented Nov 2, 2017

That sounds like it should indeed work around the problem. However, I can say that Signal Desktop seems to be an outlier in its lack of ability to update itself when logged in as a non-admin user. TBH, until now I suspected that the admin-credential-prompting aspect was a guarantee of the OS, since I see it across the board. But perhaps Signal Desktop is doing something a non-standard way, resulting in the lack of prompt, and subsequent failure to update.

@peacememories
Copy link

That it doesn't ask for admin credentials is indeed a problem in itself and should be fixed first.

@MacLemon
Copy link

MacLemon commented Nov 4, 2017

This is most likely the unfixed Bug in the upstream ShipIt Framework used by Electron for updating. (At least since 2014, so I highly doubt that this severe problem can be fixed. And not getting security relevant updates must be considered a severe vulnerability for Signal.)

Here's the system.log output on macOS Sierra 10.12.6 created during the failing-update.

ShipIt[1406]: Beginning installation
ShipIt[1406]: Installation error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied" UserInfo={NSLocalizedDescription=Permission denied}
com.apple.xpc.launchd[1] (org.whispersystems.signal-desktop.ShipIt[1406]): Service exited with abnormal code: 1
ShipIt[1518]: Resuming installation attempt 2
ShipIt[1518]: Couldn't abort install and restore owned bundle to previous location file:///Applications/Signal.app, error NSError { domain: NSPOSIXErrorDomain, code: 2, description: "No such file or 
ShipIt[1518]: Installation error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied" UserInfo={NSLocalizedDescription=Permission denied}
com.apple.xpc.launchd[1] (org.whispersystems.signal-desktop.ShipIt[1518]): Service exited with abnormal code: 1
ShipIt[1519]: Resuming installation attempt 3
ShipIt[1519]: Couldn't abort install and restore owned bundle to previous location file:///Applications/Signal.app, error NSError { domain: NSPOSIXErrorDomain, code: 2, description: "No such file or 
ShipIt[1519]: Installation error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied" UserInfo={NSLocalizedDescription=Permission denied}
com.apple.xpc.launchd[1] (org.whispersystems.signal-desktop.ShipIt[1519]): Service exited with abnormal code: 1
ShipIt[1520]: Too many attempts to install, aborting update
ShipIt[1520]: Error aborting installation: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSLocalizedDescription=No such file or directory}
ShipIt[1520]: Application launched at file:///Applications/Signal.app

Reference Bugs in other projects with the same problem:
Squirrel/Squirrel.Mac#131
https://github.com/vector-im/riot-web/issues/4013

@scottnonnenberg
Copy link
Contributor

On OSX, there are two places a user could put an application. One is the system-wide /Applications directory, and the other is user-specific: ~/Applications. Was the .app file put in the user-specific directory, or the global Applications directory?

@wdormann
Copy link
Author

wdormann commented Nov 6, 2017

The application was installed in the global /Applications directory.

@scottnonnenberg
Copy link
Contributor

If you move it to ~/Applications, do auto-updates work?

@wdormann
Copy link
Author

wdormann commented Nov 6, 2017

Yes, if Signal.app is moved to a user-writable location, such as ~/Applications, then the auto-update works fine.

@scottnonnenberg
Copy link
Contributor

Changing this to a feature request - we'd need to catch the attempted auto-update of a non-admin user, show a good error message. Prevent future downloads and notifications.

For now there's a workaround, and we've updated our support docs to talk about how to install for a non-admin user.

@britzke
Copy link

britzke commented Nov 9, 2017

Why not prompting for administrator credentials like other osx applications do? May be the prevention of the notification to the user could be implemented as a user preference.

@ideologysec
Copy link

@britzke because it doesn't work. System-wide auto-updates as a non-admin user is basically broken for all Electron apps, because the Electron framework itself doesn't handle this well. (when I used Atom it had the same problem, and I don't imagine Signal is any different).

@jomo
Copy link

jomo commented Nov 28, 2017

Similar issue that Keybase had with their client: keybase/client#5835

@britzke
Copy link

britzke commented Nov 28, 2017

@ideologysec they (the Electron framework community) should be informed about that issue, if it is an Electron issue. Did anybody opened an issue for that project?

@sig-hackeruno
Copy link

This is an issue regardless of whether you are an admin or not. I have signal installed in /Applications and I am an admin user, and signal fails to restart for an update. Also, if you manually quit and restart, no update is performed.

Furthermore, the version that is in the AppStore is 2 releases behind the one I am running that was downloaded from signal.org and it still insists on updating to a later one, so installing from the AppStore will not fix this problem.

@scottnonnenberg
Copy link
Contributor

@sig-hackeruno In the future, please file a new bug if it's only tangentially related to the bug you're commenting on. It truly is a different issue if you're seeing problems and you're not a non-admin, or not in the /Applications directory.

When you open that new bug, a few questions to answer: What do you mean 'the version that is in the AppStore?' Please also tell us which version you're working with? A log would be helpful. Lastly, there's a known issue going from v1.0.39 to v1.0.40 - the restart button doesn't restart the app.

@sig-hackeruno
Copy link

sig-hackeruno commented Dec 5, 2017 via email

@bits
Copy link

bits commented Dec 7, 2017

According to atom/atom#2860 the fix is in Electron versions 1.7.9 and higher, which has Squirrel.framework 0.3.2 with the necessary ShipIt binary for non-administrator users of Signal to update without getting stuck in a restart update loop.

@scottnonnenberg
Copy link
Contributor

The beta is on Electron 1.7.9. How to install:

  • Mac: install file in 'path' at https://updates.signal.org/desktop/beta-mac.yml
  • Windows: install file in 'path' at https://updates.signal.org/desktop/beta.yml
  • Debian-like linux: same setup, then apt-get install signal-desktop-beta

@ckujau
Copy link

ckujau commented Dec 17, 2017

Signal.app is installed in /Applications here and even when the application is not running, it's constantly logging to syslog:

Dec 16 18:02:17 mallory ShipIt[47212]: Installation error: Error Domain=SQRLShipItRequestErrorDomain Code=2 "Could not read update request" UserInfo={NSLocalizedDescription=Could not read update request, NSUnderlyingError=0x7fba99416570 {Error Domain=NSCocoaErrorDomain Code=260 "The file “ShipItState.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/var/root/Library/Caches/org.whispersystems.signal-desktop.ShipIt/ShipItState.plist, NSUnderlyingError=0x7fba99413ab0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}
Dec 16 18:02:17 mallory ShipIt[47212]: ShipIt quitting
Dec 16 18:02:17 mallory com.apple.xpc.launchd[1] (org.whispersystems.signal-desktop.ShipIt[47212]): Service exited with abnormal code: 1
Dec 16 18:02:17 mallory com.apple.xpc.launchd[1] (org.whispersystems.signal-desktop.ShipIt): Service only ran for 0 seconds. Pushing respawn out by 2 seconds.

...over and over again (12489 messages so far for today). Life was easier with the Chrome extension :-|

Update: I could not find the .plist file responsible for this to stop this, so my workaround now is to send a STOP signal to the process, that way it cannot terminate and the restart cycle seems to be broken, for now:

# while true; do pkill -STOP -f ShipIt; done

After a while it would catch something (and stop it):

# ps -fp `pgrep -f ShipIt`
  UID   PID  PPID   C STIME   TTY           TIME CMD
    0 48153     1   0  6:10PM ??         0:00.03 /Applications/Signal.app/Contents/Frameworks/Squirrel.framework/Resources/ShipIt org.whispersystems.signal-desktop.ShipIt

@scottnonnenberg
Copy link
Contributor

@ckujau If you're a non-admin user, you need to put it in your personal ~/Applications directory to enable auto-update. If you're an admin user, please enter a new bug. Some questions to answer in that new bug: are you perhaps behind a proxy? Or offline?

@ckujau
Copy link

ckujau commented Dec 18, 2017

Hehe, no - I don't want to enable auto-updates, I want to disable them :) I thought I found an already open ticket for this, but I cannot find it now. If it bothers me much, I shall open one, thanks. (Also: no, no proxy involved and the system is not offline)

@wdormann
Copy link
Author

I can confirm that Signal 1.1.0 successfully prompted for admin credentials to update to 1.2.0 using the in-app update capabilities.

@sig-hackeruno
Copy link

sig-hackeruno commented Jan 24, 2018 via email

@jschneier
Copy link

Can someone help with this? I have version 1.0.40 that was installed to /Applications. I moved it to ~/Applications after reading this thread. The upgrade button appears in the top right but it just links to the Chrome store. I saw that in a different PR that was changed to point to the website but I don't want to download a new version of Signal, I want it to upgrade.

@gasi-signal
Copy link
Contributor

@jschneier You should be able to download the latest version for macOS, move it to ~/Applications, start it and resume where you left off. Just to be sure, please make a backup of your Signal profile by closing the app and then making a copy of ~/Library/Application Support/Signal.

@jschneier
Copy link

Great, that works, thanks.

@stale
Copy link

stale bot commented Sep 23, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests