Skip to content

The file "ShipItState.plist" couldn’t be opened because there is no such file #151

@thughes

Description

@thughes

In an Electron-based app, I encountered an issue where one user was unable to update. The logs in ShipIt_stderr.log showed this message over and over:

Installation error: Error Domain=SQRLShipItRequestErrorDomain Code=2 "Could not read update request" UserInfo=0x7fe4cae09930 {NSLocalizedDescription=Could not read update request, NSUnderlyingError=0x7fe4cae07d50 "The file “ShipItState.plist” couldn’t be opened because there is no such file."}

However, ShipItState.plist did exist, but the two log files had different permissions than the plist file and the update directory:

drwxr-xr-x   7 foo  staff   238B Sep  9 17:16 .
drwx------+ 41 foo  staff   1.4K Sep  9 17:16 ..
-rw-r--r--@  1 foo  staff   6.0K Sep  9 17:24 .DS_Store
-rw-r--r--   1 foo  staff   262B Sep  9 17:16 ShipItState.plis
-rw-r--r--   1 root     staff   195K Sep  9 16:55 ShipIt_stderr.log
-rw-r--r--   1 root     staff     0B Sep  9 16:38 ShipIt_stdout.log
drwx------   4 foo  staff   136B Sep  9 17:24 update.c3etqCW

Doing a chown fixed the issue:

sudo chown foo:staff ShipIt_stderr.log ShipIt_stdout.log

It looks like others are hitting this same issue: atom/atom#2860 (comment)

It looks like SQRLUpdater.m has some logic around running as root/non-root, but if the log files are owned by root and being updated then I would assume it's running as root and should be able to read the ShipItState.plist file that's owned by a non-privileged user:

    NSError *targetWritableError = nil;
            BOOL gotWritable = [targetURL getResourceValue:&targetWritable forKey:NSURLIsWritableKey error:&targetWritableError];

            // If we can't determine whether it can be written, assume nonprivileged and
            // wait for another, more canonical error.
            return [SQRLShipItLauncher launchPrivileged:(gotWritable && !targetWritable.boolValue)];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions