Last Comment Bug 246687 - Firefox gets stuck at Finishing Extension Installation if the same extension is installed with /some/ changes.
: Firefox gets stuck at Finishing Extension Installation if the same extension ...
Status: RESOLVED FIXED
fixed-aviary1.0
:
Product: Toolkit
Classification: Components
Component: Add-ons Manager (show other bugs)
: unspecified
: x86 All
: -- critical with 11 votes (vote)
: ---
Assigned To: Ben Goodger (use ben at mozilla dot org for email)
: Ben Goodger (use ben at mozilla dot org for email)
Mentors:
: 246658 248013 254774 (view as bug list)
Depends on:
Blocks: 248125
  Show dependency treegraph
 
Reported: 2004-06-14 13:05 PDT by Dorando
Modified: 2008-07-31 01:49 PDT (History)
28 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (31.57 KB, application/x-xpinstall)
2004-06-14 13:07 PDT, Dorando
no flags Details
Make zip file extraction truncate any existing file (patch against Aviary) (1.00 KB, patch)
2004-06-16 12:22 PDT, PikeUK
dveditz: review+
bugs: superreview+
Details | Diff | Splinter Review

Description Dorando 2004-06-14 13:05:27 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.6) Gecko/20040210 Firefox/0.8
Build Identifier: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.7) Gecko/20040614 Firefox/0.8.0+

I've not the slightest idea what changes trigger this exactly...

Reproducible: Always
Steps to Reproduce:
1. Install Magpie 3.11 from http://www.bengoodger.com/software/tabloader/
2. Restart
3. Install Testcase
4. Restart
Actual Results:  
Firefox is stuck at Finishing Extension Installation

Expected Results:  
Normal Startup

-console -safe-mode

*** Failed to load overlay chrome://tabdownloader/content/tabloaderOverlay.xul

zip builds

Also fails with
Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.7) Gecko/20040613 Firefox/0.8.0+
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040614
Firefox/0.8.0+
Comment 1 Dorando 2004-06-14 13:07:12 PDT
Created attachment 150735 [details]
testcase

This is Magpie 3.1.1 except:
- em:version changed to 3.1.1+ in install.rdf
- the license text from chome/tabdownloader.jar/tabdownloader/contents.rdf was
removed
Comment 2 PikeUK 2004-06-14 14:05:59 PDT
Confirming the steps to reproduce cause the "Finishing Extensions" box to appear:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040611
Firefox/0.8.0+

I can only hope someone sees this before 0.9 is finished else releasing
extension updates during the 0.9 era is going to be pretty frightening in case
someone's profile gets nuked.

p.s. I think I've seen this issue before with one of my own extensions, but
didn't realise the cause until seeing this bug.
Comment 3 Kent 2004-06-15 06:21:34 PDT
I am also having this problem after only reinstalling Googlebar and Tabbed
Browser extensions.  It only started happening with .9rc and .9.  Workaround is
to start up two sessions.  The first one will hang, but the second will work as
it should.
Comment 4 Mark Chandler 2004-06-15 10:03:58 PDT
The reason for this appears to be that the JAR file written to the extension's
directory is corrupted. Is the EM using the filesize from the original JAR
rather than the new one?
Comment 5 oliv 2004-06-15 10:08:34 PDT
same here with Firfox 0.9 windows XP, Mozilla/5.0 (windows; U; Windows NT 5.1;
en-US; rv:1.7) Gecko/20040614 Firefox/0.9

Added extensions were radial context, tabbrowser preferences
Comment 6 Keith Lea 2004-06-15 14:40:10 PDT
This happened to me too, but not because I installed the same extension twice. I
installed:
1. IE View
2. Javascript Console Status
3. Web Developer
4. Download Manager Tweak
5. Firesomething
6. undo close tab

Now it's stuck no matter how long I wait. I even tried to uninstall the
extensions, and no matter how many times I restart, they are all still listed in
the extensions manager with "This item will be uninstalled after you restart
Firefox."
Comment 7 Greg K Nicholson [:gkn] 2004-06-15 14:48:45 PDT
(In reply to comment #6)
> This happened to me too, but not because I installed the same extension twice.
> Now it's stuck no matter how long I wait. I even tried to uninstall the
> extensions, and no matter how many times I restart, they are all still listed in
> the extensions manager with "This item will be uninstalled after you restart
> Firefox."

Me too - even with completely clean profile/program directories. I did attempt
to install lots at once, if it makes any difference.

Then, after another clearout, I could install extensions properly; I installed
the first few one at a time, and then about seven or eight at once - no error.

Weird.
Comment 8 jim9000 2004-06-15 16:15:32 PDT
This is also happening on Linux (Fedora Core 2). OS should probably be changed
to All.

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040615 Firefox/0.9

This happened to me when I tried to install the Adblock extension from Mozilla
Update. After deleting the extensions directory from my profile, I was able to
install the extension again without any problems.

Many others are having problems with this. See
http://forums.mozillazine.org/viewtopic.php?t=85021
Comment 9 oliv 2004-06-16 01:44:42 PDT
Could this bug and bug#243743 be duplicates?

Also, on MacOS there is at least one report of such a bug: #246935
Comment 10 PikeUK 2004-06-16 01:45:16 PDT
(In reply to comment #4)
> The reason for this appears to be that the JAR file written to the extension's
> directory is corrupted. Is the EM using the filesize from the original JAR
> rather than the new one?

Good catch, the chrome package installation is throwing NS_ERROR_FILE_CORRUPTED.
What's happening is that the extract function from nsIZipReader doesn't truncate
the existing file. If an updated file is smaller than the previous version, the
old file is only partly overwritten by the new one, and at the end is a lot of
junk left over from the old version.

Two obvious fixes (not necessarily the best, just obvious to me) are either make
extract() truncate the file (I think this is the implementation being used but I
could be wrong):
http://lxr.mozilla.org/seamonkey/source/modules/libjar/nsJAR.cpp#278

Change:
rv = localFile->OpenNSPRFileDesc(PR_RDWR | PR_CREATE_FILE, 0664, &fd);

to:
rv = localFile->OpenNSPRFileDesc(PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE, 0664, &fd);

(I haven't tested that one since I'm not near a build environment.)

Or else everywhere the EM uses this:
zipReader.extract(entry, file)

Add the following line in front:
if (file.exists()) file.remove(false);

(This one WFM with the testcase in this bug.)

This also suggests an obvious precaution to extension authors during the 0.9
era, make sure every file in an extension update is at least as large as the
previous version.
Comment 11 Bernard L. Mac Arthur 2004-06-16 05:10:02 PDT
Pike, I read your comment, but I am not sure how to implement what you 
suggest.  Are there any other workarounds?
Comment 12 PikeUK 2004-06-16 09:06:52 PDT
(In reply to comment #11)
> Pike, I read your comment, but I am not sure how to implement what you 
> suggest.  Are there any other workarounds?

If you are suffering from this problem you can either start Firefox in safe mode
(there should be an entry in the Start Menu) and uninstall your extensions, or
find your profile folder and delete the "extensions" sub-folder.

If you need more help you can ask on http://forums.mozillazine.org
Comment 13 PikeUK 2004-06-16 12:22:31 PDT
Created attachment 150963 [details] [diff] [review]
Make zip file extraction truncate any existing file (patch against Aviary)

This seems to work for me and I can't think of any reason not to truncate but I
could be way off.
Comment 14 e|vo 2004-06-16 16:15:34 PDT
same for me with Firfox 0.9 Windows XP, Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:1.7) Gecko/20040614 Firefox/0.9;
but after I tried to uninstall an extension that was listed twice in the
extension list. I think it was User Agent Switcher and uninstalled another one
-> JavaScript Console Status 1.5.
User Agent Switcher is still listed twice, one with the three hints (homepage,
blabla...), the other without any.
I installed all the extensions from update.mozilla.org

All ext. listed:
Web Developer 0.8
User Agent Switcher 0.4
DOM Inspector 1.0
Paste and Go 0.3.1
MozFBRH 0.8.3
CuteMenus 0.3
Comment 15 T.M 2004-06-17 04:53:33 PDT
Same probelm here with this firefox 0.9 and linux (mandrake 10.0) 
 
This error comes no matter what you do with your extension. If you only 
install one extension it comes at the next when you start the browser. 
 
I tried to unistall and then re-install and I deleted profile folders ect. but 
this bug stays. 
Comment 16 Michael Lefevre 2004-06-17 05:31:20 PDT
*** Bug 246658 has been marked as a duplicate of this bug. ***
Comment 17 abs 2004-06-17 21:41:12 PDT
i have the same problem. prob coz of installing and extension twice. upgraded
from 2004-06-15-10-0.9 to 2004-06-17-10-0.9. showed web-dev extension was
old/disabled. installed it again. clicked on the old install in the extension
manager and then uninstall, was marked as 'will be uninstalled after restart'.
new one was marked as ''will be installed after restart'. then i got the
problem. as of now, starting ff again opens a window so i can click the x on the
message box that appears first and continue using ff.
Comment 18 Gary 2004-06-19 13:48:11 PDT
This bug effects me also. I didn't have any trouble until I tried to use the
branch build from today, 6-19. I tried to install the single window extension
and when I restarted Firefox, it gave me the "Firefox is finished installing
extensions, this may take a few minutes" message and stayed there. This was with
the profile that I created when 0.9 came out. I then created a new profile and
everything would start up just fine, but when I tried to install All in One
Gestures and restarted Firefox, it didn't install. Under this extension in the
extension manager, it said that it would be installed when I restarted Firefox,
but it never would install. I got the same thing when I tried to install TBE.
Only way I got around it was to uninstall this build and reinstall 0.9 and
created a new profile. Everything when back to normal then.
Comment 19 Zach Spoelstra 2004-06-21 15:57:17 PDT
*** Bug 248013 has been marked as a duplicate of this bug. ***
Comment 20 Phillip 2004-06-22 06:20:39 PDT
After getting this bug I tried unistalling, and deleting the entire directory,
but when I reinstalled it was all there still giving me the same error, and with
the same extensions showing up.
Comment 21 PikeUK 2004-06-22 06:36:32 PDT
This bug seems to be morphing into a general bug about "Finishing Extension
Installation", it is (or at least used to be) about just one specific cause,
i.e. overwriting an existing extension with an updated version of the same
extension.

If you can reproducable get the error message when doing something other than
updating an extension then that is probably a different bug.
Comment 22 Phillip 2004-06-22 06:58:12 PDT
I tired putting it as a different bug, however it was marked as a duplicate and
sent here.
Comment 23 Michael Lefevre 2004-06-22 07:09:40 PDT
Ok, I've reopened both the dupes.

To clarify - this bug is only for the case where someone installs an extension,
and then installs a new version of the same extension.  Bug 248013 is for the
case where this happens after installing the same extension twice.  Not sure
about the other bug...

Ideally, all these issues would be fixed by Firefox having the ability to
recover from these situations - counting on extensions to behave correctly, at
the risk of pretty much losing a profile if they don't, is not good.
Comment 24 Matthew Trent 2004-06-23 11:40:02 PDT
I'm going to paste what somebody else wrote on the MozillaZine forums and 
describes a similar problem to mine: 
 
--- begin paste 
I've downloaded the Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) 
Gecko/20040619 Firefox/0.9.0+ build, and visiting update.mozilla.org, I can't 
install any extensions except Adblock Sad 
 
I've tried (interspersed with deleting profile +/- program folder): 
- setting the browser version thingy to 0.9 instead of 0.9.0+ 
- installing one extension (various ones) from the website, then restarting 
Firefox 
- installing more than one at a time from the website, then restarting Firefox 
- saving the xpi files to my hard drive (the website is soooo slooow anyway) 
and drag-dropping one into the browser window, then restarting Firefox. 
 
Most times when I go back into the EM I just get a message like "Plain Text 
Links - this extension will be installed when Firefox is restarted". I've made 
sure no firefox processes are running, logged off and logged back on, and 
restarted my machine (P3 1GHz Win XP). 
 
I deleted my old Firefox program folder (was using 0314 build, am thinking of 
recovering it from the recycle bin) and deleted my profile folders (Mozilla 
(empty) and Firefox) completely. Actually, I've just remembered that I didn't 
delete the cache as that's on a separate drive... but surely that wouldn't be 
the problem? 
 
I've uninstalled my new Firefox build (Add/Remove programs method), deleted 
the profile, reinstalled, and reinstalled extensions (have tried with 6, all 
from the update.mozilla.org site and meant to be compatible), and still no 
luck. 
 
Sometimes I get a box instead of a browser window, that says something like 
"Firefox is finishing installing extensions, this may take a few minutes" - 
well I've left that a few minutes with no CPU activity and had to close it and 
delete my profile to get Firefox to start again. 
 
So - HELP! Smile Please!! 
 
Thanks for any suggestions! 
 
-- Jon (jdavtz) 
--- end paste 
 
My own comments: 
 
With a CVS compile (06/22-23/04, on Debian unstable), I can't get any 
extensions to finish installing. I'm always left with "This item will be 
installed after you restart Firefox.", no matter what extension I try and how 
many times I restart Firefox. With official 0.9, some extensions will install, 
but sooner or later I end up with either the pop-up window saying something 
about finishing the installation (which never goes away...), or a browser that 
just hangs and won't start at all. Basically, extensions just aren't 
working... 
 
I've tried the patch that's attached to this bug with no change. 
Comment 25 Oleg Sidletskiy 2004-06-23 18:18:02 PDT
*** Bug 248013 has been marked as a duplicate of this bug. ***
Comment 26 Reid Rankin 2004-06-25 09:12:29 PDT
I have had the same bug occur on two different computers. However, I can start
Firefox by opening the shortcut twice: first time gives the "Finishing Install"
box, and the second time gives the browser window as normal.
Comment 27 Jason Chu 2004-06-25 14:05:01 PDT
This bug should be blocking 0.9.1.  It's extremely frustrating for extension
developers because users who install an extension and encounter this bug blame
the developers for destroying their profile/extensions.
Comment 28 Steffen Wilberg 2004-06-25 14:57:36 PDT
Ben fixed this on the FIREFOX_0_9_1_BRANCH at 2004-06-24 03:19 and on the
AVIARY_1_0_20040515_BRANCH at 2004-06-24 14:43.
I'm leaving this bug open for trunk checkin.
Comment 29 Jeffrey Brown 2004-06-27 13:06:01 PDT
I have this condition. What is the fix for it? 
Comment 30 Steffen Wilberg 2004-06-27 13:37:35 PDT
Jeffrey, see comment 12.
Comment 31 Jason Chu 2004-06-27 14:44:33 PDT
(In reply to comment #29)
> I have this condition. What is the fix for it? 

If you are unable to follow the steps in comment 12 and are comfortable with
editing your extensions.rdf file, look at my instructions at
http://www.chuonthis.com/extensions/troubleshoot.php#finishing
Comment 32 Ben Goodger (use ben at mozilla dot org for email) 2004-06-28 14:22:31 PDT
Comment on attachment 150963 [details] [diff] [review]
Make zip file extraction truncate any existing file (patch against Aviary)

I *think* the right person to review this for the trunk might be dveditz, but I
suspect darin might also be able to?
Comment 33 Daniel Veditz [:dveditz] 2004-06-28 16:18:46 PDT
I'm the right guy, looking.
Comment 34 Daniel Veditz [:dveditz] 2004-06-28 16:31:30 PDT
Comment on attachment 150963 [details] [diff] [review]
Make zip file extraction truncate any existing file (patch against Aviary)

My bad :-(
r=dveditz

Filed bug 248971 to fix other places with the same error
Comment 35 Ben Goodger (use ben at mozilla dot org for email) 2004-07-03 02:10:24 PDT
Comment on attachment 150963 [details] [diff] [review]
Make zip file extraction truncate any existing file (patch against Aviary)

sr=me
Comment 36 Ben Goodger (use ben at mozilla dot org for email) 2004-07-03 02:11:29 PDT
Fix checked in on trunk, too. 
Comment 37 Roberto Figueroa 2004-07-08 09:57:25 PDT
same happened to me, working with Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:1.7) Gecko/20040614 Firefox/0.9

Workaround was edit Extensions.rdf file (in my case it is located in
%AppData%\Firefox\Profiles\default\bm0zkytg.slt\Extensions) and delete the tags
and its contet (<RDF .... />) where there was a line with ToBeInstalled = true.

I also deleted the content of temp subdir, where there was only one of the
extensions that I deleted in the file.
Comment 38 Worcester12345 2004-07-12 06:49:13 PDT
(In reply to comment #37)
> same happened to me, working with Mozilla/5.0 (Windows; U; Windows NT 5.1;
> en-US; rv:1.7) Gecko/20040614 Firefox/0.9
> 
> Workaround was edit Extensions.rdf file (in my case it is located in
> %AppData%\Firefox\Profiles\default\bm0zkytg.slt\Extensions) and delete the tags
> and its contet (<RDF .... />) where there was a line with ToBeInstalled = true.
> 
> I also deleted the content of temp subdir, where there was only one of the
> extensions that I deleted in the file.


Did this happen after the checkin? Any confirm one way or the other?
Comment 39 David A. Cobb 2004-07-25 17:47:57 PDT
Relative to Comment#38: Maybe.  At least all is not well.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040724
Firefox/0.9.1+ StumbleUpon/1.995

After installing latest (weekly), loaded several extensions.  Noted that
extension manager seems not to know whether it is re-installing the same
extension - or perhaps installing one several times, perhaps with different
versions.  [ASIDE: sorting the list by name could clear this up!]

Quit FF, tried to re-start to finish up the installations.  Nothing visible
happened.  Brought up ProcessExplorer, FF is loaded but doing nothing.  Murder
it.  Try restarting again.  At one point, I think I had three loaded
incarnations, none of them able to paint a screen.  Killed all, watched more
closely.  FF opens batch of chrome files, after a _long_ pause, closes them;
then - nothing.  

Re-installed.  New Profile.  Same result.  Finally, discovered that deleting the
Extensions folder in my profile-folder and starting from scratch with extensions
cleared up the problem.

Also, noted that even deleting the Profile/Extensions folder leaves many traces
around of the past extensions.  I have menu items with nothing attached, etc. 
Not entirely sure what I need to purge next.  Much more serious in the case of
Thunderbird because I cannot afford to jeopardize my hoarde of emails.
Comment 40 Nickolay_Ponomarev 2004-09-24 05:29:27 PDT
*** Bug 246658 has been marked as a duplicate of this bug. ***
Comment 41 Nickolay_Ponomarev 2004-09-24 05:30:04 PDT
*** Bug 254774 has been marked as a duplicate of this bug. ***

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