1

I followed instructions here and after installed I opened the console mode to debug but the log stuck there without any response: The console just shows something like following and nothing more output:

*** LOG addons.updates: Requesting https://www.extension.host.com/update.rdf

My install.rdf is:

<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
     xmlns:em="http://www.mozilla.org/2004/em-rdf#">

  <Description about="urn:mozilla:install-manifest">

    <em:id>webmailchecker@mozilla.doslash.org</em:id>
    <em:name>WebMail Checker for Firefox</em:name>
    <em:version>1.0</em:version>
    <em:description>WebMail Checker</em:description>
    <em:updateURL>https://www.extension.host.com/update.rdf</em:updateURL>

    <!-- Firefox -->
    <em:targetApplication>
      <Description>
        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
        <em:minVersion>3.6</em:minVersion>
        <em:maxVersion>23.*</em:maxVersion>
      </Description>
    </em:targetApplication>
  </Description>
</RDF>

And update.rdf is:

<?xml version="1.0" encoding="UTF-8"?>

<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:em="http://www.mozilla.org/2004/em-rdf#">

  <RDF:Description about="urn:mozilla:extension:webmailchecker@mozilla.doslash.org">
    <em:updates>
      <RDF:Seq>

        <!-- Each li is a different version of the same add-on -->
        <RDF:li>
          <RDF:Description>
            <em:version>1.0</em:version> 
            <em:targetApplication>
              <RDF:Description>
                <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
                <em:minVersion>1.5</em:minVersion>
                <em:maxVersion>23.*</em:maxVersion>
                <em:updateLink>https://www.extension.host.com/firefox.xpi</em:updateLink>

              </RDF:Description>
            </em:targetApplication>
          </RDF:Description>
        </RDF:li>

        <RDF:li>
          <RDF:Description>
            <em:version>2.0</em:version>
            <em:targetApplication>
              <RDF:Description>
                <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
                <em:minVersion>1.5</em:minVersion>
                <em:maxVersion>23.*</em:maxVersion>
                <em:updateLink>https://www.extension.host.com/firefox_2.0.xpi</em:updateLink>
              </RDF:Description>
            </em:targetApplication>
          </RDF:Description>
        </RDF:li>

      </RDF:Seq>
    </em:updates>
  </RDF:Description>
</RDF:RDF>

In the server side, both of the update.rdf and the xpi file are returned as javax.ws.rs.core.Response and I have configured the mimemapping in the web.xml as the following:

<mime-mapping>
    <extension>xpi</extension>
    <mime-type>application/x-xpinstall</mime-type>
</mime-mapping>
<mime-mapping>
    <extension>rdf</extension>
    <mime-type>text/xml</mime-type>
</mime-mapping>

Anything I missed? The automatic update is just not working.

Wladimir Palant
  • 56,865
  • 12
  • 98
  • 126
  • That's strange - the way I read `AddonUpdateChecker.jsm`, there is only one scenario where it would output that one log message and nothing else. It should only happen if `` is empty. Maybe an older version of your `update.rdf` is stuck in the cache? – Wladimir Palant May 14 '13 at 11:31
  • @Wladimir Palant Thanks for the reply.Stuck in cache? My first version update.rdf is just as above. I have tried to clear the browser cache and history before. Is the cache you mentioned that I cleared? And I can access the update.rdf by typing into the address bar – user2381038 May 14 '13 at 13:22
  • Wrong guess then. I'm out of ideas, your setup seems correct and there should definitely be more log messages. – Wladimir Palant May 14 '13 at 13:31
  • thx. On the server side, when I click check for update, I can see the update url is handled but I can not see something like update entry detected from the console. I will check more – user2381038 May 14 '13 at 15:54
  • @WladimirPalant I tried to download the extension manually with the updateLink `https://localhost:8443/firefox.xpi` by typing into the address bar in firefox. But I got error like "the add-on could not be downloaded due to connection failure on localhost". Do you have any idea? But in the server side the fetch file operation was responsed. – user2381038 May 20 '13 at 02:48
  • Sorry, ignore it. It's server error. Currently it's just the update.rdf file fetched but the updateLink is not fetched after this. – user2381038 May 20 '13 at 03:13

1 Answers1

6

Today I look back to this issue again and finally solved this. And I update the answer in case anyone else need this. I looked into the source code AddonUpdateChecker.jsm which I should do this earlier. I used javascript debugger to debug the update. Before this, I really didn't see any logs indicating that the I should have builtInCertificate. And found that it's looking into the pref values about certificates. Which are extensions.install.requireBuiltInCerts and extensions.update.requireBuiltInCerts.

Set these two prefs values to false and the udpate works.

Others with different ssl certificate may not meet this problem maybe.