Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon Validation Error #672

Closed
reyronald opened this issue Mar 22, 2018 · 14 comments
Closed

Addon Validation Error #672

reyronald opened this issue Mar 22, 2018 · 14 comments
Assignees

Comments

@reyronald
Copy link

Getting an unexpected error when trying to upload a new version of an existing, listed Add-on. Is this a bug? There isn't any useful information in the error message.

Please attach a copy of your add-on, and fill in the following information:

Through the API

{
  "errors": 1,
  "success": true,
  "warnings": 0,
  "compatibility_summary": { "notices": 0, "errors": 0, "warnings": 0 },
  "ending_tier": 5,
  "messages": [
    {
      "description": [
        "Validation was unable to complete successfully due to an unexpected error.",
        "Check https://developer.mozilla.org/en-US/Add-ons/WebExtensions to ensure your webextension is valid or file a bug at http://bit.ly/1POrYYU"
      ],
      "tier": 1,
      "for_appversions": null,
      "message": "Sorry, we couldn't load your WebExtension.",
      "type": "error",
      "id": ["validator", "unexpected_exception"],
      "uid": "35432f419340461897aa8362398339c4"
    }
  ],
  "detected_type": "extension",
  "notices": 0,
  "message_tree": {},
  "metadata": {
    "requires_chrome": false,
    "listed": true,
    "is_webextension": true
  }
}

Through http://addons.mozilla.org/

image

@diox
Copy link
Member

diox commented Mar 22, 2018

@reyronald have you tried multiple times? It looks like a deadlock, which should be pretty rare... let us know if that happens consistently or if it was just a fluke.

@reyronald
Copy link
Author

reyronald commented Mar 22, 2018

Yeah, I just tried again now and got the same result.

The code for the extension is open source and can be viewed here if that's any help. Here's the manifest.

If there's nothing wrong upstream it's probably an issue with the extension code itself, but since the error is not showing any useful information I don't know where to start looking for the issue :S. Needless to say I've successfully uploaded previous versions myself. This is the manifest for the previous version: https://github.com/refined-bitbucket/refined-bitbucket/blob/v3.7.3/src/manifest.json.

API response https://addons.mozilla.org/en-US/developers/upload/e54efc6e98114399b6107a63e7c20c76
{
  "errors": 1,
  "success": true,
  "warnings": 0,
  "compatibility_summary": { "notices": 0, "errors": 0, "warnings": 0 },
  "ending_tier": 5,
  "messages": [
    {
      "description": [
        "Validation was unable to complete successfully due to an unexpected error.",
        "Check https://developer.mozilla.org/en-US/Add-ons/WebExtensions to ensure your webextension is valid or file a bug at http://bit.ly/1POrYYU"
      ],
      "tier": 1,
      "for_appversions": null,
      "message": "Sorry, we couldn't load your WebExtension.",
      "type": "error",
      "id": ["validator", "unexpected_exception"],
      "uid": "35432f419340461897aa8362398339c4"
    }
  ],
  "detected_type": "extension",
  "notices": 0,
  "message_tree": {},
  "metadata": {
    "requires_chrome": false,
    "listed": true,
    "is_webextension": true
  }
}

@diox
Copy link
Member

diox commented Mar 22, 2018

It's definitely something wrong on AMO side, nothing to do with your extension code.

Interestingly sentry shows 2 different errors for the different attempts:

@reyronald
Copy link
Author

I see!

Well I'm assuming there's not much I can do but if there is let me know! Naturally I'm waiting for this to be resolved so that I can publish the new version.

@diox
Copy link
Member

diox commented Mar 28, 2018

So far we have no idea what's going on. QA has been able to upload that add-on to their own account for testing without any issues... We haven't heard any other complaints but the sentry traceback for the deadlock shows it did happen more than a couple times, and that started after March 15th, which is interesting because it's a push day...

@reyronald
Copy link
Author

I just tried again right now and got the same error, so whatever that's happening, it's happening consistently.

We haven't heard any other complaints ...

So you mean it's only me and my extension failing to upload? You sure then it's not something wrong with the extension code then? Here's a diff/compare of the previous version that I uploaded successfully and the current version I'm trying to upload: refined-bitbucket/refined-bitbucket@v3.7.3...v3.8.0, the only thing out of the usual changes that I do is the inclusion of the logos and icons.

...and that started after May 15th...

My first attempt was the same day I opened this issue, just a few minutes earlier, so March 22.

I wish I could be of more help, let me know if there's anything I can do on my side!

@diox
Copy link
Member

diox commented Mar 28, 2018

Couple things that could help us:

  • Do you know roughly how many times you tried ? This is to compare with the number of tracebacks. I can't easily check who is affected because it's happening in a task so I don't see who was logged on etc. I do suspect you're not the only one affected, but at the same time there aren't that many occurrences and nobody else came to us with this issue.
  • Can you attach/post somewhere the exact xpi file you're trying to upload ?

@reyronald
Copy link
Author

Here it is extension.zip

On March 22 I'm not exactly sure, maybe around 5 times or so (could be a little more, but not above 10) between 10:30 AM and 12:00 PM Eastern Time (ET), I think I tried one more time the next day and that's it. Then today, I tried twice, right before posting my previous comment (15 minutes ago) and this one.

@reyronald
Copy link
Author

reyronald commented Mar 28, 2018

By the way, that extension.zip file can be generated by yourselves by simply cloning the extension repo, and running...

npm install
npm run build:min
npm run package

Just in case you guys want/need to play around with it.

@diox
Copy link
Member

diox commented Mar 28, 2018

Ok, I'm not sure if it's related, but there is something weird about this zip:

  • unzip on my linux laptop says error: invalid compressed data to inflate when extracting
  • file-roller shows all files in it as directories
  • our linter, when processing it locally on my machine, returnst Error: invalid code lengths set and it fails to validate.

So that could explain the issue, maybe the deadlock we've seen in sentry is another issue, perhaps a byproduct of the unhandled exception here.

Please check how you generate your zip file. (The fact that it worked on previous versions is not necessarily an indication that nothing was wrong with them, the linter used to be more flexible with certain broken zip files)

Edit: this is also happening with a package built locally from your sources.

@diox diox self-assigned this Mar 28, 2018
@reyronald
Copy link
Author

reyronald commented Mar 28, 2018

Well I guess that's it. I just zipped it manually using WinRAR and uploaded it and it shows no errors now. So far I've been using the adm-zip npm package and this code to automatically generate it:

https://github.com/refined-bitbucket/refined-bitbucket/blob/ac5fb443501c35610cdffeb2f209b8994af73b96/scripts/package.js#L1-L10

// package.js
const del = require('del');
const AdmZip = require('adm-zip');

// Delete source maps
del.sync(['extension/*.js.map']);

// Archive the extension folder into 'extension.zip'
const zip = new AdmZip();
zip.addLocalFolder('extension');
zip.writeZip('extension.zip');

So I'm assuming that whatever adm-zip is doing, is not doing it right. I'm gonna switch to use something else now then.

I apologize to have bothered the Mozilla team with this. Maybe the validation in the Add-Ons site could be improved to handle this case.

@diox
Copy link
Member

diox commented Mar 28, 2018

Happy to see we found what was causing the issue! Don't worry about it, we should definitely handle that in a nicer way. I'll open a new issue on https://github.com/mozilla/addons-linter and close this one.

@diox
Copy link
Member

diox commented Mar 28, 2018

Closing in favor of mozilla/addons-linter#1938 thanks for helping pinpoint the core problem!

@reyronald
Copy link
Author

reyronald commented Mar 28, 2018

Thank you for your assistance! I just opened refined-bitbucket/refined-bitbucket#193 on my side as well and referenced these two issues.

Since the adm-zip does not always produce a broken ZIP file (evidenced by the fact that so far I've been using it successfully until now), feel free to use my project to test your solution in mozilla/addons-linter#1938 if you need!

Edit: .. if you do, you specifically need to use tag v3.8.0, which is the one with the error: https://github.com/refined-bitbucket/refined-bitbucket/tree/v3.8.0

reyronald added a commit to refined-bitbucket/refined-bitbucket that referenced this issue Apr 2, 2018
Fix the `package` npm script to use the `archiver` npm package instead
of `admin-zip` so that it produces a valid Zip file.

Closes #193

mozilla/addons#672
mozilla/addons-linter#1938
reyronald added a commit to refined-bitbucket/refined-bitbucket that referenced this issue Apr 3, 2018
Fix the `package` npm script to use the `archiver` npm package instead
of `admin-zip` so that it produces a valid Zip file.

Closes #193

mozilla/addons#672
mozilla/addons-linter#1938
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants