File Transfer failed with error

Using Smack 4.2.0 alpha 1 File transfers between two devices running smack library fails with the IQ being sent below, while transferring a file from device to Spark PC client works both ways.

<iq to='user1' id='G6Ii2-10' type='result'><si xmlns=''><feature xmlns=""><x xmlns='jabber:x:data' type='submit'><field var='stream-method'><value></value><value></value></field></x></feature></si></iq>
<iq id='G6Ii2-12' type='get' to='user2' from='user1'><query xmlns=''/></iq>
<iq to='user1' id='G6Ii2-12' type='result'><query xmlns=''><identity category='client' name='Smack' type='pc'/><feature var=''/><feature var='jabber:iq:privacy'/><feature var='urn:xmpp:ping'/><feature var=''/><feature var=''/><feature var='jabber:iq:last'/><feature var=''/><feature var=''/><feature var='vcard-temp'/><feature var=''/><feature var='urn:xmpp:receipts'/><feature var='urn:xmpp:time'/><feature var=''/><feature var=''/><feature var=''/><feature var=''/><feature var=''/><feature var='jabber:x:data'/></query></iq>
<iq id='G6Ii2-20' type='set' to='user2' from='user1'><query mode='tcp' xmlns='' sid='jsi_8884251155854709297'><streamhost jid='user1' port='7777' host=''/><streamhost jid='user1' port='7777' host='fe80::c1df:2ebb:1786:b4d8%rmnet0'/></query></iq>
<iq to='user1' id='G6Ii2-20' type='error'><error type='cancel'><item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xml:lang='en'>Could not establish socket with any provided host</text></error></iq>
7<iq id='G6Ii2-22' type='set' to='user2' from='user1'><open block-size='4096' xmlns='' stanza='iq' sid='jsi_8884251155854709297'/></iq>

After more testing, on WiFi connections files seem to be working ok, but once it hits mobile connections the file transfer gets stuck at negotiating transfer.

From this I see that one of the iq packets has said error and “Could not establish socket with any provided host” which I don’t know why I should be getting this error.

After attempting more transfers from Spark Windows client I received this in the logs when trying to send a file

SEVERE: There was an error during file transfer.

Error in execution:

– caused by: java.util.concurrent.ExecutionException:

– caused by: Could not establish socket with any provided host: item-not-found(404) Could not establish socket with any provided host

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer.negotiateStream(Incom

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer.access$100(IncomingFi

at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer$

at Source)

Turns out to be a server issue, I was running prosody server and I had to enable file transfer proxy. Moving on with development now.

Nonetheless, file transfer should work, even if the server doesn’t offer any file transfer proxy. The log says it tries to open an IBB stream:

<open block-size=‘4096’ xmlns=‘

but obviously it got never negotiated? Might be this issue: SMACK-584

You are indeed right, as if I remember correctly, previous versions of smack worked without the need of my proxy intervention. It is therefore something to look at for the next smack release hopefully. @wroot