Closed Bug 1042919 Opened 7 years ago Closed 7 years ago

Exception "TypeError: this.targetPlatforms['@@iterator'] is not a function" at XPIProvider.jsm:6069


(Toolkit :: Add-ons Manager, defect)

Not set





(Reporter: Irving, Assigned: Irving)



(1 file)

(the line number cited is for beta 31; I think it's here:

This is the most common unhandled exception seen by telemetry reporting (in this case, for Beta/Aurora/Nightly, not analyzing Release channel yet) at

It's not super-frequent; eyeballing the totals says about 18k out of 80M sessions report the error. 

The exception is logged from, called from various places but most interestingly the blocklist service, so this could be causing blocklists to not be properly applied in some cases.

{"file":"resource://gre/modules/addons/XPIProvider.jsm","message":"TypeError: this.targetPlatforms['@@iterator'] is not a function","line":6069,"context":"provider updateAddonAppDisabledStates","module":"AMI"}
Grr. for..of loops don't work to iterate [key, value] on JS Objects (only Maps).
Assignee: nobody → irving
OK, so it doesn't look like this particular bug is for..of on Object, because the field in question is supposed to be an Array and we don't even get to the line in question without successfully testing "this.targetPlatforms.length == 0" - which could mean either it's a non-empty array *or* a non-empty string.

Everything I can see that assigns this makes sure it's an array, *except* the code that tries to migrate from older databases. As far as I can tell, the DB migration code (either from RDF or SQLITE) has never handled 'targetPlatforms', nor does the metadata update code, so it should be null in those cases.

And, amusingly enough, the code from before the conversion from iterating the array by number to iterating by foreach (at would silently succeed if the value of AddonInternal.targetPlatforms was a string...

Next step appears to be catching & adding more details to my Telemetry exception report, to see what's really going on.
Aside - should I file a bug about the lack of targetPlatforms support in metadata updates?
Attachment #8480104 - Flags: review?(dtownsend+bugmail)
Attachment #8480104 - Flags: review?(dtownsend+bugmail) → review+
(In reply to :Irving Reid from comment #3)
> Aside - should I file a bug about the lack of targetPlatforms support in
> metadata updates?

Bug 404163
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.