Open Bug 1831233 Opened 2 years ago Updated 1 year ago

When update extension via install .xpi file, need to disable it first, otherwise update will not success

Categories

(Toolkit :: Add-ons Manager, defect, P3)

defect

Tracking

()

UNCONFIRMED

People

(Reporter: Tom25519, Unassigned)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/112.0

Steps to reproduce:

I want to update extension via drag-and-drop .xpi file to tab bar.

Actual results:

I need to disable it first, otherwise update will not success (it is still old version).

Expected results:

When user drag-and-drop .xpi file to tab bar, and click "Add", Firefox should update extension immediately first.
If firefox must to disable it first, should auto do that and then update it, finally re-enable it (if extension have been disabled, don't re-enable it).

Hello,

I could not reproduce the issue on the latest Nightly (114.0a1/20230507095340), Beta (113.0/20230504192738) or Release (112.0.2/20230424110519) under Windows 10 x64.

Having version 0.0.2.4 of Youtube Audio installed (https://addons.mozilla.org/en-US/firefox/addon/youtube-audio/versions/?utm_content=search&utm_medium=referral&utm_source=addons.mozilla.org) and version 0.0.2.5 locally downloaded, dragging and dropping the 0.0.2.5 xpi onto the tab bar did properly update the extension from 0.0.2.4 to 0.0.2.5 after I clicked “Add”. I did not have to disable the original installation first in order to update the extension.

Can you tell me what extension you tried to update when you observed this behavior you are experiencing? I will attempt to reproduce the issue once more with the same extension you used and see if results differ. Thank you !

Flags: needinfo?(Tom25519)

It happens when I try to update uBlock Origin from 1.48.4 to 1.49.0 and 1.49.0 to 1.49.2.

Flags: needinfo?(Tom25519)

uBlock Origin registers a listener for the runtime.onUpdateAvailable event to postpone updates until the browser restart, to minimize the chance of causing broken behavior on existing pages. When the extension is disabled, the listener is not present and therefore the update is applied immediately.

If you are willing to accept the potential breakage, visit about:addons, go to the card of uBlock Origin and click on the button to update immediately.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID

(In reply to Rob Wu [:robwu] from comment #3)

If you are willing to accept the potential breakage, visit about:addons, go to the card of uBlock Origin and click on the button to update immediately.

Sorrry, I forget to describe it in previous post. I mean even I click on the button to update immediately, and restart firefox, it still doesn't update.

Status: RESOLVED → UNCONFIRMED
Flags: needinfo?(rob)
Resolution: INVALID → ---

Hello,

Re-tested using uBlock Origin on the latest Nightly (115.0a1/20230508214159), Beta (114.0b1/20230508175934) and Release (112.0.2/20230424110519) on Windows 10 x64.

Performing the steps from Comment 1 (but with uBlock Origin instead of Youtube Audio) and clicking the “Update Now” button successfully updates the extension to the version I dragged and dropped onto the tab bar.

Also, as per Comment 2, I also tried with the mentioned combinations of versions and also updated from 1.48.4 to 1.49.2 with success.

So on my end, I cannot reproduce the issue.

Attached video 2023-05-09 17-58-58.mkv

(In reply to Alex Cornestean from comment #5)

Hello,

Re-tested using uBlock Origin on the latest Nightly (115.0a1/20230508214159), Beta (114.0b1/20230508175934) and Release (112.0.2/20230424110519) on Windows 10 x64.

Performing the steps from Comment 1 (but with uBlock Origin instead of Youtube Audio) and clicking the “Update Now” button successfully updates the extension to the version I dragged and dropped onto the tab bar.

Also, as per Comment 2, I also tried with the mentioned combinations of versions and also updated from 1.48.4 to 1.49.2 with success.

So on my end, I cannot reproduce the issue.

Above file is a screen record that I try to update NoScript from 11.4.20 to 11.4.21. It fails.

Based on the provided video I tried once more to reproduce the issue on the latest Nightly (115.0a1/20230509215006) on both Windows 10 x64 and Windows 11 x64, however without success.

I tried with both uBlock Origin 1.49.0 updated to 1.49.2 and NoScript 11.4.20 updated to 11.4.21 in a private window as per the video, with the original installations allowed to run in private windows from the start, also as per what is shown in the video.

Results are as follows:

  • NoScript
  1. Initially, version 11.4.20 is installed from AMO and allowed access to private windows
  2. Once I drag and drop the updated version onto the tab bar, the installation panel is shown and I add the updated version of the extension.
  3. The next panel that appears, the one confirming the extension was added, is different from the one shown in the video. On my end, I have an “Allow the extension to run in Private Windows” checkbox that is selected by default, as opposed to what I see in your video, which appears to be a completely different panel altogether.

Questions:

  • Did you modify any prefs by any chance so that the panel I mentioned on my end gets bypassed?
  • Can you try reproducing the issue with a new profile?
  • Can you translate the second panel that appears on you end? The one I mentioned on Point (3) above?
  1. Once the second panel that appears on my end is dismissed, the extension is updated and there is no “Update Now” button shown at all on the extension page in about:addons

The same results were obtained on both Windows 10 and Windows 11.

See the attached video for more details.

  • uBlock Origin
  1. Initially, version 1.49.0 is installed from AMO and allowed access to private windows
  2. Once I drag and drop the updated version onto the tab bar, the installation panel is shown and I add the updated version of the extension.
  3. I return to the extension page in about:addons and the “Update Now” button is shown. Once I click it, the extension gets updated to the latest version.
  4. I get the confirmation panel that the extension was added.

The same results were obtained on both Windows 10 and Windows 11.

See the attached video for more details.

To be more thorough, I tested the scenario where the extensions were installed in normal browsing mode, allowed access to private windows and then I opened a new private window where I updated the extensions AND the scenario where I started with opening a private window, installed the extensions in the private window with allowing access to private windows for the extensions and then I updated the extensions.

Flags: needinfo?(Tom25519)
Attached video 2023-05-10_11h30_52.mp4
Attached video 2023-05-10_12h21_00.mp4

(In reply to Alex Cornestean from comment #8)
Questions:

  • Did you modify any prefs by any chance so that the panel I mentioned on my end gets bypassed?
    No.
  • Can you try reproducing the issue with a new profile?
    Yes. It still happens after I refresh firefox in about:support.
  • Can you translate the second panel that appears on you end? The one I mentioned on Point (3) above?
    uBlock Origin could not be installed because Nightly cannot modify the needed file.
Flags: needinfo?(Tom25519)

After refresh firefox, I install NoScript 11.4.20, and then update it to 11.4.21 (I haven't open any website), it still says "NoScript could not be installed because Nightly cannot modify the needed file."

Hello,

Based on the answers provided in Comment 11 and Comment 12, particularly the case of the panel you translated, it appears that the issue lies somewhere else and not in the extension update process per se.

I’ll try and investigate further and update the report with the new findings.

(In reply to Tom25519 from comment #12)

After refresh firefox, I install NoScript 11.4.20, and then update it to 11.4.21 (I haven't open any website), it still says "NoScript could not be installed because Nightly cannot modify the needed file."

Do you see any errors in the Browser Console? (Ctrl-Shift-J)?

Where is the profile directory located?

Flags: needinfo?(rob)

(In reply to Rob Wu [:robwu] from comment #14)

(In reply to Tom25519 from comment #12)

After refresh firefox, I install NoScript 11.4.20, and then update it to 11.4.21 (I haven't open any website), it still says "NoScript could not be installed because Nightly cannot modify the needed file."

Do you see any errors in the Browser Console? (Ctrl-Shift-J)?

Where is the profile directory located?

1684204359131 addons.xpi WARN Failed to install C:\Users\Admin\Desktop\noscript-11.4.21.xpi from file:///C:/Users/Admin/Desktop/noscript-11.4.21.xpi to C:\Users\Admin\AppData\Roaming\Mozilla\Firefox\Profiles\cbuwh2hx.default-nightly-1683859846790\extensions\staged: NotAllowedError: Could not remove the file at C:\Users\Admin\AppData\Roaming\Mozilla\Firefox\Profiles\cbuwh2hx.default-nightly-1683859846790\extensions\staged{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi No traceback available

1684204359136 addons.xpi WARN Failed to set permissions 755 on C:\Users\Admin\AppData\Roaming\Mozilla\Firefox\Profiles\cbuwh2hx.default-nightly-1683859846790\extensions\staged: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIFile.permissions]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource://gre/modules/addons/XPIInstall.jsm :: setFilePermissions :: line 1048" data: no] Stack trace: setFilePermissions()@resource://gre/modules/addons/XPIInstall.jsm:1048
cleanStagingDir()@resource://gre/modules/addons/XPIInstall.jsm:3255
releaseStagingDir()@resource://gre/modules/addons/XPIInstall.jsm:3217
startInstall()@resource://gre/modules/addons/XPIInstall.jsm:1920

1684204359136 addons.xpi WARN Failed to remove staging dir: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIFile.remove]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/addons/XPIInstall.jsm :: cleanStagingDir :: line 3256" data: no] Stack trace: cleanStagingDir()@resource://gre/modules/addons/XPIInstall.jsm:3256
releaseStagingDir()@resource://gre/modules/addons/XPIInstall.jsm:3217
startInstall()@resource://gre/modules/addons/XPIInstall.jsm:1920

By the way, this bug seems doesn't always reproduce.

Today, I update uBlock Origin from 1.49.2 to 1.50.0, it update secussfully, but it seems have an error in the Browser Console:

1686927298038 addons.xpi ERROR Failed to remove file C:\Users\Admin\AppData\Roaming\Mozilla\Firefox\Profiles\7lgcc4b0.default-release\extensions\trash\uBlock0@raymondhill.net.xpi: [Exception... "Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIFile.remove]" nsresult: "0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)" location: "JS frame :: resource://gre/modules/addons/XPIInstall.jsm :: recursiveRemove :: line 1014" data: no] Stack trace: recursiveRemove()@resource://gre/modules/addons/XPIInstall.jsm:1014
recursiveRemove()@resource://gre/modules/addons/XPIInstall.jsm:1028
installAddon()@resource://gre/modules/addons/XPIInstall.jsm:3346
install()@resource://gre/modules/addons/XPIInstall.jsm:1812
update()@resource://gre/modules/addons/XPIProvider.jsm:2161 Log.sys.mjs:722
append resource://gre/modules/Log.sys.mjs:722
log resource://gre/modules/Log.sys.mjs:376
error resource://gre/modules/Log.sys.mjs:384
recursiveRemove resource://gre/modules/addons/XPIInstall.jsm:1018
forEach self-hosted:203
recursiveRemove resource://gre/modules/addons/XPIInstall.jsm:1028
installAddon resource://gre/modules/addons/XPIInstall.jsm:3346
install resource://gre/modules/addons/XPIInstall.jsm:1812
update resource://gre/modules/addons/XPIProvider.jsm:2161
InterpretGeneratorResume self-hosted:1359
AsyncFunctionNext self-hosted:756

Now I using Firefox 114.0.1.

The errors in comment 15 and comment 16 show that Firefox is unable to remove/replace the update files. This does not happen under normal circumstances.

  • Have you ever used external software that modified your profile directory?
  • Have you ever manually moved/copied/changed the contents of your profile directory?
  • Is the profile directory located on a very normal location (e.g. on your disk, opposed to a network share)?
  • Have you ever launched Firefox with distinct / more privileges than your current user?
  • Is your hard disk / SSD defective? The observed issue can also be triggered by disk corruption.

If your issue is only caused by incorrect permissions, you can try to fix your state as follows:

  1. Quit Firefox.
  2. Open Explorer with C:\Users\Admin\AppData\Roaming\Mozilla\Firefox\Profiles\7lgcc4b0.default-release\extensions\
  3. Verify that your user has the right permissions to read, modify and delete files in that directory.
    (if this is a broader issue, you may have to check that for every other file in the profile directory).

If all else fails, you can also try to Refresh Firefox - https://support.mozilla.org/en-US/kb/refresh-firefox-reset-add-ons-and-settings

PS. I'm closing this bug since there is no indication of this being an actionable Firefox issue.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → INVALID

(In reply to Rob Wu [:robwu] from comment #18)

The errors in comment 15 and comment 16 show that Firefox is unable to remove/replace the update files. This does not happen under normal circumstances.

  • Have you ever used external software that modified your profile directory?
    No.
  • Have you ever manually moved/copied/changed the contents of your profile directory?
    No.
  • Is the profile directory located on a very normal location (e.g. on your disk, opposed to a network share)?
    No.
  • Have you ever launched Firefox with distinct / more privileges than your current user?
    No.
  • Is your hard disk / SSD defective? The observed issue can also be triggered by disk corruption.
    No.
    If your issue is only caused by incorrect permissions, you can try to fix your state as follows:
  1. Quit Firefox.
  2. Open Explorer with C:\Users\Admin\AppData\Roaming\Mozilla\Firefox\Profiles\7lgcc4b0.default-release\extensions\
  3. Verify that your user has the right permissions to read, modify and delete files in that directory.
    (if this is a broader issue, you may have to check that for every other file in the profile directory).

If all else fails, you can also try to Refresh Firefox - https://support.mozilla.org/en-US/kb/refresh-firefox-reset-add-ons-and-settings

PS. I'm closing this bug since there is no indication of this being an actionable Firefox issue.

Today, I update uBlock Origin (1.49.0->1.49.2), this bug reproduce - even happens after I delete current profile and create a new one,

16:02:40.863 1686988960863 addons.xpi WARN Checking C:\Users\Admin\AppData\Local\Firefox Nightly\distribution\extensions for addons
16:02:41.930 TopSitesFeed: Failed to fetch data from Contile server: can't access property "match", cacheHeader is null TopSitesFeed.jsm:349
16:03:55.602 1686989035601 addons.xpi WARN failed to set lastModifiedTime on C:\Users\Admin\AppData\Roaming\Mozilla\Firefox\Profiles\et809xax.default-nightly\extensions\uBlock0@raymondhill.net.xpi: [Exception... "Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIFile.lastModifiedTime]" nsresult: "0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)" location: "JS frame :: resource://gre/modules/addons/XPIInstall.jsm :: installAddon :: line 3369" data: no] Stack trace: installAddon()@resource://gre/modules/addons/XPIInstall.jsm:3369
install()@resource://gre/modules/addons/XPIInstall.jsm:1813
startInstall/this._startupPromise<()@resource://gre/modules/addons/XPIInstall.jsm:1893
startInstall()@resource://gre/modules/addons/XPIInstall.jsm:1899
16:03:55.683 CustomizableUI: TypeError: can't access property "getAttribute", aNode is null -- resource:///modules/CustomizableUI.sys.mjs:5050 CustomizableUI.sys.mjs:2742
16:04:30.562 NotAllowedError: Could not remove the file at C:\Users\Admin\AppData\Roaming\Mozilla\Firefox\Profiles\et809xax.default-nightly\extensions\staged\uBlock0@raymondhill.net.xpi
16:04:42.731 1686989082731 addons.xpi WARN Failed to postpone install of uBlock0@raymondhill.net: NotAllowedError: Could not remove the file at C:\Users\Admin\AppData\Roaming\Mozilla\Firefox\Profiles\et809xax.default-nightly\extensions\staged\uBlock0@raymondhill.net.xpi No traceback available

Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---

I install Firefox without privilege (click "No" on UAC popup), I don't know it relate to this bug or not.

Workaround:
when this happens,
a) Prompt user that Firefox couldn't update this extension unless disable it, and let user make a decision (disable it and update, then re-enable it or cancel)
b) Just simply disable extension silently, then auto re-enable it after it update.

Does this issue happen all the time?

Or does removing the faulty file manually resolve the issue?

Severity: -- → S4
Component: General → Add-ons Manager
Priority: -- → P3
Product: WebExtensions → Toolkit
Version: Firefox 112 → unspecified

(In reply to Rob Wu [:robwu] from comment #22)

Does this issue happen all the time?

Or does removing the faulty file manually resolve the issue?

When this bug happens, extensions\staged directory will appears in firefox profile folder, new version extension is in it, and the extension could be delete without exit firefox.

I also test on Fenix 130.0.1, this bug could reproduce. I think this bug is not relevant with permission.

(In reply to Tom25519 from comment #24)

I also test on Fenix 130.0.1, this bug could reproduce. I think this bug is not relevant with permission.

Fenix is the name of the Firefox for Android browser. Are you saying that this bug is also happenings on Android...?

(In reply to Rob Wu [:robwu] from comment #25)

(In reply to Tom25519 from comment #24)

I also test on Fenix 130.0.1, this bug could reproduce. I think this bug is not relevant with permission.

Fenix is the name of the Firefox for Android browser. Are you saying that this bug is also happenings on Android...?

Yes.

This bug also happens on Firefox 131.0 on Windows 11 Enterprise LTSC 2024 (24H2) when update uBlock Origin from 1.58.0 to 1.59.0. By the way, I delete system drive to totally remove old program and data, and then reinstall Windows and Firefox.

(In reply to Tom25519 from comment #27)

This bug also happens on Firefox 131.0 on Windows 11 Enterprise LTSC 2024 (24H2) when update uBlock Origin from 1.58.0 to 1.59.0. By the way, I delete system drive to totally remove old program and data, and then reinstall Windows and Firefox.

Oops, I just found that about:addons "Available update" page notificate that uBlock Origin will be update after Firefox restart, after I click "update now", update complete successfully. It also sucess when update uBlock Origin from 1.59.0 to 1.60.0. By the way, I update it via drag and drop .xpi file to address bar. If I don't open about:addons, I won't know I need to click "update now".

Today, I update uBlock Origin from 1.61.0 to 1.61.2 successfully with Firefox 133.0 via drag .xpi file to address bar, the only problem is, Firefox should pop-up to ask user go to about:addons to click "Update now" to update it manually, or ask user update it now in next prompt (I suggest this option).

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: