Validation fails with a DOCTYPE in install.rdf

RESOLVED FIXED in 5.12.12

Status

addons.mozilla.org Graveyard
Developer Pages
--
major
RESOLVED FIXED
8 years ago
3 years ago

People

(Reporter: ElbertF, Assigned: basta)

Tracking

unspecified
5.12.12
x86_64
Linux

Details

(URL)

Attachments

(1 attachment)

285.48 KB, application/x-xpinstall
Details
(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.0b10pre) Gecko/20110113 Firefox/4.0b10pre
Build Identifier: 

When I upload a new version of my addon I get the following message:

Your add-on failed validation with 2 errors.

    Cannot Parse install.rdf
    Addon missing install.rdf.

Since I only changed the version number in the RDF file I'm pretty sure it's fine and it's definitely present.

Reproducible: Always

Steps to Reproduce:
1. Upload new version
2. Select a file
Actual Results:  
Message about missing install.rdf
(Reporter)

Comment 1

8 years ago
Created attachment 513300 [details]
Wappalyzer 1.13.0

Updated

8 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
Matt, what is failing here?
Assignee: nobody → mbasta
Target Milestone: --- → 5.12.12
(Assignee)

Comment 3

8 years ago
rdflib is choking on the install.rdf because of the DOCTYPE's chrome:// url.

Two things:
1.) This is probably a good point to break away from rdflib and either come up with a better in-house solution or start patching it. We've had other problems with rdflib before (namely that it doesn't keep line numbers around).
2.) I'd assume that the doctype should never be anything but a chrome:// url. This is something we should be testing. Since rdflib is trying to actually fetch the URL provided, that's also a problem.

Unless anyone thinks that there is a simpler/better fix, I'm going to start chipping away at this with a new library for RDF.
(Reporter)

Comment 4

8 years ago
I just submitted the add-on without a DOCTYPE in install.rdf and that worked.
(In reply to comment #3)
> Unless anyone thinks that there is a simpler/better fix, I'm going to start
> chipping away at this with a new library for RDF.

I personally don't think this is worth spending time on. The DOCTYPE is completely unnecessary for the install.rdf file, so it should be removed anyway. I've seen this in a couple of other add-ons, so maybe it's the product of some tutorial or template.

It'd be nicer if the warning clarified what is the source of the error, but I would still consider it an error.
(In reply to comment #3)
> Unless anyone thinks that there is a simpler/better fix, I'm going to start
> chipping away at this with a new library for RDF.

if re.search('doctype', rdf.read(), re.I):
    raise VaildationError("Please remove the doctype from your install.rdf.")
Summary: Validation fails when adding new version → Validation fails with a DOCTYPE in install.rdf
(Assignee)

Comment 7

8 years ago
For reference, this is the tutorial that shows the DOCTYPE's use, though not in an install.rdf:

http://kb.mozillazine.org/Getting_started_with_extension_development#overlay.xul

Apparently it's supposed to localize strings in an overlay. Since XUL is parsed using a its own parser, this shouldn't be an issue on that side. For install.rdf files, though, this is certainly an error. 

I'll implement something like Jeff's code after breakfast.
(Assignee)

Comment 8

8 years ago
Done:

https://github.com/mattbasta/amo-validator/commit/17031fad54ec3dc8dc2b7c96e125be223a000464
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED

Updated

7 years ago
Depends on: 726994
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.