Closed Bug 719002 Opened 10 years ago Closed 10 years ago

Unable to access extensions in firefox 9x and 10x under Linux

Categories

(Toolkit :: Add-ons Manager, defect)

9 Branch
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: alexdietz380, Assigned: darktrojan)

References

Details

Attachments

(5 files, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0.1) Gecko/20100101 Firefox/8.0.1
Build ID: 20111120135848

Steps to reproduce:

Install firefox 9.0.1 and 10.03b on Linux, Ubuntu 11.10. Afterwards I went to 

Tools -> Add-ons

and then choose

Extensions 

There were no listed. The exact same happened after starting firefox in safe-mode; no extensions shown. Moreover, I was not able to "Get add-ons", the page with the add-ons never get loaded, even aftre minutes of waiting. 


Actual results:


There were no extensions listed. The exact same happened after starting firefox in safe-mode; no extensions shown. Moreover, I was not able to "Get add-ons", the page with the add-ons never get loaded, even after minutes of waiting. 


Expected results:

See my installed but disabled extensions?

After re-installing firefox 8.0.1, all of those problems disappeared, I can see all my firefox extensions again. Therefore, I strongly suspect a bug introduced in version 9.0.1.
Can you start Firefox 9 in safe mode, go to Addon manager and paste all messages from Tools->Web developer->Error console?
Component: Untriaged → Add-ons Manager
Product: Firefox → Toolkit
QA Contact: untriaged → add-ons.manager
Output of the error console (errors only):

Error: ERROR addons.repository: Failed to create database schema: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageConnection.executeSimpleSQL]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource://gre/modules/AddonRepository.jsm :: AD_openConnection :: line 1325"  data: no]
Source File: resource://gre/modules/AddonRepository.jsm
Line: 1325


Error: ERROR addons.repository: SQL error 1: duplicate column name: width
Source File: resource://gre/modules/AddonRepository.jsm
Line: 1266


Error: ERROR addons.repository: Error creating statement getAllAddons (SELECT internal_id, id, type, name, version, creator, creatorURL, description, fullDescription, developerComments, eula, iconURL, homepageURL, supportURL, contributionURL, contributionAmount, averageRating, reviewCount, reviewURL, totalDownloads, weeklyDownloads, dailyUsers, sourceURI, repositoryStatus, size, updateDate FROM addon)
Source File: resource://gre/modules/AddonRepository.jsm
Line: 1426

Error: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [mozIStorageConnection.rollbackTransaction]"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: resource://gre/modules/AddonRepository.jsm :: AD_openConnection :: line 1334"  data: no]
Source File: resource://gre/modules/AddonRepository.jsm
Line: 1334
There really is something wrong with your addons store.

Where did you get firefox? Is it from the Ubuntu repository, or from mozilla.org?
firefox 9.0.1: automatic update
firefox 8.0.1: from tag file from mozilla.org
Thanks for the information you provided so far, Alex.

Could you also attach copies of your extensions.ini, extensions.sqlite and extensions.log from your profile folder? (.mozilla/firefox in home folder on Ubuntu)

Did you get the empty Add-on manager window after updating from 8.0.1 to Firefox 9 and afterwards 10? Were your add-ons still functional although not listed?
Attached file extensions.ini file
Attached file extensions.sqlite file
Attached file extensions.log file
Hi, 

I attached all these three files, and yes, at least one extension was still working with firefox 9.0.1, although nothing was listed.
Can you also attach addons.sqlite from your profile?
Attached file addons.sqlite file
Attachment #589533 - Attachment mime type: text/plain → application/octet-stream
Attachment #589544 - Attachment mime type: text/plain → application/octet-stream
The problem seems to be that the upgrade of the schema of addons.sqlite broke half-way through. There doesn't seem to be anything in the logs to suggest why but critically all the new fields are in the database but the database still claims to have an old schema so on every access it attempts to upgrade by adding fields that are already there and disaster ensues.

I can't begin to guess why it failed in the first place, it is a pretty straightforward operation. Maybe random disk error or the app simply crashed halfway through. Either way we can stop this from being a problem by properly wrapping the schema changes in a transaction so at least they are all rolled-back in the event of a serious problem.

As for fixing this and getting you back up and going again, just delete addons.sqlite from your profile when Firefox is closed. It doesn't contain any user settings and will get re-generated within a day, with the correct schema this time.
Blocks: 664895
Yes, your suggestion at last seem to really work. Any idea about the cause of this problem? I was always able to reproduce it (at least 2 or 3 times), so I would exclude any temporary issue...
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → geoff
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #589658 - Flags: review?(dtownsend)
(In reply to alexdietz380 from comment #13)
> Yes, your suggestion at last seem to really work. Any idea about the cause
> of this problem? I was always able to reproduce it (at least 2 or 3 times),
> so I would exclude any temporary issue...

If the addons.sqlite got broken in the way Dave describes, the errors you saw will happen every time you start Firefox.
(In reply to alexdietz380 from comment #13)
> Yes, your suggestion at last seem to really work. Any idea about the cause
> of this problem? I was always able to reproduce it (at least 2 or 3 times),
> so I would exclude any temporary issue...

Firefox 8 didn't have the schema upgrade code so your faulty addons.sqlite file would have worked just fine there. As Geoff says the faulty addons.sqlite file would cause the issue to happen all the time whenever running in Firefox 9 or later. If you have a way to start Firefox 8 with a fresh addons.sqlite file, then upgrade to Firefox 9 and see the problem then we'd love to hear it so we can understand what is happening. For now the patch here ought to at least workaround the problem in the future.
Comment on attachment 589658 [details] [diff] [review]
patch

Review of attachment 589658 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/mozapps/extensions/AddonRepository.jsm
@@ +1586,1 @@
>      try {

I'm tempted to say it would be a little saner to just put the beginTransaction here and take the transaction stuff out of _createSchema. We can remove the call to _createSchema just above here because it will fall through to case 0 below anyway. What do you think?
Attached patch patch v2Splinter Review
(In reply to Dave Townsend (:Mossop) from comment #17)
> I'm tempted to say it would be a little saner to just put the
> beginTransaction here and take the transaction stuff out of _createSchema.
> We can remove the call to _createSchema just above here because it will fall
> through to case 0 below anyway. What do you think?

Yeah, that's a lot tidier.
Attachment #589658 - Attachment is obsolete: true
Attachment #589658 - Flags: review?(dtownsend)
Attachment #589803 - Flags: review?(dtownsend)
Hi, 

I just tried the following following the request from Dave (Comment 16):

1. Close firefox, remove addons.sqlite
2. Start firefox 9, to 'create' the addons.sqlite file
3. Close, start firefox 8
4. The update to firefox 9 (agin...)

Result: Everything seem to work as usual. Hope this helps you figure out whats going on or to support what you suspected. 


If you need me anything else to test, don't hesitate to come back to me!

Alex
Comment on attachment 589803 [details] [diff] [review]
patch v2

Looks good
Attachment #589803 - Flags: review?(dtownsend) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/fd1fd139aa16
Flags: in-testsuite-
Flags: in-litmus-
Target Milestone: --- → mozilla12
https://hg.mozilla.org/mozilla-central/rev/fd1fd139aa16
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.