Project

General

Profile

NumberFormatException when creating new vhost

Abmar Barros
Added over 4 years ago

Hi,

I was trying to create new vhosts via the admin groovy scripts and I was facing the following issue:

<iq type="set" from="admin@buddycloud.net/tigase-1" id="c7f6ff18-dfaf-438c-aa29-86eca7ae3f70-15" to="vhost-man@buddycloud.net">
  <command xmlns="http://jabber.org/protocol/commands" status="executing" node="comp-repo-item-add">
    <x xmlns="jabber:x:data" type="submit">
      <field var="Domain name">
        <value>test654.buddycloud.net</value>
      </field>
      <field var="Enabled" type="boolean">
        <value>true</value>
      </field>
      <field var="Anonymous enabled" type="boolean">
        <value>true</value>
      </field>
      <field var="In-band registration" type="boolean">
        <value>true</value>
      </field>
      <field var="TLS required" type="boolean">
        <value>true</value>
      </field>
      <field var="S2S secret">
        <value />
      </field>
      <field var="Domain filter policy" type="list-single" label="Domain filter policy">
        <value>ALL</value>
        <option label="ALL">
          <value>ALL</value>
        </option>
        <option label="LOCAL">
          <value>LOCAL</value>
        </option>
        <option label="OWN">
          <value>OWN</value>
        </option>
        <option label="BLOCK">
          <value>BLOCK</value>
        </option>
        <option label="LIST">
          <value>LIST</value>
        </option>
      </field>
      <field var="Max users">
        <value>0</value>
      </field>
      <field var="Presence forward address">
        <value />
      </field>
      <field var="Message forward address">
        <value />
      </field>
      <field var="Other parameters">
        <value />
      </field>
      <field var="Owner">
        <value>admin@buddycloud.net</value>
      </field>
      <field var="Administrators">
        <value />
      </field>
      <field var="command-marker" type="hidden">
        <value>command-marker</value>
      </field>
    </x>
  </command>
</iq>


<iq type="result" from="vhost-man@buddycloud.net" id="c7f6ff18-dfaf-438c-aa29-86eca7ae3f70-15" to="admin@buddycloud.net/tigase-1">
  <command xmlns="http://jabber.org/protocol/commands" status="completed" node="comp-repo-item-add">
    <x xmlns="jabber:x:data" type="result">
      <field var="Note" type="fixed">
        <value>Script execution error.</value>
      </field>
      <field var="Error message" type="fixed">
        <value>java.lang.NumberFormatException: For input string: &quot;4f8:0:a111::add:9898&quot;</value>
      </field>
      <field var="Debug info" type="text-multi">
        <value>java.lang.NumberFormatException: For input string: &quot;4f8:0:a111::add:9898&quot;</value>
        <value>javax.script.ScriptException: java.lang.NumberFormatException: For input string: &quot;4f8:0:a111::add:9898&quot;</value>
        <value>org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:349)</value>
        <value>org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:41)</value>
        <value>tigase.server.script.Script.runCommand(Script.java:182)</value>
        <value>tigase.server.BasicComponent.processScriptCommand(BasicComponent.java:1053)</value>
        <value>tigase.server.BasicComponent.processPacket(BasicComponent.java:307)</value>
        <value>tigase.server.MessageRouter.processPacket(MessageRouter.java:358)</value>
        <value>tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475)</value>
        <value />
      </field>
    </x>
  </command>
</iq>

4f8:0:a111::add:9898 turns out to be a fragment of the IPv6 adresses of Hetzner's recursive DNS servers [[[http://wiki.hetzner.de/index.php/Hetzner_Standard_Name_Server/en]]], so I figured the issue could be related to the DNS checks that take place during vhost validation.

As a matter of fact, adding "--vhost-disable-dns-check = true" to the conf file did the trick.

Could it be that the tigase.util.DNSResolver can't handle IPv6?

Cheers!


Replies (5)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

Indeed, looks like a bug in the DNSResolver when dealing with IPv6 addresses. I created bug report #2165 and added you to the watchers list so you will be notified about any progress we make on this.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

The problem could not be replicated. Do you have any server logs with the exception so we have more details?

Added by Abmar Barros over 4 years ago

Hey Artur,

as the server was executing a groovy admin script, there is no other server log but the stanza itself with the stacktrace being passed around the processoers.

If it helps, the /etc/resolv.conf had the nameservers I've mentioned previously.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 4 years ago

Abmar, can we move the discussion over to the ticket #2165? It makes easier for us track all the details related to the issue.

Added by Abmar Barros over 4 years ago

Sure, thanks.

    (1-5/5)