Unable to install my own extension - Corrupted error message

Hello,
Recently I have developed a simple extension and successfully tested in my browser, so I submited it to AMO. However, whenever I try to install it I get an error message saying that the extension could not be installed because it was currupted.
Here are the links:
*AMO Page - https://addons.mozilla.org/pt-BR/firefox/addon/safesearch_enforcer/
*GitHub page (source) - https://github.com/Nintersoft/SafeSearch-Enforcer/

It is strange because I tested it on my browser and it worked (about:debugging). Furthermore I had followed every single step at DMO.

Since now, thanks a lot.

There are a number of cases where Firefox will say this, but the file itself is actually ok.
For example Firefox sometimes Firefox will not allow you to install the extension if you already have (an other version of) the extension installed. Removing the installed extension and trying again helps.
And sometimes simply trying again without doing anything else works too.

You should also find out whether you can install your file into a completely blank profile.

Well, I have also tried to install in two other computers that I have at home, one of them running Windows and the other running Elementary OS. Nevertheless in both cases I got the same error message. Sincerelly I do not have any idea of what may be causing the problem, once I do not use antivirus or any other software which could interfer in the instalation proccess.
I have also tried to install in the mobile version (for Android), but without success too.
Here is the error log of browser console:

1485659743297               addons.xpi         WARN  Failed to remove temporary file C:\Users\Mauro\AppData\Local\Temp\tmp-kiw.xpi for addon https://addons.mozilla.org/firefox/downloads/latest/safesearch_enforcer/addon-775516-latest.xpi?src=dp-btn-primary: [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/XPIProvider.jsm :: AddonInstall.prototype.removeTemporaryFile :: line 5682"  data: no] Stack trace: AddonInstall.prototype.removeTemporaryFile()@resource://gre/modules/addons/XPIProvider.jsm:5682 < AddonInstall.prototype.onStopRequest/<()@resource://gre/modules/addons/XPIProvider.jsm:6179 < Handler.prototype.process()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:940 < this.PromiseWalker.walkerLoop()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:816 < this.PromiseWalker.scheduleWalkerLoop/<()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:750
1485659743298                 addons.xpi         WARN  Download of https://addons.mozilla.org/firefox/downloads/latest/safesearch_enforcer/addon-775516-latest.xpi?src=dp-btn-primary failed: [Exception... "Component returned failure code: 0x80520006 (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST) [nsIZipReader.getEntry]"  nsresult: "0x80520006 (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST)"  location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: loadManifestFromZipReader< :: line 1500"  data: no] Stack trace: loadManifestFromZipReader<()@resource://gre/modules/addons/XPIProvider.jsm:1500 < TaskImpl_run()@resource://gre/modules/Task.jsm:319 < Handler.prototype.process()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:937 < this.PromiseWalker.walkerLoop()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:816 < this.PromiseWalker.scheduleWalkerLoop/<()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:750
1485659743309                 addons.xpi         WARN  Failed to remove temporary file C:\Users\Mauro\AppData\Local\Temp\tmp-kiw.xpi for addon https://addons.mozilla.org/firefox/downloads/latest/safesearch_enforcer/addon-775516-latest.xpi?src=dp-btn-primary: [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/XPIProvider.jsm :: AddonInstall.prototype.removeTemporaryFile :: line 5682"  data: no] Stack trace: AddonInstall.prototype.removeTemporaryFile()@resource://gre/modules/addons/XPIProvider.jsm:5682 < AddonInstall.prototype.downloadFailed()@resource://gre/modules/addons/XPIProvider.jsm:6217 < AddonInstall.prototype.onStopRequest/<()@resource://gre/modules/addons/XPIProvider.jsm:6180 < Handler.prototype.process()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:940 < this.PromiseWalker.walkerLoop()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:816 < this.PromiseWalker.scheduleWalkerLoop/<()@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:750

I have tried to update the version with some adjusts recommended by AMO team, but without success.
I strongly believe that It cannot be a simple coincidence (in four different devices). If you could also just test it for me, I would be glad.

Since now, thank you a lot.

Yea, I couldn’t install that either.

Some more ideas before I go to bed:

  • 1.0 is not a semver, and you do not have an applications entry in your manifest.json, which also means that you don’t specify an id
  • upload it as 1.1.1b1 as an automatically signed beta version
  • simply upload the sane thing again as version 1.1.x (the “please try again later” concept)

I have tried to do the steps as you have said, but I have the following problems:

Here is the beta version that I have uploaded: https://addons.mozilla.org/pt-BR/firefox/addon/safesearch_enforcer/versions/beta?page=1#version-1.1.1b

Well, this is really strange.

Strange it is.
When I try to sideload your file form disk (which works for other files downloaded fom AMO), I get the error

There was an error during installation: Component returned failure code: 0x80520006 (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST) [nsIZipReader.getEntry]

how did you create your .xpi/.zip file before you uploaded it?

Well, I just did exactly as recommended in this link: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Publishing_your_WebExtension#Windows
After that I have also tried using 7zip to create the zip file, but without success either (created another beta build).
Then, I have just followed the rest of the steps descried in this link.

That should work. Anyway, here are a couple of things that could go wrong and that might be a reason for a “corrupted” zip file:

  • wrong line endings, \r\n works
  • wrong text file encoding, utf-8 works
  • something wrong with the BOM. I have no idea whats requires here.
  • wrong file name encoding in the zip file. utf-8 should work. Your zipping software chooses this, and it may actually important, especially if any file or folder in your archive has a non-ASCII name.
  • ZIP compression: STORE and DEFLATE should work I guess.
  • something stupid regarding the order of the entries in the archive.

Conclusion: Make sure all your files are saves with the correct encoding etc, and then use web-ext to pack your extension. It uses the pure-js implementation jszip, with a configuration that definitely works ==> it doesn’t get more platform defendant than that.

1 Like

Oh my god, It worked like a charm.
I have just used web-ext build command instead of the 7zip or Windows default compressor, so it worked.
I have released a new beta version here: https://addons.mozilla.org/pt-BR/firefox/addon/safesearch_enforcer/versions/beta?page=1#version-1.1.2b , to test and it is OK (even without the ID).
I do not know what was going wrong, but now I am going to release the stable version as 1.1.3.
Thank you so much (I did not knew about this tool before).

As I would say in a game that I like to play:

“You rock”

I can confirm that this one works.

And thanks, you are very welcome.

BTW, you can (and probably should) delete the corrupt versions.

1 Like