PC can be very good to achieve the video upload and download, but there are two problems in the use of IOS devices:
1、In the IOS7.0 devices can not upload the video, the following is log:
[DEBUG] Did open connection on socket 17
[DEBUG] Did connect
[DEBUG] Did start background task
[DEBUG] Connection received 528 bytes on socket 17
[DEBUG] Connection received 234 bytes on socket 17
[DEBUG] Connection received 46 bytes on socket 17
[DEBUG] Connection on socket 17 preflighting request "POST /upload" with 808 bytes body
[DEBUG] Connection on socket 17 processing request "POST /upload" with 808 bytes body
2015-12-14 10:58:34.523 GCDWebServer[1701:403846] [UPLOAD] /var/mobile/Containers/Data/Application/5F45B407-9DA8-43D1-AADF-07CF22B1C4B2/Documents/IMG_9675.mp4
[DEBUG] Connection sent 175 bytes on socket 17
[DEBUG] Connection sent 2 bytes on socket 17
[DEBUG] Did close connection on socket 17
[VERBOSE] [my localhost:80] iPad2(7.0) client:50692 200 "POST /upload" (808 | 177)
[DEBUG] Did open connection on socket 17
2015-12-14 10:58:34.577 GCDWebServer[1701:403846] album’s name == GCDWebServer
[DEBUG] Connection received 400 bytes on socket 17
[DEBUG] Connection on socket 17 preflighting request "GET /list" with 400 bytes body
[DEBUG] Connection on socket 17 processing request "GET /list" with 400 bytes body
[DEBUG] Connection sent 177 bytes on socket 17
[DEBUG] Connection sent 213 bytes on socket 17
[DEBUG] Did close connection on socket 17
[VERBOSE] [my localhost:80] iPad2(7.0) client's IP:50693 200 "GET /list" (400 | 390)
[DEBUG] Did open connection on socket 17
[DEBUG] Connection received 453 bytes on socket 17
[DEBUG] Connection on socket 17 preflighting request "GET /download" with 453 bytes body
[DEBUG] Connection on socket 17 processing request "GET /download" with 453 bytes body
[DEBUG] Connection sent 182 bytes on socket 17
[DEBUG] Did close connection on socket 17
[VERBOSE] [my localhost:80] iPad2(7.0) client's IP:50694 304 "GET /download" (453 | 182)
[DEBUG] Did disconnect
[DEBUG] Did end background task
2、In the IPAD device can not download the video, the following is log:
[DEBUG] Did open connection on socket 17
[DEBUG] Did connect
[DEBUG] Did start background task
[DEBUG] Connection received 427 bytes on socket 17
[DEBUG] Connection on socket 17 preflighting request "GET /download" with 427 bytes body
[DEBUG] Connection on socket 17 processing request "GET /download" with 427 bytes body
[DEBUG] Connection sent 398 bytes on socket 17
[DEBUG] Connection sent 32768 bytes on socket 17
[DEBUG] Connection sent 32768 bytes on socket 17
[DEBUG] Connection sent 32768 bytes on socket 17
[DEBUG] Connection sent 32768 bytes on socket 17
[DEBUG] Connection sent 32768 bytes on socket 17
[DEBUG] Connection sent 32768 bytes on socket 17
[ERROR] Error while writing to socket 17: Broken pipe (32)
[DEBUG] Did close connection on socket 17
[VERBOSE] [my localhost:80] iPad2(7.0) client's IP:50690 200 "GET /download" (427 | 197006)
[DEBUG] Did open connection on socket 17
[DEBUG] Connection received 346 bytes on socket 17
[DEBUG] Connection on socket 17 preflighting request "GET /download" with 346 bytes body
[DEBUG] Connection on socket 17 processing request "GET /download" with 346 bytes body
[DEBUG] Connection sent 398 bytes on socket 17
[DEBUG] Connection sent 32768 bytes on socket 17
[DEBUG] Connection sent 32768 bytes on socket 17
[DEBUG] Connection sent 32768 bytes on socket 17
[DEBUG] Connection sent 32768 bytes on socket 17
[ERROR] Error while writing to socket 17: Broken pipe (32)
[DEBUG] Did close connection on socket 17
[VERBOSE] [my localhost:80] iPad2(7.0) client's IP:50691 200 "GET /download" (346 | 131470)
[DEBUG] Did disconnect
[DEBUG] Did end background task
Do you know why? Thank you very much!
Sorry for my ignorance.
Related
I created a group of docker containers to run a web app (Python/Django). One of them is smtp-server:
smtp:
image: namshi/smtp:latest
networks:
- nginx_ext_network
environment:
MAILNAME: 'mailer'
restart: always
ports:
- "25:25"
But when the web app needs to send an email, smtp server tries to do it, but fails.
I tried it multiple times, with different ports and with different emails. Nothing works.
LOGS for smtp-container:
+ sed -ri '
s/^#?(dc_local_interfaces)=.*/\1='\''[0.0.0.0]:25 ; [::0]:25'\''/;
s/^#?(dc_other_hostnames)=.*/\1='\'''\''/;
s/^#?(dc_relay_nets)=.*/\1='\''172.19.0.2\/16'\''/;
s/^#?(dc_eximconfig_configtype)=.*/\1='\''internet'\''/;
' /etc/exim4/update-exim4.conf.conf
+ update-exim4.conf -v
using non-split configuration scheme from /etc/exim4/exim4.conf.template
1 LOG: MAIN
1 exim 4.89 daemon started: pid=1, -q15m, listening for SMTP on port 25 (IPv6 and IPv4)
273 LOG: MAIN
273 <= webmaster#localhost H=mailer_apache_1.mailer_nginx_ext_network (83d1331a44cb) [172.19.0.3] P=esmtp S=2162 id=156606357503.34.13723816267095054951#83d1331a44cb
273 LOG: smtp_connection MAIN
273 SMTP connection from mailer_apache_1.mailer_nginx_ext_network (83d1331a44cb) [172.19.0.3] closed by QUIT
274 Exim version 4.89 uid=101 gid=101 pid=274 D=40001
Berkeley DB: Berkeley DB 5.3.28: (September 9, 2013)
Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DKIM DNSSEC Event OCSP PRDR SOCKS TCP_Fast_Open
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Configure owner: 0:0
Size of off_t: 8
274 delivering 1hz2fv-00004P-1K
274 R: dnslookup for djangomailape#gmail.com
275 T: remote_smtp for djangomailape#gmail.com
275 Connecting to gmail-smtp-in.l.google.com [2a00:1450:4010:c08::1a]:25 ... failed: Cannot assign requested address
275 LOG: MAIN
275 H=gmail-smtp-in.l.google.com [2a00:1450:4010:c08::1a] Cannot assign requested address
275 Connecting to gmail-smtp-in.l.google.com [64.233.165.27]:25 ... connected
275 SMTP(close)>>
275 LOG: MAIN
275 H=gmail-smtp-in.l.google.com [64.233.165.27]: Remote host closed connection in response to initial connection
275 Connecting to alt1.gmail-smtp-in.l.google.com [2404:6800:4008:c04::1a]:25 ... failed: Cannot assign requested address
275 LOG: MAIN
275 H=alt1.gmail-smtp-in.l.google.com [2404:6800:4008:c04::1a] Cannot assign requested address
275 Connecting to alt1.gmail-smtp-in.l.google.com [74.125.204.27]:25 ... connected
275 SMTP(close)>>
275 LOG: MAIN
275 H=alt1.gmail-smtp-in.l.google.com [74.125.204.27]: Remote host closed connection in response to initial connection
275 Connecting to alt2.gmail-smtp-in.l.google.com [2607:f8b0:400e:c04::1b]:25 ... failed: Cannot assign requested address
275 LOG: MAIN
275 H=alt2.gmail-smtp-in.l.google.com [2607:f8b0:400e:c04::1b] Cannot assign requested address
275 Connecting to alt3.gmail-smtp-in.l.google.com [2607:f8b0:4003:c09::1b]:25 ... failed: Cannot assign requested address
275 LOG: MAIN
275 H=alt3.gmail-smtp-in.l.google.com [2607:f8b0:4003:c09::1b] Cannot assign requested address
275 Connecting to alt4.gmail-smtp-in.l.google.com [2607:f8b0:4001:c16::1b]:25 ... failed: Cannot assign requested address
275 LOG: MAIN
275 H=alt4.gmail-smtp-in.l.google.com [2607:f8b0:4001:c16::1b] Cannot assign requested address
274 LOG: MAIN
274 == djangomailape#gmail.com R=dnslookup T=remote_smtp defer (99): Cannot assign requested address H=alt1.gmail-smtp-in.l.google.com [74.125.204.27]
276 LOG: MAIN
276 <= webmaster#localhost H=mailer_apache_1.mailer_nginx_ext_network (83d1331a44cb) [172.19.0.3] P=esmtp S=2187 id=156606361852.33.3228996691969512605#83d1331a44cb
276 LOG: smtp_connection MAIN
276 SMTP connection from mailer_apache_1.mailer_nginx_ext_network (83d1331a44cb) [172.19.0.3] closed by QUIT
277 Exim version 4.89 uid=101 gid=101 pid=277 D=40001
Berkeley DB: Berkeley DB 5.3.28: (September 9, 2013)
Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DKIM DNSSEC Event OCSP PRDR SOCKS TCP_Fast_Open
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Configure owner: 0:0
Size of off_t: 8
277 delivering 1hz2gc-00004S-H8
277 R: dnslookup for eleriya-25#yandex.ru
278 T: remote_smtp for eleriya-25#yandex.ru
278 Connecting to mx.yandex.ru [2a02:6b8::89]:25 ... failed: Cannot assign requested address
278 LOG: MAIN
278 H=mx.yandex.ru [2a02:6b8::89] Cannot assign requested address
278 Connecting to mx.yandex.ru [87.250.250.89]:25 ... connected
278 SMTP(close)>>
278 LOG: MAIN
278 H=mx.yandex.ru [87.250.250.89]: Remote host closed connection in response to initial connection
278 Connecting to mx.yandex.ru [213.180.193.89]:25 ... connected
278 SMTP(close)>>
278 LOG: MAIN
278 H=mx.yandex.ru [213.180.193.89]: Remote host closed connection in response to initial connection
278 Connecting to mx.yandex.ru [213.180.204.89]:25 ... connected
278 SMTP(close)>>
278 LOG: MAIN
278 H=mx.yandex.ru [213.180.204.89]: Remote host closed connection in response to initial connection
278 Connecting to mx.yandex.ru [77.88.21.89]:25 ... connected
278 SMTP(close)>>
278 LOG: MAIN
278 H=mx.yandex.ru [77.88.21.89]: Remote host closed connection in response to initial connection
277 LOG: MAIN
277 == eleriya-25#yandex.ru R=dnslookup T=remote_smtp defer (-18) H=mx.yandex.ru [77.88.21.89]: Remote host closed connection in response to initial connection
Any suggestions?
I'm trying to set up Firebase's new crash reporting via their docs and running into an error. When I build the project I get this error from the run script phase:
Pods/FirebaseCrash/upload-sym-util.bash:384: error: symbolFileMappings:upsert: Request contains an invalid argument.
After debugging a bit I found the VERBOSE flag and set that for more info as seen below (keys removed)
/Pods/FirebaseCrash/upload-sym-util.bash:376: note: another thing
== Info: Trying 216.58.216.47...
== Info: Connected to mobilecrashreporting.googleapis.com (216.58.216.47) port 443 (#0)
== Info: TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
== Info: Server certificate: *.googleapis.com
== Info: Server certificate: Google Internet Authority G2
== Info: Server certificate: GeoTrust Global CA
=> Send header, 413 bytes (0x19d)
0000: POST /v1/apps/1:000000000000:ios:0000000000000000/symbolFileMapp
0040: ings:upsert?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX HTTP/1.1
0082: Host: mobilecrashreporting.googleapis.com
00ad: User-Agent: curl/7.43.0
00c6: Accept: */*
00d3: Content-Type: application/json
00f3: X-Ios-Bundle-Identifier: com.jakecraige.Inventry
0125: Authorization: Bearer XXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0165: XXXXXXXXXXXXXXXXXXXXXXXXXXX-XXX
0186: Content-Length: 186
019b:
=> Send data, 186 bytes (0xba)
0000: {"upload_key":"1:000000000000:ios:0000000000000000-00000000-0000
0040: -0000-0000-000000000000","symbol_file_mapping":{"symbol_type":2,
0080: "app_version":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"}}
== Info: upload completely sent off: 186 out of 186 bytes
<= Recv header, 26 bytes (0x1a)
0000: HTTP/1.1 400 Bad Request
<= Recv header, 16 bytes (0x10)
0000: Vary: X-Origin
<= Recv header, 15 bytes (0xf)
0000: Vary: Referer
<= Recv header, 47 bytes (0x2f)
0000: Content-Type: application/json; charset=UTF-8
<= Recv header, 37 bytes (0x25)
0000: Date: Mon, 30 May 2016 21:47:10 GMT
<= Recv header, 13 bytes (0xd)
0000: Server: ESF
<= Recv header, 24 bytes (0x18)
0000: Cache-Control: private
<= Recv header, 33 bytes (0x21)
0000: X-XSS-Protection: 1; mode=block
<= Recv header, 29 bytes (0x1d)
0000: X-Frame-Options: SAMEORIGIN
<= Recv header, 33 bytes (0x21)
0000: X-Content-Type-Options: nosniff
<= Recv header, 30 bytes (0x1e)
0000: Alternate-Protocol: 443:quic
<= Recv header, 69 bytes (0x45)
0000: Alt-Svc: quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,
0040: 25"
<= Recv header, 21 bytes (0x15)
0000: Accept-Ranges: none
<= Recv header, 30 bytes (0x1e)
0000: Vary: Origin,Accept-Encoding
<= Recv header, 28 bytes (0x1c)
0000: Transfer-Encoding: chunked
<= Recv header, 2 bytes (0x2)
0000:
<= Recv data, 138 bytes (0x8a)
0000: 7f
0004: {. "error": {. "code": 400,. "message": "Request contains
0044: an invalid argument.",. "status": "INVALID_ARGUMENT". }.}.
0085: 0
0088:
== Info: Connection #0 to host mobilecrashreporting.googleapis.com left intact
/Pods/FirebaseCrash/upload-sym-util.bash:385: note: symbolFileMappings:upsert: The metadata for the symbol file failed to update.
So it looks like the POST to mobilecrashreporting.googleapis.com/v1/apps/$GOOGLE_APP_ID/symbolFileMappings:upsert?key=$FIREBASE_API_KEY is failing.
Looking through all the params, they seem to match up with my config and nothing is empty, so I'm not really sure what to do next.
Has anyone else run into this? Idea on how to fix it?
Thanks!
In the build report, when running on verbose=3 ('-vvv'), did you see something like the following lines?
CrashTestApp (architecture x86_64) symbol dump follows (first 20 lines):
MODULE mac x86_64 5FFC1B5C32CF33EEB4BFFA4189412AE30 CrashTestApp
FILE 0 /Applications/Xcode.app/…
⋮
FILE 4 /Users/me/Source/CrashTestApp/…
FUNC 1bf0 54 0 -[ViewController viewDidLoad]
1bf0 14 11 4
1c04 30 12 4
⋮
(The numbers and file names will obviously be different.) The key is the magic pattern in the first line: it must start with MODULE followed by the machine type and architecture (single words) followed by a 33 digit hex string, then the name of the app. If the file upload does not follow that pattern, then the upsert step fails.
Im building an app that is already working in android, but when i tried to connect the same app in my iphone environment (ios 9.1) cant connect to my server
here is some of my configuration:
<iphone bundleId="com.xxxxxx" securityTest="xxxxxxxxxxxxx" version="1.0">
<worklightSettings include="false"/>
<security>
<encryptWebResources enabled="false"/>
<testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/>
</security>
</iphone>
and the logs from my xcode:
2015-11-26 10:05:52.100 AppName[353:79399] [INFO] [AppName.core.main] wlCommonInit: Antes connect...
2015-11-26 10:05:52.102 AppName[353:79391] [DEBUG] [NONE] establishSSLClientAuth
2015-11-26 10:05:52.105 AppName[353:78667] [WARN] [USER_CERT_AUTH] +[WLUserAuthManager getCertificateIdentifier] in WLUserAuthManager.m:68 :: Certificate Identifier Key: com.worklight.userenrollment.certificate:com.AppName
2015-11-26 10:05:52.121 AppName[353:78667] THREAD WARNING: ['UserAuth'] took '16.052979' ms. Plugin should use a background thread.
2015-11-26 10:05:52.124 AppName[353:79391] [DEBUG] [NONE] establishSSLClientAuth isCertificateExists: false
2015-11-26 10:05:52.129 AppName[353:79399] [DEBUG] [NONE] Request [/apps/services/api/AppName/iphone/init]
2015-11-26 10:05:52.133 AppName[353:79393] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] +[WLAFHTTPClientWrapper requestWithURL:] in WLAFHTTPClientWrapper.m:38 :: Request url is https://DomainName:443/ProjectName/apps/services/api/AppName/iphone/init
2015-11-26 10:05:52.147 AppName[353:79393] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper start] in WLAFHTTPClientWrapper.m:183 :: Starting the request with URL https://DomainName:443/ProjectName/apps/services/api/AppName/iphone/init
2015-11-26 10:05:52.283 AppName[353:78863] CFNetwork SSLHandshake failed (-9824)
2015-11-26 10:05:52.284 AppName[353:78863] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9824)
2015-11-26 10:05:52.287 AppName[353:78667] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:215 :: Request Failed
2015-11-26 10:05:52.289 AppName[353:78667] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:216 :: Response Status Code : 0
2015-11-26 10:05:52.293 AppName[353:78667] [DEBUG] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:217 :: Response Error : An SSL error has occurred and a secure connection to the server cannot be made.
2015-11-26 10:05:52.302 AppName[353:78667] [DEBUG] [WORKLIGHT] -[NotificationEx loadingStop:] in NotificationEx.m:150 :: Loading stop
2015-11-26 10:05:52.342 AppName[353:78667] THREAD WARNING: ['Notification'] took '36.349121' ms. Plugin should use a background thread.
2015-11-26 10:05:52.444 AppName[353:79391] [ERROR] [NONE] [/apps/services/api/AppName/iphone/init] Host is not responsive.
2015-11-26 10:05:52.446 AppName[353:79399] [INFO] [AppName.core.main] wlCommonInit: connectFailure...
iOS 9 requires use of Application Transport Security(ATS) for connection. Refer to the following blogs for more details and resolution of the issue:
a) IBM MFP support for iOS 9
b) Enable ATS for iOS 9 in IBM MFP
c) ATS and BitCode
You may need to add a key to your info.plist -nsallowarbitrary
connections to yes. This is new in ios 9
I am trying to play a MP4 video on a LG TV using the Connect SDK 1.4.1. We have a working implementation with Chromecast and Apple TV.
When first starting our app, we are able to successfully connect to the LG TV. When trying to play one of our own videos the first time, we receive no response from the Connect SDK, nor do we see the video play on the TV. In the console output, it appears that the TV disconnects from the app. The console output can be seen in the Console Output below.
However, we are able to successfully play the Sintel video provided in your demo. After playing that video, any future attempt to play a video from my app results in the Sintel video being played instead.
I used Charles to redirect the path to the Sintel video, to a video used in my app, and found that the video played fine. This appears to be a communication issue between the App and the TV causing this unintended behavior.
Am I doing something wrong that is specific to the LG platform? Is there any additional information I can provide to solve this problem?
Thank you!
Specs:
ConnectSDK 1.4.1 (installed using Cocoa Pods)
Platform: iOS 8.1.2 (12B440)
LG TV Model #: 47LA6200 (January 2014)
Stream Format: MP4; H.264#1280x720; AAC 44100 Hz Stereo
Console Output.
[DEBUG] Did open connection on socket 27
[DEBUG] Did connect
[DEBUG] Did start background task
[DEBUG] Did open connection on socket 29
[DEBUG] Connection received 909 bytes on socket 29
[DEBUG] Connection received 350 bytes on socket 27
[DEBUG] Connection on socket 29 preflighting request "NOTIFY /RenderingControl/45d7f4f5-ebfc-4d0b-f5bd-79e51d2b2006/event.xml" with 909 bytes body
[DEBUG] Connection on socket 29 processing request "NOTIFY /RenderingControl/45d7f4f5-ebfc-4d0b-f5bd-79e51d2b2006/event.xml" with 909 bytes body
[DEBUG] Connection received 2379 bytes on socket 27
[DEBUG] Connection on socket 27 preflighting request "NOTIFY /ConnectionManager/45d7f4f5-ebfc-4d0b-f5bd-79e51d2b2006/event.xml" with 2729 bytes body
[DEBUG] Connection on socket 27 processing request "NOTIFY /ConnectionManager/45d7f4f5-ebfc-4d0b-f5bd-79e51d2b2006/event.xml" with 2729 bytes body
[DEBUG] Did open connection on socket 32
[DEBUG] Connection sent 122 bytes on socket 29
[DEBUG] Did close connection on socket 29
[VERBOSE] [192.168.1.121:49291] 192.168.1.144:38356 200 "NOTIFY /RenderingControl/45d7f4f5-ebfc-4d0b-f5bd-79e51d2b2006/event.xml" (909 | 122)
[DEBUG] Connection received 1724 bytes on socket 32
[DEBUG] Connection on socket 32 preflighting request "NOTIFY /AVTransport/45d7f4f5-ebfc-4d0b-f5bd-79e51d2b2006/event.xml" with 1724 bytes body
[DEBUG] Connection on socket 32 processing request "NOTIFY /AVTransport/45d7f4f5-ebfc-4d0b-f5bd-79e51d2b2006/event.xml" with 1724 bytes body
[DEBUG] Connection sent 122 bytes on socket 27
[DEBUG] Did close connection on socket 27
[VERBOSE] [192.168.1.121:49291] 192.168.1.144:38355 200 "NOTIFY /ConnectionManager/45d7f4f5-ebfc-4d0b-f5bd-79e51d2b2006/event.xml" (2729 | 122)
[DEBUG] Connection sent 122 bytes on socket 32
[DEBUG] Did close connection on socket 32
[VERBOSE] [192.168.1.121:49291] 192.168.1.144:38357 200 "NOTIFY /AVTransport/45d7f4f5-ebfc-4d0b-f5bd-79e51d2b2006/event.xml" (1724 | 122)
2015-01-13 16:47:32.843 Connect-Demo[1853:1424495] TeamStreamConnectVideo downloaded manifest...
[DEBUG] Did disconnect
[DEBUG] Did end background task
I have an issue where if I'm trying to create a ssh connection to a specific host, the connection hangs without timing out. I have tried connecting to this host from the same machine from outside the rails console and it works so I'm assuming this shouldn't be anything related to routing/firewall. I can also confirm I have several other hosts with the exact same OS configuration in different places and they work.
This is the log when running Net::SSH.start in debug mode:
ssh = Net::SSH.start("1.2.3.4", "user", password: "password", verbose: :debug)
2014-02-27 13:17:43 +0100 [DEBUG] establishing connection to 1.2.3.4:22
2014-02-27 13:17:43 +0100 [DEBUG] connection established
2014-02-27 13:17:43 +0100 [INFO] negotiating protocol version
2014-02-27 13:17:43 +0100 [DEBUG] remote is `SSH-2.0-OpenSSH_4.3'
2014-02-27 13:17:43 +0100 [DEBUG] local is `SSH-2.0-Ruby/Net::SSH_2.6.8 i686-linux'
2014-02-27 13:17:43 +0100 [DEBUG] read 704 bytes
2014-02-27 13:17:43 +0100 [DEBUG] received packet nr 0 type 20 len 700
2014-02-27 13:17:43 +0100 [INFO] got KEXINIT from server
2014-02-27 13:17:43 +0100 [INFO] sending KEXINIT
2014-02-27 13:17:43 +0100 [DEBUG] queueing packet nr 0 type 20 len 1620
2014-02-27 13:17:43 +0100 [DEBUG] sent 1624 bytes
2014-02-27 13:17:43 +0100 [INFO] negotiating algorithms
2014-02-27 13:17:43 +0100 [DEBUG] negotiated:
* kex: diffie-hellman-group-exchange-sha1
* host_key: ssh-rsa
* encryption_server: aes128-cbc
* encryption_client: aes128-cbc
* hmac_client: hmac-sha1
* hmac_server: hmac-sha1
* compression_client: none
* compression_server: none
* language_client:
* language_server:
2014-02-27 13:17:43 +0100 [DEBUG] exchanging keys
2014-02-27 13:17:43 +0100 [DEBUG] queueing packet nr 1 type 34 len 20
2014-02-27 13:17:43 +0100 [DEBUG] sent 24 bytes
At this point the ssh connection just hangs and could stay like this for 15-30 minutes.
Unfortunately I have no error message or anything so I'm really clueless about what the problem might be.
Some specs:
ruby-2.0.0-p0
rails (3.2.13)
net-ssh-2.8.0
The IP address in the log is not a real IP on purpose.
Any suggestion about what the problem could be? Or maybe some other log or place I could check out? I found a similar problem outside SO but it didn't get a solution so I'm trying to ask here...
I solved by reducing maximum transmission unit (MTU). My environment was some specific case. I was trying ssh from VMware Virtual Machine to Openstack Instance. And openstack needed smaller packet to be connected by kitchen-openstack which is using fog, using NET::SSH. Not sure if this works for you, but have a try for these commands (assuming in Ubuntu):
check your MTU
sudo netstat -i
You'll get some output like this, in the second column, you can check MTU:
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 9658 0 0 0 308 0 0 0 BMRU
lo 16436 0 12952 0 0 0 12952 0 0 0 LRU
For network interface eth0, you can try to reduce MTU from 1500 to, for example 1400 like this:
sudo ifconfig eth0 mtu 1400
try net ssh
ssh = Net::SSH.start("1.2.3.4", "user", password: "password", verbose: :debug)