Bug 1745788 Comment 20 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

@bytesized, I usually open Firefox from my taskbar, and as far as I can see that shortcut is correctly leading to the applications folder (i.e when I use "show in Finder"). The Program in the applications folder has the path that I would expect: Macintosh HD > Applications > Firefox.app

Running Firefox directly from applications opens a new window (instead of switching to my already-open one, which is maybe a bit weird?) but checking about:profiles the profile is the correct one and running elevationRequired again gets me the same result.

I've also now got this error in my browser console:
```
BackgroundUpdate: _reasonsToNotScheduleUpdates: Failed to check for Maintenance Service Registry Key: [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIUpdateProcessor.getServiceRegKeyExists]"  nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"  location: "JS frame :: resource://gre/modules/BackgroundUpdate.jsm :: _reasonsToNotScheduleUpdates :: line 243"  data: no]
```
out of curiosity, I tried running the update again with the console open and logging enabled, and I got: 

```
AUS:SVC RestartOnLastWindowClosed.#maybeEnableOrDisable - Enabling
AUS:SVC RestartOnLastWindowClosed.#onLastWindowClose - Last window closed. Starting restart timer
AUS:SVC Creating UpdateService
AUS:SVC Logging current UpdateService status:
AUS:SVC UpdateService.canUsuallyCheckForUpdates - able to check for updates
AUS:SVC UpdateService.canCheckForUpdates - able to check for updates
DEPRECATION WARNING: Calling FileUtils.getDir(..., ..., true) causes main thread I/O and should be avoided especially during startup/shutdown
You may find more details about this deprecation at: https://bugzilla.mozilla.org/show_bug.cgi?id=921157
resource://gre/modules/FileUtils.jsm 70 FileUtils_getDir
resource://gre/modules/UpdateService.jsm 1025 getUpdateDirCreate
resource://gre/modules/UpdateService.jsm 1064 getUpdateFile
resource://gre/modules/UpdateService.jsm 739 getCanApplyUpdates
resource://gre/modules/UpdateService.jsm 3815 get canUsuallyApplyUpdates
resource://gre/modules/UpdateService.jsm 3823 get canApplyUpdates
resource://gre/modules/UpdateService.jsm 4043 AUS__logStatus
resource://gre/modules/UpdateService.jsm 2572 UpdateService
resource://gre/modules/UpdateServiceStub.jsm 104 UpdateServiceStub
Deprecated.jsm:86
AUS:SVC getCanApplyUpdates - testing write access /Users/emcminn/Library/Caches/Mozilla/updates/var/folders/1d/bqbj7_vd3k9crjw2t3f2vjpc0000gn/T/AppTranslocation/A71C7890-7EEB-4F2A-B442-D6917ABE6510/d/Firefox/update.test
AUS:SVC getCanApplyUpdates - bypass the write since elevation can be used on Mac OS X
AUS:SVC getElevationRequired - recursively testing write access on /var/folders/1d/bqbj7_vd3k9crjw2t3f2vjpc0000gn/T/AppTranslocation/A71C7890-7EEB-4F2A-B442-D6917ABE6510/d/Firefox.app
AUS:SVC getElevationRequired - unable to write to application bundle, elevation required. Exception: [Exception... "Component returned failure code: 0x80520013 (NS_ERROR_FILE_READ_ONLY) [nsIFile.isWritable]"  nsresult: "0x80520013 (NS_ERROR_FILE_READ_ONLY)"  location: "JS frame :: resource://gre/modules/UpdateService.jsm :: getElevationRequired :: line 684"  data: no]
AUS:SVC gCanStageUpdatesSession - unable to stage updates because elevation is required.
AUS:SVC getElevationRequired - recursively testing write access on /var/folders/1d/bqbj7_vd3k9crjw2t3f2vjpc0000gn/T/AppTranslocation/A71C7890-7EEB-4F2A-B442-D6917ABE6510/d/Firefox.app
AUS:SVC getElevationRequired - unable to write to application bundle, elevation required. Exception: [Exception... "Component returned failure code: 0x80520013 (NS_ERROR_FILE_READ_ONLY) [nsIFile.isWritable]"  nsresult: "0x80520013 (NS_ERROR_FILE_READ_ONLY)"  location: "JS frame :: resource://gre/modules/UpdateService.jsm :: getElevationRequired :: line 684"  data: no]
AUS:SVC Elevation required: true
AUS:SVC Other instance of the application currently running: false
AUS:SVC Downloading: false
AUS:SVC End of UpdateService status
```
I'm seeing that weird path in there a lot, so maybe you're on to something there!
@bytesized, I usually open Firefox from my dock, and as far as I can see that shortcut is correctly leading to the applications folder (i.e when I use "show in Finder"). The Program in the applications folder has the path that I would expect: Macintosh HD > Applications > Firefox.app

Running Firefox directly from applications opens a new window (instead of switching to my already-open one, which is maybe a bit weird?) but checking about:profiles the profile is the correct one and running elevationRequired again gets me the same result.

I've also now got this error in my browser console:
```
BackgroundUpdate: _reasonsToNotScheduleUpdates: Failed to check for Maintenance Service Registry Key: [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIUpdateProcessor.getServiceRegKeyExists]"  nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"  location: "JS frame :: resource://gre/modules/BackgroundUpdate.jsm :: _reasonsToNotScheduleUpdates :: line 243"  data: no]
```
out of curiosity, I tried running the update again with the console open and logging enabled, and I got: 

```
AUS:SVC RestartOnLastWindowClosed.#maybeEnableOrDisable - Enabling
AUS:SVC RestartOnLastWindowClosed.#onLastWindowClose - Last window closed. Starting restart timer
AUS:SVC Creating UpdateService
AUS:SVC Logging current UpdateService status:
AUS:SVC UpdateService.canUsuallyCheckForUpdates - able to check for updates
AUS:SVC UpdateService.canCheckForUpdates - able to check for updates
DEPRECATION WARNING: Calling FileUtils.getDir(..., ..., true) causes main thread I/O and should be avoided especially during startup/shutdown
You may find more details about this deprecation at: https://bugzilla.mozilla.org/show_bug.cgi?id=921157
resource://gre/modules/FileUtils.jsm 70 FileUtils_getDir
resource://gre/modules/UpdateService.jsm 1025 getUpdateDirCreate
resource://gre/modules/UpdateService.jsm 1064 getUpdateFile
resource://gre/modules/UpdateService.jsm 739 getCanApplyUpdates
resource://gre/modules/UpdateService.jsm 3815 get canUsuallyApplyUpdates
resource://gre/modules/UpdateService.jsm 3823 get canApplyUpdates
resource://gre/modules/UpdateService.jsm 4043 AUS__logStatus
resource://gre/modules/UpdateService.jsm 2572 UpdateService
resource://gre/modules/UpdateServiceStub.jsm 104 UpdateServiceStub
Deprecated.jsm:86
AUS:SVC getCanApplyUpdates - testing write access /Users/emcminn/Library/Caches/Mozilla/updates/var/folders/1d/bqbj7_vd3k9crjw2t3f2vjpc0000gn/T/AppTranslocation/A71C7890-7EEB-4F2A-B442-D6917ABE6510/d/Firefox/update.test
AUS:SVC getCanApplyUpdates - bypass the write since elevation can be used on Mac OS X
AUS:SVC getElevationRequired - recursively testing write access on /var/folders/1d/bqbj7_vd3k9crjw2t3f2vjpc0000gn/T/AppTranslocation/A71C7890-7EEB-4F2A-B442-D6917ABE6510/d/Firefox.app
AUS:SVC getElevationRequired - unable to write to application bundle, elevation required. Exception: [Exception... "Component returned failure code: 0x80520013 (NS_ERROR_FILE_READ_ONLY) [nsIFile.isWritable]"  nsresult: "0x80520013 (NS_ERROR_FILE_READ_ONLY)"  location: "JS frame :: resource://gre/modules/UpdateService.jsm :: getElevationRequired :: line 684"  data: no]
AUS:SVC gCanStageUpdatesSession - unable to stage updates because elevation is required.
AUS:SVC getElevationRequired - recursively testing write access on /var/folders/1d/bqbj7_vd3k9crjw2t3f2vjpc0000gn/T/AppTranslocation/A71C7890-7EEB-4F2A-B442-D6917ABE6510/d/Firefox.app
AUS:SVC getElevationRequired - unable to write to application bundle, elevation required. Exception: [Exception... "Component returned failure code: 0x80520013 (NS_ERROR_FILE_READ_ONLY) [nsIFile.isWritable]"  nsresult: "0x80520013 (NS_ERROR_FILE_READ_ONLY)"  location: "JS frame :: resource://gre/modules/UpdateService.jsm :: getElevationRequired :: line 684"  data: no]
AUS:SVC Elevation required: true
AUS:SVC Other instance of the application currently running: false
AUS:SVC Downloading: false
AUS:SVC End of UpdateService status
```
I'm seeing that weird path in there a lot, so maybe you're on to something there!
@bytesized, I usually open Firefox from my dock, and as far as I can see that shortcut is correctly leading to the applications folder (i.e when I use "show in Finder"). The Program in the applications folder has the path that I would expect: Macintosh HD > Applications > Firefox.app

Running Firefox directly from applications opens a new window (instead of switching to my already-open one, which is maybe a bit weird?) but checking about:profiles the profile is the correct one and running elevationRequired again gets me the same result.

I've also now got this error in my browser console:
```
BackgroundUpdate: _reasonsToNotScheduleUpdates: Failed to check for Maintenance Service Registry Key: [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIUpdateProcessor.getServiceRegKeyExists]"  nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"  location: "JS frame :: resource://gre/modules/BackgroundUpdate.jsm :: _reasonsToNotScheduleUpdates :: line 243"  data: no]
```
out of curiosity, I tried running the update again with the console open and logging enabled, and I got: 

```
AUS:SVC RestartOnLastWindowClosed.#maybeEnableOrDisable - Enabling
AUS:SVC RestartOnLastWindowClosed.#onLastWindowClose - Last window closed. Starting restart timer
AUS:SVC Creating UpdateService
AUS:SVC Logging current UpdateService status:
AUS:SVC UpdateService.canUsuallyCheckForUpdates - able to check for updates
AUS:SVC UpdateService.canCheckForUpdates - able to check for updates
DEPRECATION WARNING: Calling FileUtils.getDir(..., ..., true) causes main thread I/O and should be avoided especially during startup/shutdown
You may find more details about this deprecation at: https://bugzilla.mozilla.org/show_bug.cgi?id=921157
resource://gre/modules/FileUtils.jsm 70 FileUtils_getDir
resource://gre/modules/UpdateService.jsm 1025 getUpdateDirCreate
resource://gre/modules/UpdateService.jsm 1064 getUpdateFile
resource://gre/modules/UpdateService.jsm 739 getCanApplyUpdates
resource://gre/modules/UpdateService.jsm 3815 get canUsuallyApplyUpdates
resource://gre/modules/UpdateService.jsm 3823 get canApplyUpdates
resource://gre/modules/UpdateService.jsm 4043 AUS__logStatus
resource://gre/modules/UpdateService.jsm 2572 UpdateService
resource://gre/modules/UpdateServiceStub.jsm 104 UpdateServiceStub
Deprecated.jsm:86
AUS:SVC getCanApplyUpdates - testing write access /Users/emcminn/Library/Caches/Mozilla/updates/var/folders/1d/bqbj7_vd3k9crjw2t3f2vjpc0000gn/T/AppTranslocation/A71C7890-7EEB-4F2A-B442-D6917ABE6510/d/Firefox/update.test
AUS:SVC getCanApplyUpdates - bypass the write since elevation can be used on Mac OS X
AUS:SVC getElevationRequired - recursively testing write access on /var/folders/1d/bqbj7_vd3k9crjw2t3f2vjpc0000gn/T/AppTranslocation/A71C7890-7EEB-4F2A-B442-D6917ABE6510/d/Firefox.app
AUS:SVC getElevationRequired - unable to write to application bundle, elevation required. Exception: [Exception... "Component returned failure code: 0x80520013 (NS_ERROR_FILE_READ_ONLY) [nsIFile.isWritable]"  nsresult: "0x80520013 (NS_ERROR_FILE_READ_ONLY)"  location: "JS frame :: resource://gre/modules/UpdateService.jsm :: getElevationRequired :: line 684"  data: no]
AUS:SVC gCanStageUpdatesSession - unable to stage updates because elevation is required.
AUS:SVC getElevationRequired - recursively testing write access on /var/folders/1d/bqbj7_vd3k9crjw2t3f2vjpc0000gn/T/AppTranslocation/A71C7890-7EEB-4F2A-B442-D6917ABE6510/d/Firefox.app
AUS:SVC getElevationRequired - unable to write to application bundle, elevation required. Exception: [Exception... "Component returned failure code: 0x80520013 (NS_ERROR_FILE_READ_ONLY) [nsIFile.isWritable]"  nsresult: "0x80520013 (NS_ERROR_FILE_READ_ONLY)"  location: "JS frame :: resource://gre/modules/UpdateService.jsm :: getElevationRequired :: line 684"  data: no]
AUS:SVC Elevation required: true
AUS:SVC Other instance of the application currently running: false
AUS:SVC Downloading: false
AUS:SVC End of UpdateService status
```
I'm seeing that weird path in there a lot, so maybe you're on to something there!

EDIT: 
I looked up AppTranslocation on a hunch, and it turns out it's a security feature introduced in MacOS Sierra. Long story short, if you install an application directly to the applications folder and then *never move it*, MacOS helpfully randomizes the path every time you open the application. Which breaks auto-updating (on purpose?!?). See here: https://wiki.keyboardmaestro.com/assistance/Translocation_Problem

I'm going to try the fix steps and report back.
@bytesized, I usually open Firefox from my dock, and as far as I can see that shortcut is correctly leading to the applications folder (i.e when I use "show in Finder"). The Program in the applications folder has the path that I would expect: Macintosh HD > Applications > Firefox.app

Running Firefox directly from applications opens a new window (instead of switching to my already-open one, which is maybe a bit weird?) but checking about:profiles the profile is the correct one and running elevationRequired again gets me the same result.

I've also now got this error in my browser console:
```
BackgroundUpdate: _reasonsToNotScheduleUpdates: Failed to check for Maintenance Service Registry Key: [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIUpdateProcessor.getServiceRegKeyExists]"  nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"  location: "JS frame :: resource://gre/modules/BackgroundUpdate.jsm :: _reasonsToNotScheduleUpdates :: line 243"  data: no]
```
out of curiosity, I tried running the update again with the console open and logging enabled, and I got: 

```
AUS:SVC RestartOnLastWindowClosed.#maybeEnableOrDisable - Enabling
AUS:SVC RestartOnLastWindowClosed.#onLastWindowClose - Last window closed. Starting restart timer
AUS:SVC Creating UpdateService
AUS:SVC Logging current UpdateService status:
AUS:SVC UpdateService.canUsuallyCheckForUpdates - able to check for updates
AUS:SVC UpdateService.canCheckForUpdates - able to check for updates
DEPRECATION WARNING: Calling FileUtils.getDir(..., ..., true) causes main thread I/O and should be avoided especially during startup/shutdown
You may find more details about this deprecation at: https://bugzilla.mozilla.org/show_bug.cgi?id=921157
resource://gre/modules/FileUtils.jsm 70 FileUtils_getDir
resource://gre/modules/UpdateService.jsm 1025 getUpdateDirCreate
resource://gre/modules/UpdateService.jsm 1064 getUpdateFile
resource://gre/modules/UpdateService.jsm 739 getCanApplyUpdates
resource://gre/modules/UpdateService.jsm 3815 get canUsuallyApplyUpdates
resource://gre/modules/UpdateService.jsm 3823 get canApplyUpdates
resource://gre/modules/UpdateService.jsm 4043 AUS__logStatus
resource://gre/modules/UpdateService.jsm 2572 UpdateService
resource://gre/modules/UpdateServiceStub.jsm 104 UpdateServiceStub
Deprecated.jsm:86
AUS:SVC getCanApplyUpdates - testing write access /Users/emcminn/Library/Caches/Mozilla/updates/var/folders/1d/bqbj7_vd3k9crjw2t3f2vjpc0000gn/T/AppTranslocation/A71C7890-7EEB-4F2A-B442-D6917ABE6510/d/Firefox/update.test
AUS:SVC getCanApplyUpdates - bypass the write since elevation can be used on Mac OS X
AUS:SVC getElevationRequired - recursively testing write access on /var/folders/1d/bqbj7_vd3k9crjw2t3f2vjpc0000gn/T/AppTranslocation/A71C7890-7EEB-4F2A-B442-D6917ABE6510/d/Firefox.app
AUS:SVC getElevationRequired - unable to write to application bundle, elevation required. Exception: [Exception... "Component returned failure code: 0x80520013 (NS_ERROR_FILE_READ_ONLY) [nsIFile.isWritable]"  nsresult: "0x80520013 (NS_ERROR_FILE_READ_ONLY)"  location: "JS frame :: resource://gre/modules/UpdateService.jsm :: getElevationRequired :: line 684"  data: no]
AUS:SVC gCanStageUpdatesSession - unable to stage updates because elevation is required.
AUS:SVC getElevationRequired - recursively testing write access on /var/folders/1d/bqbj7_vd3k9crjw2t3f2vjpc0000gn/T/AppTranslocation/A71C7890-7EEB-4F2A-B442-D6917ABE6510/d/Firefox.app
AUS:SVC getElevationRequired - unable to write to application bundle, elevation required. Exception: [Exception... "Component returned failure code: 0x80520013 (NS_ERROR_FILE_READ_ONLY) [nsIFile.isWritable]"  nsresult: "0x80520013 (NS_ERROR_FILE_READ_ONLY)"  location: "JS frame :: resource://gre/modules/UpdateService.jsm :: getElevationRequired :: line 684"  data: no]
AUS:SVC Elevation required: true
AUS:SVC Other instance of the application currently running: false
AUS:SVC Downloading: false
AUS:SVC End of UpdateService status
```
I'm seeing that weird path in there a lot, so maybe you're on to something there!

EDIT: 
I looked up AppTranslocation on a hunch, and it turns out it's a security feature introduced in MacOS Sierra. Long story short, if you install an application directly to the applications folder and then *never move it*, MacOS helpfully randomizes the path every time you open the application. Which breaks auto-updating (on purpose?!?). See here: https://wiki.keyboardmaestro.com/assistance/Translocation_Problem

~~I'm going to try the fix steps and report back.~~ IT WORKED. Had to log back in to sync & re-enable my profile after moving the application, but the update ran correctly with no permissions needed.

Back to Bug 1745788 Comment 20