Projects tigase _server server-core Issues #1442
Using Tsung can not register user (#1442)
Unknown opened 4 years ago

I have a problem with… Using Tsung can not register user.When I start tsung,I can't see user add in MySQL(table tig_users).Tsung script use jabber_register.xml

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/tsung/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" dumptraffic="false" version="1.0">

<clients>
  <client host="localhost" use_controller_vm="true">
  </client>
</clients>

<servers>
   <server host='im.tigase.com' port='5222' type='tcp'/>
</servers>

<load>
  <arrivalphase phase="1" duration="1" unit="minute">
    <users maxnumber="20" interarrival="3" unit="second"></users>
  </arrivalphase>
</load>

<options>
  <option type="ts_jabber" name="global_number" value="20"></option>
  <option type="ts_jabber" name="userid_max" value="20"></option>
  <option type="ts_jabber" name="domain" value="im.tigase.com"></option>
  <option type="ts_jabber" name="username" value="tsung"></option>
  <option type="ts_jabber" name="passwd" value="tsung"></option>
</options>

<sessions>
  <session probability="100" name="jabber-example" type="ts_jabber">

    <request>
      <jabber type="connect" ack="local"></jabber>
    </request>

    <request>
      <match do="abort" when="match">error</match>
      <jabber type="register" ack="local" id="new"></jabber>
    </request>

    <request>
      <jabber type="close" ack="local"></jabber>
    </request>

  </session>
</sessions>
</tsung>

Details (please complete the following information):

  • Tigase version: 8.1.2
  • JVM flavour and version JDK 11
  • Operating system/distribution/version [e.g. Linux CentOS 7]
  • Tsung version: 1.7.0

Log Tigase

[2021-05-07 16:09:53:408] [FINER   ] [         in_2-sess-man ] SessionManager.processCommand()  : STREAM_CLOSED command from: c2s@im.tigase.com/101.xx.xx.xx_5222_101.xx.xx.xxx_55730
[2021-05-07 16:09:53:408] [FINEST  ] [  session-close-proc-2 ] SessionManager$SessionCloseProc.process(): Executing connection close for: from=c2s@im.tigase.com/101.xx.xx.xx_5222_101.xx.xx.xxx_55730, to=sess-man@im.tigase.com, DATA=<iq type="set" to="sess-man@im.tigase.com" from="c2s@im.tigase.com/101.xx.xx.xx_5222_101.xx.xx.xxx_55730" retryCount="15" delay="120" id="cc0b5c05-5c35-4aab-8f55-999f6dc79a18"><command node="STREAM_CLOSED" xmlns="http://jabber.org/protocol/commands"/></iq>, SIZE=255, XMLNS=null, PRIORITY=SYSTEM, PERMISSION=NONE, TYPE=set
[2021-05-07 16:09:53:408] [FINER   ] [  session-close-proc-2 ] SessionManager.closeConnection() : Stream closed from: c2s@im.tigase.com/101.xx.xx.xx_5222_101.xx.xx.xxx_55730
[2021-05-07 16:09:53:408] [FINEST  ] [   in_2-message-router ] MessageRouter.processPacket()    : Processing packet: from=sess-man@im.tigase.com, to=c2s@im.tigase.com/101.xx.xx.xx_5222_101.xx.xx.xxx_55730, DATA=<iq type="result" to="c2s@im.tigase.com/101.xx.xx.xx_5222_101.xx.xx.xxx_55730" from="sess-man@im.tigase.com" id="cc0b5c05-5c35-4aab-8f55-999f6dc79a18"/>, SIZE=151, XMLNS=null, PRIORITY=SYSTEM, PERMISSION=NONE, TYPE=result
[2021-05-07 16:09:53:408] [FINEST  ] [   in_2-message-router ] MessageRouter.getLocalComponent(): Called for : c2s@im.tigase.com/101.xx.xx.xx_5222_101.xx.xx.xxx_55730
[2021-05-07 16:09:53:408] [FINEST  ] [   in_2-message-router ] MessageRouter.getLocalComponent(): No componentID matches (fast lookup against exact address): c2s@im.tigase.com/101.xx.xx.xx_5222_101.xx.xx.xxx_55730, for map: [sess-man@im.tigase.com, ws2s@im.tigase.com, upload@im.tigase.com, message-archive@im.tigase.com, amp@im.tigase.com, monitor@im.tigase.com, stats@im.tigase.com, bosh@im.tigase.com, http@im.tigase.com, cl-comp@im.tigase.com, message-router@im.tigase.com, pubsub@im.tigase.com, c2s@im.tigase.com, test@im.tigase.com, cluster-contr@im.tigase.com, vhost-man@im.tigase.com, s2s@im.tigase.com, eventbus@im.tigase.com, muc@im.tigase.com]; trying VHost lookup
[2021-05-07 16:09:53:408] [FINEST  ] [   in_2-message-router ] MessageRouter.getLocalComponent(): Called for : c2s@im.tigase.com/101.xx.xx.xx_5222_101.xx.xx.xxx_55730
[2021-05-07 16:09:53:408] [FINEST  ] [   in_2-message-router ] MessageRouter.getLocalComponent(): No componentID matches (fast lookup against exact address): c2s@im.tigase.com/101.xx.xx.xx_5222_101.xx.xx.xxx_55730, for map: [sess-man@im.tigase.com, ws2s@im.tigase.com, upload@im.tigase.com, message-archive@im.tigase.com, amp@im.tigase.com, monitor@im.tigase.com, stats@im.tigase.com, bosh@im.tigase.com, http@im.tigase.com, cl-comp@im.tigase.com, message-router@im.tigase.com, pubsub@im.tigase.com, c2s@im.tigase.com, test@im.tigase.com, cluster-contr@im.tigase.com, vhost-man@im.tigase.com, s2s@im.tigase.com, eventbus@im.tigase.com, muc@im.tigase.com]; trying VHost lookup
[2021-05-07 16:09:53:408] [FINEST  ] [   in_2-message-router ] MessageRouter.processPacket()    : 1. Packet will be processed by: c2s@im.tigase.com, from=sess-man@im.tigase.com, to=c2s@im.tigase.com/101.xx.xx.xx_5222_101.xx.xx.xxx_55730, DATA=<iq type="result" to="c2s@im.tigase.com/101.xx.xx.xx_5222_101.xx.xx.xxx_55730" from="sess-man@im.tigase.com" id="cc0b5c05-5c35-4aab-8f55-999f6dc79a18"/>, SIZE=151, XMLNS=null, PRIORITY=SYSTEM, PERMISSION=NONE, TYPE=result
Unknown commented 4 years ago

Could you share more logs? Because you only shared stream closing sequence and we lack what caused it.

  1. do the domain match with VHost in tigase-server?
  2. can you register using regular client? Do you have captcha enabled? If you are using default settings then most like you have emailRequired (in jabber:iq:register plugin), which enables DataForm registration and probably tsung doesn't support it or you are not activating the accounts.

Disabling it should fix the issue (if my guess is right)

'sess-man' () {
    'jabber:iq:register' () {
        emailRequired = false
    }
}
Unknown commented 4 years ago

@woj-tek tigase.log.0.txt I upload log file directly which log since tsung start.

1.The domain match with VHost in tigase-server is abc.im.tigase.com(not real domain) 2.I can register for Conversations. Stork IM etc.And I try disable captcha and email required,but it still have no user info add at database

Unknown commented 4 years ago

Update.It's OK for Jaxmpp but failed for tsung

Jaxmpp contact = new Jaxmpp();
contact.getConnectionConfiguration().setConnectionType(ConnectionConfiguration.ConnectionType.bosh);
contact.getConnectionConfiguration().setBoshService("http://abc.im.tigase.com:5280/");
contact.getConnectionConfiguration().setDomain("abc.im.tigase.com");
contact.getModulesManager().register(new InBandRegistrationModule());

contact.getEventBus().addHandler(Connector.ConnectedHandler.ConnectedEvent.class, new Connector.ConnectedHandler() {
            @Override
            public void onConnected(SessionObject sessionObject) {
                try {
                    contact.getModulesManager().getModule(InBandRegistrationModule.class).register(userName, password, email, new AsyncCallback() {
                        @Override
                        public void onError(Stanza stanza, XMPPException.ErrorCondition errorCondition) throws JaxmppException {

                        }

                        @Override
                        public void onSuccess(Stanza stanza) throws JaxmppException {

                        }

                        @Override
                        public void onTimeout() throws JaxmppException {

                        }
                    });
                } catch (Exception ex) {
                }
            }
        });

contact.getEventBus().addHandler(Connector.DisconnectedHandler.DisconnectedEvent.class, new Connector.DisconnectedHandler() {
            @Override
            public void onDisconnected(SessionObject sessionObject) {
            }
        });


if (!contact.isConnected()) {
    try {
        contact.login(false);
    } catch (JaxmppException e) {
    }
}
Unknown commented 4 years ago

This is the relevant part from the log:

[2021-05-07 20:06:17:717] [FINEST  ] [        in_23-sess-man ] SessionManager.processPacket()   : Packet blocked by: starttls, packetfrom=c2s@abc.im.tigase.com/101.xx.xxx.xx_5222_101.xx.xxx.xx_46649, to=sess-man@abc.im.tigase.com, DATA=<iq type="set" xmlns="jabber:client" id="2"><query xmlns="jabber:iq:register"><username>CData size: 6</username><resource>CData size: 5</resource><password>CData size: 6</password></query></iq>, SIZE=171, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=set
[2021-05-07 20:06:17:717] [FINEST  ] [        in_23-sess-man ] SessionManager.processPacket()   : Packet not processed: from=c2s@abc.im.tigase.com/101.xx.xxx.xx_5222_101.xx.xxx.xx_46649, to=sess-man@abc.im.tigase.com, DATA=<iq type="set" xmlns="jabber:client" id="2"><query xmlns="jabber:iq:register"><username>CData size: 6</username><resource>CData size: 5</resource><password>CData size: 6</password></query></iq>, SIZE=171, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=LOCAL, TYPE=set
[2021-05-07 20:06:17:717] [FINEST  ] [   in_7-message-router ] MessageRouter.processPacket()    : Processing packet: from=sess-man@abc.im.tigase.com, to=c2s@abc.im.tigase.com/101.xx.xxx.xx_5222_101.xx.xxx.xx_46649, DATA=<iq type="error" id="2" xmlns="jabber:client"><query xmlns="jabber:iq:register"><username>CData size: 6</username><resource>CData size: 5</resource><password>CData size: 6</password></query><error type="cancel" code="503"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xml:lang="en" xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">CData size: 22</text></error></iq>, SIZE=372, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=error

Packet blocked by: starttls, - this is because Tigase requires encrypted connection (starttls or DirectSSL). See this section: http://tsung.erlang-projects.org/user_manual/conf-sessions.html#starttls

Unknown commented 4 years ago

@woj-tek OK,Thanks.I will try it

Unknown commented 4 years ago

@woj-tek Hello,this is my new xml which add starttls but it still register account failed

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/tsung/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" dumptraffic="false" version="1.0">

<clients>
  <client host="localhost" use_controller_vm="true">
  </client>
</clients>

<servers>
   <server host='im.tigase.com' port='5222' type='tcp'/>
</servers>

<load>
  <arrivalphase phase="1" duration="1" unit="minute">
    <users maxnumber="20" interarrival="3" unit="second"></users>
  </arrivalphase>
</load>

<options>
  <option type="ts_jabber" name="global_number" value="20"></option>
  <option type="ts_jabber" name="userid_max" value="20"></option>
  <option type="ts_jabber" name="domain" value="im.tigase.com"></option>
  <option type="ts_jabber" name="username" value="tsungtest"></option>
  <option type="ts_jabber" name="passwd" value="tsungtest"></option>
</options>

<sessions>
  <session probability="100" name="jabber-example" type="ts_jabber">
	<request> <jabber type="connect" ack="local"></jabber> </request>
    <request>
  	<jabber type="starttls" ack="bidi_ack"/>
    </request>

    <request>
      <match do="abort" when="match">error</match>
      <jabber type="register" ack="local" id="new"></jabber>
    </request>

    <request>
      <jabber type="close" ack="local"></jabber>
    </request>

  </session>
</sessions>
</tsung>

and this is log file tigase.log.0.txt

I have no idea after look for log file.So I need your help,Thank you

Unknown commented 4 years ago

It looks like tsung is immediately doing starttls without waiting to fully open the stream. Please try this:

            <transaction name="connect">
                <request>
                    <jabber type="connect" ack="no_ack"/>
                </request>
            </transaction>

            <thinktime value="5"/>

            <transaction name="starttls">
                <request>
                    <jabber type="starttls" ack="bidi_ack"/>
                </request>
                <request>
                    <jabber type="connect" ack="no_ack"/>
                </request>
            </transaction>

            <thinktime value="15"/>

            <transaction name="auth_plain">
                <request>
                    <match do="abort" when="match">error</match>
                    <jabber type="register" ack="local" id="new"></jabber>
                </request>
            </transaction>

            <thinktime value="25"/>
Unknown commented 4 years ago

@woj-tek Thanks

issue 1 of 1
Type
Question
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#1442
Please wait...
Page is in error, reload to recover