Projects tigase _server server-core Issues #1189
VHost addition: Incorrect domain, unable to parse it: null (#1189)
wojciech.kapcia@tigase.net opened 4 years ago
  1. properly handle exception and return error to user
  2. don't user WARNING in this case.
[2020-08-15 02:01:45:424] [WARNING ] [   in_4-message-router ] Script.runCommand()              : Script execution error: javax.script.ScriptException: java.lang.IllegalArgumentException: Incorrect domain, unable to parse it: null
javax.script.ScriptException: java.lang.IllegalArgumentException: Incorrect domain, unable to parse it: null
	at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:320)
	at org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:71)
	at tigase.server.script.Script.runCommand(Script.java:122)
	at tigase.server.BasicComponent.processScriptCommand(BasicComponent.java:903)
	at tigase.server.BasicComponent.processPacket(BasicComponent.java:400)
	at tigase.server.MessageRouter.processPacket(MessageRouter.java:374)
	at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1405)
Caused by: java.lang.IllegalArgumentException: Incorrect domain, unable to parse it: null
	at tigase.vhosts.VHostItemImpl.initFromCommand(VHostItemImpl.java:355)
	at tigase.vhosts.VHostItemImpl$VHostItemWrapper.initFromCommand(VHostItemImpl.java:1697)
	at tigase.db.comp.RepositoryItem$initFromCommand$1.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
	at tigase.admin.Script18.run(Script18.groovy:81)
	at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:317)
	... 6 more
Caused by: tigase.util.stringprep.TigaseStringprepException: Domain part is required
	at tigase.xmpp.jid.BareJID.bareJIDInstance(BareJID.java:99)
	at tigase.xmpp.jid.JID.jidInstance(JID.java:132)
	at tigase.xmpp.jid.JID.jidInstance(JID.java:95)
	at tigase.vhosts.VHostItemImpl.setVHost(VHostItemImpl.java:1210)
	at tigase.vhosts.VHostItemImpl.initFromCommand(VHostItemImpl.java:353)
	... 13 more

wojciech.kapcia@tigase.net commented 4 years ago
[2020-08-15 02:01:45:418] [FINEST  ] [   in_4-message-router ] XMPPIOService.processSocketData(): ws2s@ip-10-0-18-235.us-west-2.compute.internal/10.0.18.235_5290_10.0.16.4_16548, type: accept, Socket: ws2s@ip-10-0-18-235.us-west-2.compute.internal/10.0.18.235_5290_10.0.16.4_16548 Socket[addr=/10.0.16.4,port=16548,localport=5290], jid: fun92477@jabber.today/1873287078-tigase-902, READ:[iq type="set" to="vhost-man@jabber.today" id="JK3i2v"][command xmlns="http://jabber.org/protocol/commands" node="comp-repo-item-add" action="execute"][x xmlns="jabber:x:data" type="submit"][instructions]❗NOTE: Options without value set will use configuration defined in 'DEFAULT' VHost❗[/instructions][field var="Domain name" type="text-single"][value][/value][/field][field var="Enabled" type="boolean"][value]1[/value][/field][field var="Anonymous enabled" type="boolean"][value]1[/value][/field][field var="In-band registration" type="boolean"][value]1[/value][/field][field var="TLS" type="fixed"][value]This installation forces VHost to require TLS. If you need to use unencrypted connections set 'vhost-tls-required' property to 'false' in the installation configuration file[/value][/field][field var="S2S secret" type="text-single"][value]02c46427-3616-4de4-8a04-01325198c7e8[/value][/field][field type="list-single" label="Domain filter policy" var="Domain filter policy"][value]ALL[/value][option label="DEFAULT"][value]DEFAULT[/value][/option][option label="ALL"][value]ALL[/value][/option][option label="LOCAL"][value]LOCAL[/value][/option][option label="OWN"][value]OWN[/value][/option][option label="LIST"][value]LIST[/value][/option][option label="BLACKLIST"][value]BLACKLIST[/value][/option][option label="CUSTOM"][value]CUSTOM[/value][/option][option label="BLOCK"][value]BLOCK[/value][/option][/field][field var="Domain filter domains (only LIST and BLACKLIST)" type="text-single"][value][/value][/field][field var="Max users" type="text-single"][value]0[/value][/field][field var="Allowed C2S,BOSH,WebSocket ports" type="text-single"][value][/value][/field][field var="Presence forward address" type="text-single"][value][/value][/field][field var="Message forward address" type="text-single"][value][/value][/field][field var="Other parameters" type="text-single"][value][/value][/field][field var="Allowed SASL mechanisms" type="text-single"][value][/value][/field][field var="Trusted JIDs" type="text-multi"][value/][/field][field var="Owner" type="text-single"][value]fun92477@jabber.today[/value][/field][field var="Administrators" type="text-single"][value][/value][/field][field type="boolean" label="Brute Force Prevention Enabled" var="brute-force-locker-enabled"][value]1[/value][/field][field type="text-single" label="Number of allowed invalid login" var="brute-force-locker-lock-after-fails"][value]5[/value][/field][field type="text-single" label="Disable account after failed login" var="brute-force-locker-disable-after-fails"][value]20[/value][/field][field type="text-single" label="Failed login in period of time [sec]" var="brute-force-locker-period-time"][value]60[/value][/field][field type="text-single" label="Lock time [sec]" var="brute-force-locker-lock-time"][value]60[/value][/field][field type="list-single" label="Brute Force Prevention Mode" var="brute-force-locker-mode"][value]IpJid[/value][option label="Ip"][value]Ip[/value][/option][option label="Jid"][value]Jid[/value][/option][option label="IpJid"][value]IpJid[/value][/option][/field][field type="text-single" label="Client Certificate CA" var="client-trust-extension-ca-cert-path"][value][/value][/field][field type="list-single" label="Client Certificate Required" var="client-trust-extension-cert-required"][value]null[/value][option label="Default"][value/][/option][option label="Yes"][value]true[/value][/option][option label="No"][value]false[/value][/option][/field][field type="text-multi" label="Abuse reporting addresses" var="disco-server-info-abuse"][value/][/field][field type="text-multi" label="Admin addresses" var="disco-server-info-admin"][value/][/field][field type="text-multi" label="Feedback addresses" var="disco-server-info-feedback"][value/][/field][field type="text-multi" label="Sales addresses" var="disco-server-info-sales"][value/][/field][field type="text-multi" label="Security addresses" var="disco-server-info-security"][value/][/field][field type="text-multi" label="Support addresses" var="disco-server-info-support"][value/][/field][field type="list-single" label="hardened-mode" var="hardened-mode"][value]secure[/value][option label="global"][value]global[/value][/option][option label="relaxed"][value]relaxed[/value][/option][option label="secure"][value]secure[/value][/option][option label="strict"][value]strict[/value][/option][/field][field type="boolean" label="Message Archiving enabled" var="message-archive-enabled"][value]1[/value][/field][field type="list-single" label="Message Archiving - default store method" var="message-archive-default-store-method"][value]null[/value][option label="Default"][value/][/option][option label="False"][value]false[/value][/option][option label="Body"][value]body[/value][/option][option label="Message"][value]message[/value][/option][option label="Stream"][value]stream[/value][/option][/field][field type="list-single" label="Message Archiving - required store method" var="message-archive-required-store-method"][value]null[/value][option label="Default"][value/][/option][option label="False"][value]false[/value][/option][option label="Body"][value]body[/value][/option][option label="Message"][value]message[/value][/option][option label="Stream"][value]stream[/value][/option][/field][field type="list-single" label="Message Archiving - retention type" var="message-archive-retention-type"][value]userDefined[/value][option label="User defined"][value]userDefined[/value][/option][option label="Unlimited"][value]unlimited[/value][/option][option label="Number of days"][value]numberOfDays[/value][/option][/field][field type="text-single" label="Message Archiving - retention period (in days)" var="message-archive-retention-days"][value][/value][/field][field type="list-single" label="Message Archiving - store MUC messages" var="message-archive-save-muc"][value]null[/value][option label="Default"][value/][/option][option label="User"][value]user[/value][/option][option label="False"][value]false[/value][/option][option label="True"][value]true[/value][/option][/field][field type="list-single" label="Automatically authorize subscription requests" var="presence-subscription-auto-authorize"][value]null[/value][option label="Default"][value/][/option][option label="Yes"][value]true[/value][/option][option label="No"][value]false[/value][/option][/field][field type="boolean" label="see-other-host redirection enabled" var="see-other-host-see-other-host-redirect-enabled"][value]1[/value][/field][field var="command-marker" type="hidden"][value]command-marker[/value][/field][/x][/command][/iq]

Payload:

<iq type="set" to="vhost-man@jabber.today" id="JK3i2v">
    <command xmlns="http://jabber.org/protocol/commands" node="comp-repo-item-add" action="execute">
        <x xmlns="jabber:x:data" type="submit">
            <instructions>❗NOTE: Options without value set will use configuration defined in &apos;DEFAULT&apos;
                VHost❗
            </instructions>
            <field var="Domain name" type="text-single">
                <value></value>
            </field>
            <field var="Enabled" type="boolean">
                <value>1</value>
            </field>
            <field var="Anonymous enabled" type="boolean">
                <value>1</value>
            </field>
            <field var="In-band registration" type="boolean">
                <value>1</value>
            </field>
            <field var="TLS" type="fixed">
                <value>This installation forces VHost to require TLS. If you need to use unencrypted connections set
                    &apos;vhost-tls-required&apos; property to &apos;false&apos; in the installation configuration file
                </value>
            </field>
            <field var="S2S secret" type="text-single">
                <value>02c46427-3616-4de4-8a04-01325198c7e8</value>
            </field>
            <field type="list-single" label="Domain filter policy" var="Domain filter policy">
                <value>ALL</value>
                <option label="DEFAULT">
                    <value>DEFAULT</value>
                </option>
                <option label="ALL">
                    <value>ALL</value>
                </option>
                <option label="LOCAL">
                    <value>LOCAL</value>
                </option>
                <option label="OWN">
                    <value>OWN</value>
                </option>
                <option label="LIST">
                    <value>LIST</value>
                </option>
                <option label="BLACKLIST">
                    <value>BLACKLIST</value>
                </option>
                <option label="CUSTOM">
                    <value>CUSTOM</value>
                </option>
                <option label="BLOCK">
                    <value>BLOCK</value>
                </option>
            </field>
            <field var="Domain filter domains (only LIST and BLACKLIST)" type="text-single">
                <value></value>
            </field>
            <field var="Max users" type="text-single">
                <value>0</value>
            </field>
            <field var="Allowed C2S,BOSH,WebSocket ports" type="text-single">
                <value></value>
            </field>
            <field var="Presence forward address" type="text-single">
                <value></value>
            </field>
            <field var="Message forward address" type="text-single">
                <value></value>
            </field>
            <field var="Other parameters" type="text-single">
                <value></value>
            </field>
            <field var="Allowed SASL mechanisms" type="text-single">
                <value></value>
            </field>
            <field var="Trusted JIDs" type="text-multi">
                <value/>
            </field>
            <field var="Owner" type="text-single">
                <value>fun92477@jabber.today</value>
            </field>
            <field var="Administrators" type="text-single">
                <value></value>
            </field>
            <field type="boolean" label="Brute Force Prevention Enabled" var="brute-force-locker-enabled">
                <value>1</value>
            </field>
            <field type="text-single" label="Number of allowed invalid login" var="brute-force-locker-lock-after-fails">
                <value>5</value>
            </field>
            <field type="text-single" label="Disable account after failed login"
                   var="brute-force-locker-disable-after-fails">
                <value>20</value>
            </field>
            <field type="text-single" label="Failed login in period of time <sec>" var="brute-force-locker-period-time">
                <value>60</value>
            </field>
            <field type="text-single" label="Lock time <sec>" var="brute-force-locker-lock-time">
                <value>60</value>
            </field>
            <field type="list-single" label="Brute Force Prevention Mode" var="brute-force-locker-mode">
                <value>IpJid</value>
                <option label="Ip">
                    <value>Ip</value>
                </option>
                <option label="Jid">
                    <value>Jid</value>
                </option>
                <option label="IpJid">
                    <value>IpJid</value>
                </option>
            </field>
            <field type="text-single" label="Client Certificate CA" var="client-trust-extension-ca-cert-path">
                <value></value>
            </field>
            <field type="list-single" label="Client Certificate Required" var="client-trust-extension-cert-required">
                <value>null</value>
                <option label="Default">
                    <value/>
                </option>
                <option label="Yes">
                    <value>true</value>
                </option>
                <option label="No">
                    <value>false</value>
                </option>
            </field>
            <field type="text-multi" label="Abuse reporting addresses" var="disco-server-info-abuse">
                <value/>
            </field>
            <field type="text-multi" label="Admin addresses" var="disco-server-info-admin">
                <value/>
            </field>
            <field type="text-multi" label="Feedback addresses" var="disco-server-info-feedback">
                <value/>
            </field>
            <field type="text-multi" label="Sales addresses" var="disco-server-info-sales">
                <value/>
            </field>
            <field type="text-multi" label="Security addresses" var="disco-server-info-security">
                <value/>
            </field>
            <field type="text-multi" label="Support addresses" var="disco-server-info-support">
                <value/>
            </field>
            <field type="list-single" label="hardened-mode" var="hardened-mode">
                <value>secure</value>
                <option label="global">
                    <value>global</value>
                </option>
                <option label="relaxed">
                    <value>relaxed</value>
                </option>
                <option label="secure">
                    <value>secure</value>
                </option>
                <option label="strict">
                    <value>strict</value>
                </option>
            </field>
            <field type="boolean" label="Message Archiving enabled" var="message-archive-enabled">
                <value>1</value>
            </field>
            <field type="list-single" label="Message Archiving - default store method"
                   var="message-archive-default-store-method">
                <value>null</value>
                <option label="Default">
                    <value/>
                </option>
                <option label="False">
                    <value>false</value>
                </option>
                <option label="Body">
                    <value>body</value>
                </option>
                <option label="Message">
                    <value>message</value>
                </option>
                <option label="Stream">
                    <value>stream</value>
                </option>
            </field>
            <field type="list-single" label="Message Archiving - required store method"
                   var="message-archive-required-store-method">
                <value>null</value>
                <option label="Default">
                    <value/>
                </option>
                <option label="False">
                    <value>false</value>
                </option>
                <option label="Body">
                    <value>body</value>
                </option>
                <option label="Message">
                    <value>message</value>
                </option>
                <option label="Stream">
                    <value>stream</value>
                </option>
            </field>
            <field type="list-single" label="Message Archiving - retention type" var="message-archive-retention-type">
                <value>userDefined</value>
                <option label="User defined">
                    <value>userDefined</value>
                </option>
                <option label="Unlimited">
                    <value>unlimited</value>
                </option>
                <option label="Number of days">
                    <value>numberOfDays</value>
                </option>
            </field>
            <field type="text-single" label="Message Archiving - retention period (in days)"
                   var="message-archive-retention-days">
                <value></value>
            </field>
            <field type="list-single" label="Message Archiving - store MUC messages" var="message-archive-save-muc">
                <value>null</value>
                <option label="Default">
                    <value/>
                </option>
                <option label="User">
                    <value>user</value>
                </option>
                <option label="False">
                    <value>false</value>
                </option>
                <option label="True">
                    <value>true</value>
                </option>
            </field>
            <field type="list-single" label="Automatically authorize subscription requests"
                   var="presence-subscription-auto-authorize">
                <value>null</value>
                <option label="Default">
                    <value/>
                </option>
                <option label="Yes">
                    <value>true</value>
                </option>
                <option label="No">
                    <value>false</value>
                </option>
            </field>
            <field type="boolean" label="see-other-host redirection enabled"
                   var="see-other-host-see-other-host-redirect-enabled">
                <value>1</value>
            </field>
            <field var="command-marker" type="hidden">
                <value>command-marker</value>
            </field>
        </x>
    </command>
</iq>
Andrzej Wójcik (Tigase) commented 3 years ago

Fix applied. It will now return Note field with proper error message.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Version
tigase-server-8.2.0
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#1189
Please wait...
Page is in error, reload to recover