AnsweredAssumed Answered

Trouble with SI File Transfer on Linux that works on Windows

Question asked by Jake Keuhlen on Dec 6, 2016
Latest reply on Dec 7, 2016 by Jake Keuhlen

I'm currently using 4.1.8.

 

I'm using a smack bot to server files over chat, and have behavior that works mostly as expected when running under windows. When I deploy this bot on our linux server environment (Ubuntu 14.04), all file transfers fail. I can still send chat messages on the linux side, but no files can get through. Below is the raw xml packets, as well as the relevant chunk of code where this issue occurs. I also asked a related question about the meanings on the different status fields within <si> tags over on stackoverflow: xmpp - What do the status elements represent in SI File Transfer? - Stack Overflow

 

Any advice would be greatly appreciated!

 

      OutgoingFileTransfer transfer = ftm.createOutgoingFileTransfer(target + "/" + jidCache.get(target));

      transfer.sendFile(new File("transfers/" + name), "SpeakTransfer");

      try {

        // Prevent it from stalling forever on a file transfer

        int counter = 0;

        FileTransfer.Status stPrev = FileTransfer.Status.initial;

        while(!transfer.isDone() && counter < 60) {

          if(transfer.getStatus().equals(FileTransfer.Status.error)) {

            System.out.println("FileTransferError: " + transfer.getError());

          }

          if(transfer.getStatus().equals(FileTransfer.Status.refused)) {

            System.out.println("FileTransfer denied.");

            transfer.cancel();

          }

          if (!transfer.getStatus().equals(FileTransfer.Status.in_progress)) {

            Thread.sleep(500);

            counter++;

          }

          if (transfer.getStatus() != stPrev) {

            System.out.println(transfer.getStatus());

          }

          stPrev = transfer.getStatus();

        }

        if (!transfer.isDone()) {

          System.out.println("Cancelling transfer.");

          transfer.cancel();

          Message cancelMsg = new Message();

          cancelMsg.setBody("I'm cancelling the file transfer since something went wrong or you did not respond.");

          chat.sendMessage(cancelMsg);

        }

      } catch (Exception e) {

        e.printStackTrace();

        System.exit(1);

      }

 

RAW XML Packets from Windows:

10:20:16 AM SENT (0): <iq to='ciscoJabberClient@example.com/jabber_18921' id='NfyyC-1885' type='set'><si xmlns='http://jabber.org/protocol/si' id='jsi_5637924750782884752' profile='http://jabber.org/protocol/si/profile/file-transfer'><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="81679-0264.nrl" size="123" ><desc>SpeakTransfer</desc></file><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns='jabber:x:data' type='form'><field var='stream-method' type='list-single'><option><value>http://jabber.org/protocol/bytestreams</value></option><option><value>http://jabber.org/protocol/ibb</value></option></field></x></feature></si></iq>

10:20:17 AM RECV (0): <iq from='ciscoJabberClient@example.com/jabber_18921' id='NfyyC-1885' to='smackBot@example.com/Smack' type='result' xml:lang='en'><si xmlns='http://jabber.org/protocol/si'><feature xmlns='http://jabber.org/protocol/feature-neg'><x type='submit' xmlns='jabber:x:data'><field type='text-single' var='stream-method'><value>http://jabber.org/protocol/bytestreams</value></field></x></feature></si></iq>

10:20:17 AM SENT (0): <iq to='ciscoJabberClient@example.com/jabber_18921' id='NfyyC-1887' type='get'><query xmlns='http://jabber.org/protocol/disco#info' node='http://protocols.cisco.com/jabber?v=10.6.3+p=win#mKEfN5Ip/YDzHfcV1VIQaTZVAl8='></query></iq>

10:20:17 AM RECV (0): <iq from='ciscoJabberClient@example.com/jabber_18921' id='NfyyC-1887' to='smackBot@example.com/Smack' type='result' xml:lang='en'><query node='http://protocols.cisco.com/jabber?v=10.6.3+p=win#mKEfN5Ip/YDzHfcV1VIQaTZVAl8=' xmlns='http://jabber.org/protocol/disco#info'><identity category='client' name='Cisco Jabber 10.6.3' type='im'/><feature var='cisco.com/p2p-desktop-share'/><feature var='http://jabber.org/protocol/bytestreams'/><feature var='http://jabber.org/protocol/caps'/><feature var='http://jabber.org/protocol/commands'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='http://jabber.org/protocol/disco#items'/><feature var='http://jabber.org/protocol/geoloc'/><feature var='http://jabber.org/protocol/geoloc+notify'/><feature var='http://jabber.org/protocol/muc'/><feature var='http://jabber.org/protocol/si'/><feature var='http://jabber.org/protocol/si/profile/file-transfer'/><feature var='http://jabber.org/protocol/xhtml-im'/><feature var='http://webex.com/connect/aes-file-transfer'/><feature var='http://webex.com/connect/customcaps/ds'/><feature var='http://webex.com/connect/customcaps/jinglecmd'/><feature var='http://webex.com/connect/customcaps/picture-share'/><feature var='http://webex.com/connect/customcaps/picture-share-mix'/><feature var='jabber:iq:version'/><feature var='jabber:x:conference'/><feature var='urn:xmpp:ooo:0+notify'/></query></iq>

10:20:17 AM SENT (0): <iq to='example.com' id='NfyyC-1889' type='get'><query xmlns='http://jabber.org/protocol/disco#items'></query></iq>

10:20:17 AM RECV (0): <iq from='example.com' id='NfyyC-1889' to='smackBot@example.com/Smack' type='result' xml:lang='en'><query xmlns='http://jabber.org/protocol/disco#items'><item jid='conference-2-standalonecluster52383.example.com'/></query></iq>

10:20:17 AM SENT (0): <iq to='conference-2-standalonecluster52383.example.com' id='NfyyC-1891' type='get'><query xmlns='http://jabber.org/protocol/disco#info'></query></iq>

10:20:17 AM RECV (0): <iq from='conference-2-standalonecluster52383.example.com' id='NfyyC-1891' to='smackBot@example.com/Smack' type='result' xml:lang='en'><query xmlns='http://jabber.org/protocol/disco#info'><identity category='conference' name='Text Conferencing' type='text'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='http://jabber.org/protocol/disco#items'/><feature var='groupchat'/><feature var='gc-1.0'/><feature var='http://jabber.org/protocol/muc'/><feature var='urn:xmpp:time'/></query></iq>

10:20:17 AM SENT (0): <iq to='ciscoJabberClient@example.com/jabber_18921' id='NfyyC-1893' type='set'><query xmlns='http://jabber.org/protocol/bytestreams' sid='jsi_5637924750782884752' mode='tcp'><streamhost jid='smackBot@example.com/Smack' host='fe80:0:0:0:c00d:9e4d:2b2b:8689%eth2' port='7777'/><streamhost jid='smackBot@example.com/Smack' host='fe80:0:0:0:b14c:cd07:84ea:5924%wlan0' port='7777'/><streamhost jid='smackBot@example.com/Smack' host='10.53.4.101' port='7777'/><streamhost jid='smackBot@example.com/Smack' host='fe80:0:0:0:99e2:a597:3b47:fd93%wlan1' port='7777'/><streamhost jid='smackBot@example.com/Smack' host='fe80:0:0:0:0:ffff:ffff:fffe%net0' port='7777'/><streamhost jid='smackBot@example.com/Smack' host='2601:281:8000:1abe:b14c:cd07:84ea:5924' port='7777'/><streamhost jid='smackBot@example.com/Smack' host='2601:281:8000:1abe:e9e4:f699:7468:1b91' port='7777'/><streamhost jid='smackBot@example.com/Smack' host='fe80:0:0:0:0:5efe:a35:465%net8' port='7777'/><streamhost jid='smackBot@example.com/Smack' host='fe80:0:0:0:d0b1:cf05:89fa:ac1%eth0' port='7777'/></query></iq>

10:20:18 AM RECV (0): <iq from='ciscoJabberClient@example.com/jabber_18921' id='NfyyC-1893' to='smackBot@example.com/Smack' type='result' xml:lang='en'><query sid='jsi_5637924750782884752' xmlns='http://jabber.org/protocol/bytestreams'><streamhost-used jid='smackBot@example.com/Smack'/></query></iq>

10:20:18 AM RECV (0): <iq from='ciscoJabberClient@example.com/jabber_18921' id='uid:58175a8b:00007e06:00002cf6' to='smackBot@example.com/Smack' type='set' xml:lang='en'><si notifyid='jsi_5637924750782884752' profile='http://jabber.org/protocol/si/profile/file-transfer' status='0' xmlns='http://jabber.org/protocol/si'/></iq>

 

 

RAW XML Packets from Ubuntu:

10:03:44 AM SENT (0): <iq to='ciscoJabberClient@example.com/jabber_18921' id='BtZbw-1871' type='set'><si xmlns='http://jabber.org/protocol/si' id='jsi_5724182428385442961' profile='http://jabber.org/protocol/si/profile/file-transfer'><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="81679-0264.nrl" size="123" ><desc>SpeakTransfer</desc></file><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns='jabber:x:data' type='form'><field var='stream-method' type='list-single'><option><value>http://jabber.org/protocol/bytestreams</value></option><option><value>http://jabber.org/protocol/ibb</value></option></field></x></feature></si></iq>

10:03:46 AM RECV (0): <iq from='ciscoJabberClient@example.com/jabber_18921' id='BtZbw-1871' to='smackBot@example.com/Smack' type='result' xml:lang='en'><si xmlns='http://jabber.org/protocol/si'><feature xmlns='http://jabber.org/protocol/feature-neg'><x type='submit' xmlns='jabber:x:data'><field type='text-single' var='stream-method'><value>http://jabber.org/protocol/bytestreams</value></field></x></feature></si></iq>

10:03:46 AM SENT (0): <iq to='ciscoJabberClient@example.com/jabber_18921' id='BtZbw-1873' type='get'><query xmlns='http://jabber.org/protocol/disco#info' node='http://protocols.cisco.com/jabber?v=10.6.3+p=win#mKEfN5Ip/YDzHfcV1VIQaTZVAl8='></query></iq>

10:03:46 AM RECV (0): <iq from='ciscoJabberClient@example.com/jabber_18921' id='BtZbw-1873' to='smackBot@example.com/Smack' type='result' xml:lang='en'><query node='http://protocols.cisco.com/jabber?v=10.6.3+p=win#mKEfN5Ip/YDzHfcV1VIQaTZVAl8=' xmlns='http://jabber.org/protocol/disco#info'><identity category='client' name='Cisco Jabber 10.6.3' type='im'/><feature var='cisco.com/p2p-desktop-share'/><feature var='http://jabber.org/protocol/bytestreams'/><feature var='http://jabber.org/protocol/caps'/><feature var='http://jabber.org/protocol/commands'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='http://jabber.org/protocol/disco#items'/><feature var='http://jabber.org/protocol/geoloc'/><feature var='http://jabber.org/protocol/geoloc+notify'/><feature var='http://jabber.org/protocol/muc'/><feature var='http://jabber.org/protocol/si'/><feature var='http://jabber.org/protocol/si/profile/file-transfer'/><feature var='http://jabber.org/protocol/xhtml-im'/><feature var='http://webex.com/connect/aes-file-transfer'/><feature var='http://webex.com/connect/customcaps/ds'/><feature var='http://webex.com/connect/customcaps/jinglecmd'/><feature var='http://webex.com/connect/customcaps/picture-share'/><feature var='http://webex.com/connect/customcaps/picture-share-mix'/><feature var='jabber:iq:version'/><feature var='jabber:x:conference'/><feature var='urn:xmpp:ooo:0+notify'/></query></iq>

10:03:46 AM SENT (0): <iq to='example.com' id='BtZbw-1875' type='get'><query xmlns='http://jabber.org/protocol/disco#items'></query></iq>

10:03:46 AM RECV (0): <iq from='example.com' id='BtZbw-1875' to='smackBot@example.com/Smack' type='result' xml:lang='en'><query xmlns='http://jabber.org/protocol/disco#items'><item jid='conference-2-standalonecluster52383.example.com'/></query></iq>

10:03:46 AM SENT (0): <iq to='conference-2-standalonecluster52383.example.com' id='BtZbw-1877' type='get'><query xmlns='http://jabber.org/protocol/disco#info'></query></iq>

10:03:46 AM RECV (0): <iq from='conference-2-standalonecluster52383.example.com' id='BtZbw-1877' to='smackBot@example.com/Smack' type='result' xml:lang='en'><query xmlns='http://jabber.org/protocol/disco#info'><identity category='conference' name='Text Conferencing' type='text'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='http://jabber.org/protocol/disco#items'/><feature var='groupchat'/><feature var='gc-1.0'/><feature var='http://jabber.org/protocol/muc'/><feature var='urn:xmpp:time'/></query></iq>

10:03:46 AM SENT (0): <iq to='ciscoJabberClient@example.com/jabber_18921' id='BtZbw-1879' type='set'><query xmlns='http://jabber.org/protocol/bytestreams' sid='jsi_5724182428385442961' mode='tcp'><streamhost jid='smackBot@example.com/Smack' host='fe80:0:0:0:250:56ff:fe87:726e%eth0' port='7777'/><streamhost jid='smackBot@example.com/Smack' host='10.10.162.127' port='7777'/></query></iq>

10:04:02 AM RECV (0): <iq from='ciscoJabberClient@example.com/jabber_18921' id='uid:58175a8b:00000029:00002ce0' to='smackBot@example.com/Smack' type='set' xml:lang='en'><si notifyid='jsi_5724182428385442961' profile='http://jabber.org/protocol/si/profile/file-transfer' status='1039' xmlns='http://jabber.org/protocol/si'/></iq>

Outcomes