Unable to connect over SSL - rundeck

I've configured SSL - When I attempt to connect remotely I get Connection Aborted
When I curl locally I get a 7 byte Binary output.
I thought it might be a TLS/Cipher issue but I confirmed that I was able to locally connect using TLs1.2 adn a cipher that was supported on my remote system.
When I connected remotely I had debug enabled
Remote Resp (I have 500 lines of logs, I think I pulled the relevant lines , happy to share more)
I've added line feeds for readability:
rundeck.log:[2022-10-31T11:23:39,714] DEBUG ssl.SslConnection [qtp1674423837-59] - fill starting handshake SslConnection#2ced3116::SocketChannelEndPoint#36b01040{l=/10.18.64.7:4443,r=/10.18.155.9:26413,ISHUT,fill=-,flush=-,to=8/30000}{io=0/0,kio=0,kro=1}->SslConnection#2ced3116{NOT_HANDSHAKING,eio=0/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint#1367423a{l=/10.18.64.7:4443,r=/10.18.155.9:26413,OPEN,fill=-,flush=-,to=10/30000}=>HttpConnection#18d4ac9[p=HttpParser{s=START,0 of -1},g=HttpGenerator#700897b5{s=START}]=>HttpChannelOverHttp#465a8526{s=HttpChannelState#d305c1{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=0,c=false/false,a=IDLE,uri=null,age=0}
rundeck.log:[2022-10-31T11:23:39,714] DEBUG ssl.SslConnection [qtp1674423837-32] - fill starting handshake SslConnection#4ed75ddd::SocketChannelEndPoint#6affba44{l=/10.18.64.7:4443,r=/10.18.155.9:26407,ISHUT,fill=-,flush=-,to=8/30000}{io=0/0,kio=0,kro=1}->SslConnection#4ed75ddd{NOT_HANDSHAKING,eio=0/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint#2706acc1{l=/10.18.64.7:4443,r=/10.18.155.9:26407,OPEN,fill=-,flush=-,to=10/30000}=>HttpConnection#57a0965f[p=HttpParser{s=START,0 of -1},g=HttpGenerator#319bf204{s=START}]=>HttpChannelOverHttp#2bbe12ed{s=HttpChannelState#434babd1{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=0,c=false/false,a=IDLE,uri=null,age=0}
rundeck.log:[2022-10-31T11:23:39,716] DEBUG ssl.SslConnection [qtp1674423837-32] - <fill f=-1 uf=false SslConnection#4ed75ddd::SocketChannelEndPoint#6affba44{l=/10.18.64.7:4443,r=/10.18.155.9:26407,ISHUT,fill=-,flush=-,to=10/30000}{io=0/0,kio=0,kro=1}->SslConnection#4ed75ddd{NOT_HANDSHAKING,eio=-1/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint#2706acc1{l=/10.18.64.7:4443,r=/10.18.155.9:26407,OPEN,fill=-,flush=-,to=12/30000}=>HttpConnection#57a0965f[p=HttpParser{s=START,0 of -1},g=HttpGenerator#319bf204{s=START}]=>HttpChannelOverHttp#2bbe12ed{s=HttpChannelState#434babd1{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=0,c=false/false,a=IDLE,uri=null,age=0}
rundeck.log:[2022-10-31T11:23:39,716] DEBUG ssl.SslConnection [qtp1674423837-59] - <fill f=-1 uf=false SslConnection#2ced3116::SocketChannelEndPoint#36b01040{l=/10.18.64.7:4443,r=/10.18.155.9:26413,ISHUT,fill=-,flush=-,to=10/30000}{io=0/0,kio=0,kro=1}->SslConnection#2ced3116{NOT_HANDSHAKING,eio=-1/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint#1367423a{l=/10.18.64.7:4443,r=/10.18.155.9:26413,OPEN,fill=-,flush=-,to=12/30000}=>HttpConnection#18d4ac9[p=HttpParser{s=START,0 of -1},g=HttpGenerator#700897b5{s=START}]=>HttpChannelOverHttp#465a8526{s=HttpChannelState#d305c1{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=0,c=false/false,a=IDLE,uri=null,age=0}
rundeck.log:[2022-10-31T11:23:39,716] DEBUG server.HttpConnection [qtp1674423837-32] - HttpConnection#57a0965f::DecryptedEndPoint#2706acc1{l=/10.18.64.7:4443,r=/10.18.155.9:26407,OPEN,fill=-,flush=-,to=12/30000} filled -1 HeapByteBuffer#380084ed[p=0,l=0,c=17408,r=0]={<<<>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00}
rundeck.log:[2022-10-31T11:23:39,716] DEBUG server.HttpConnection [qtp1674423837-59] - HttpConnection#18d4ac9::DecryptedEndPoint#1367423a{l=/10.18.64.7:4443,r=/10.18.155.9:26413,OPEN,fill=-,flush=-,to=12/30000} filled -1 HeapByteBuffer#21d7ee02[p=0,l=0,c=17408,r=0]={<<<>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00}
rundeck.log:[2022-10-31T11:23:39,716] DEBUG server.HttpConnection [qtp1674423837-32] - HttpConnection#57a0965f::DecryptedEndPoint#2706acc1{l=/10.18.64.7:4443,r=/10.18.155.9:26407,OPEN,fill=-,flush=-,to=12/30000} parse HeapByteBuffer#380084ed[p=0,l=0,c=17408,r=0]={<<<>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00} {}
rundeck.log:[2022-10-31T11:23:39,716] DEBUG server.HttpConnection [qtp1674423837-59] - HttpConnection#18d4ac9::DecryptedEndPoint#1367423a{l=/10.18.64.7:4443,r=/10.18.155.9:26413,OPEN,fill=-,flush=-,to=12/30000} parse HeapByteBuffer#21d7ee02[p=0,l=0,c=17408,r=0]={<<<>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00} {}
rundeck.log:[2022-10-31T11:23:39,718] DEBUG io.AbstractEndPoint [qtp1674423837-32] - close DecryptedEndPoint#2706acc1{l=/10.18.64.7:4443,r=/10.18.155.9:26407,OPEN,fill=-,flush=-,to=15/30000}
rundeck.log:[2022-10-31T11:23:39,718] DEBUG io.AbstractEndPoint [qtp1674423837-59] - close DecryptedEndPoint#1367423a{l=/10.18.64.7:4443,r=/10.18.155.9:26413,OPEN,fill=-,flush=-,to=15/30000}
rundeck.log:[2022-10-31T11:23:39,718] DEBUG io.AbstractEndPoint [qtp1674423837-32] - close(null) DecryptedEndPoint#2706acc1{l=/10.18.64.7:4443,r=/10.18.155.9:26407,OPEN,fill=-,flush=-,to=15/30000}
rundeck.log:[2022-10-31T11:23:39,718] DEBUG io.AbstractEndPoint [qtp1674423837-59] - close(null) DecryptedEndPoint#1367423a{l=/10.18.64.7:4443,r=/10.18.155.9:26413,OPEN,fill=-,flush=-,to=15/30000}
rundeck.log:[2022-10-31T11:23:39,718] DEBUG ssl.SslConnection [qtp1674423837-32] - shutdownOutput: SslConnection#4ed75ddd::SocketChannelEndPoint#6affba44{l=/10.18.64.7:4443,r=/10.18.155.9:26407,ISHUT,fill=-,flush=-,to=13/30000}{io=0/0,kio=0,kro=1}->SslConnection#4ed75ddd{NOT_HANDSHAKING,eio=-1/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint#2706acc1{l=/10.18.64.7:4443,r=/10.18.155.9:26407,CLOSED,fill=-,flush=-,to=15/30000}=>HttpConnection#57a0965f[p=HttpParser{s=CLOSED,0 of -1},g=HttpGenerator#319bf204{s=START}]=>HttpChannelOverHttp#2bbe12ed{s=HttpChannelState#434babd1{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=0,c=false/false,a=IDLE,uri=null,age=0} oshut=false, ishut=true
rundeck.log:[2022-10-31T11:23:39,718] DEBUG ssl.SslConnection [qtp1674423837-59] - shutdownOutput: SslConnection#2ced3116::SocketChannelEndPoint#36b01040{l=/10.18.64.7:4443,r=/10.18.155.9:26413,ISHUT,fill=-,flush=-,to=13/30000}{io=0/0,kio=0,kro=1}->SslConnection#2ced3116{NOT_HANDSHAKING,eio=-1/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint#1367423a{l=/10.18.64.7:4443,r=/10.18.155.9:26413,CLOSED,fill=-,flush=-,to=15/30000}=>HttpConnection#18d4ac9[p=HttpParser{s=CLOSED,0 of -1},g=HttpGenerator#700897b5{s=START}]=>HttpChannelOverHttp#465a8526{s=HttpChannelState#d305c1{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=0,c=false/false,a=IDLE,uri=null,age=0} oshut=false, ishut=true
Local Curl Req/Resp
curl localhost:4443 -k --output /tmp/curl
^U^C^C^#^B^BP
I tired to connect via ssl, and after hardcoding the "RUNDECK_WITH_SSL flag (even though it said that wasn't needed for RHEL, I seemed to have made an initial connection - but it doesn't display the welcome page

So the answer here (sorry for the delay on this) WAS corporate net sec policy. We installed nginx to forward requests from 443 to 4440 and that seemed to get us over the hurdle

Related

Kerberos is not set up . You cannot login - Keycloak

I had configured the keycloak under the user federation settings as kerberos.
I had also entered the realm ,service principal and the keytab file directory as stated .
But I get the issue as : Kerberos is not set up . You cannot login
In firefox I has enabled SPNEGO as per the below docs :
http://www.microhowto.info/howto/configure_firefox_to_authenticate_using_spnego_and_kerberos.html
I am attaching from the log snippet :
2021-06-30 11:43:31,234 DEBUG [org.keycloak.authentication.AuthenticationSelectionResolver] (default task-1) Selections when trying execution 'auth-spnego' : [ authSelection - auth-spnego]
2021-06-30 11:43:31,234 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-1) invoke authenticator.authenticate: auth-spnego
2021-06-30 11:43:31,235 TRACE [org.keycloak.authentication.authenticators.browser.SpnegoAuthenticator] (default task-1) Sending back WWW-Authenticate: Negotiate
Reference to the same issue :
https://marc.info/?l=keycloak-user&m=154803677131797&w=2
Do consider to help us with the concrete solution .
Thanks in advance !

Waiting For Connection (netbeans-xdebug) using NetBeans

I have tried everything I can to get xdebug running with NetBeans. I have tried every suggestion on every forum I could find, but none have helped. No matter what I do, I ALWAYS get the dreaded "Waiting For Connection (netbeans-xdeubg)" and nothing happens.
Win 10. Apache running locally. Virus and Firewall have both been disabled. Listening on 9001 (I also tried 9000, no change).
relevant php.ini:
[XDebug]
zend_extension = php_xdebug-2.5.4-5.6-vc11.dll
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.remote_mode=req
xdebug.idekey="netbeans-xdebug"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\temp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_log="c:\temp\xdebug.txt"
xdebug.trace_output_dir = "c:\temp"
; 3600 (1 hour), 36000 = 10h
xdebug.remote_cookie_expire_time = 36000
xdebug.var_display_max_data = 2048
Net Beans project config:
Debugger Proxy: 127.0.0.1, Port 9001
Net Beans php debugging (Tools->Options->PHP->Debugging):
Debugger Port: 9001
Session ID: netbeans-xdebug
Max Data Length: 2048
[EDIT: #lazyone]
After NetBeans Launch and manually opening browser tab:
C:\WINDOWS\system32>netstat -o -n -a -b (excluded any non-9001 results):
TCP 0.0.0.0:9001 0.0.0.0:0 LISTENING
[netbeans64.exe]
TCP 127.0.0.1:9001 127.0.0.1:63119 ESTABLISHED
[netbeans64.exe]
TCP 127.0.0.1:9001 127.0.0.1:63123 ESTABLISHED
[netbeans64.exe]
TCP 127.0.0.1:63119 127.0.0.1:9001 ESTABLISHED
[netbeans64.exe]
TCP 127.0.0.1:63123 127.0.0.1:9001 ESTABLISHED
[httpd.exe]
TCP [::]:9001 [::]:0 LISTENING
[netbeans64.exe]
When I run the project, it sits and waits; browser does not react. When I kill debugging session, the browser immediately pulls up a tab with the proper url (http://local.ct.com/info.php?XDEBUG_SESSION_START=netbeans-xdebug). I have tried manually starting that URL when the IDE is waiting, but nothing changes.
Note that if I examine the remote log when I start the debugging from NetBeans (waiting...) then stop it, I get the following in the log:
Log opened at 2017-10-11 18:18:26
I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Checking header 'REMOTE_ADDR'.
I: Remote address found, connecting to 127.0.0.1:9001.
E: Time-out connecting to client. :-(
Log closed at 2017-10-11 18:18:26
If instead I start debugging in Netbeans (waiting...), then manually open the tab (still waiting...), then stop it, I get the following in the log:
Log opened at 2017-10-11 18:21:29
I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Checking header 'REMOTE_ADDR'.
I: Remote address found, connecting to 127.0.0.1:9001.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///C:/userdata/CMP/ct/cmp/ct/htdocs/info.php" language="PHP" xdebug:language_version="5.6.1-dev" protocol_version="1.0" appid="13596" idekey="netbeans-xdebug"><engine version="2.5.4"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2017 by Derick Rethans]]></copyright></init>
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2017-10-11 18:21:34
Log opened at 2017-10-11 18:21:34
I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Checking header 'REMOTE_ADDR'.
I: Remote address found, connecting to 127.0.0.1:9001.
E: Time-out connecting to client. :-(
Log closed at 2017-10-11 18:21:34
I have been working on this a ridiculously long time. Any help would be GREATLY appreciated!

The resource could not be found in jclouds

I got this when I am trying
04:59:49.489 [main] DEBUG jclouds.wire` - <<
<html><h1>Not Found</h1><p>The resource could not be found.</p></html>
null
04:59:49.520 [main] DEBUG o.j.rest.internal.InvokeHttpMethod - >> invoking container:list
04:59:49.521 [main] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - Sending request -1849476372: GET http://xxx.xx.xx.xxx:8080/v1/AUTH_2c5c2fbbfe22422496d5ebf6861199f2/?format=json HTTP/1.1
04:59:49.521 [main] DEBUG jclouds.headers - >> GET http://xxx.xx.xx.xxx:8080/v1/AUTH_2c5c2fbbfe22422496d5ebf6861199f2/?format=json HTTP/1.1
04:59:49.522 [main] DEBUG jclouds.headers - >> Accept: application/json
04:59:49.522 [main] DEBUG jclouds.headers - >> X-Auth-Token:
At line
swiftApi.getObjectApiForRegionAndContainer("RegionOne", CONTAINER_NAME).get(OBJECT_NAME);
how to resolve this
Please share any links or sample application related to content retrieval from openstack by jclouds.
Try the Swift example in the jclouds OpenStack Guide. I just tried it on a DevStack instance and it's working.
If you can get that to work, you should be able to get your own code to work too.

PayPal Sandbox Internal Service Error

I am trying to use the PayPal Sandbox for testing automated credit card processing, but running into an issue. Last week my tests were "successful" in the sense that when a validation error occurred the API would choke, but at least I knew something happened. After cleaning up my code that was being passed to the API, I no longer get validation errors, just internal service errors and this has been occurring for four days.
Here is what the log file shows (access token removed here, but it was generated from the API successfully prior to use):
2013-07-01 16:47:00,845 [32944] DEBUG PayPal.Manager.ConnectionManager [(null)] grant_type=client_credentials
2013-07-01 16:47:03,296 [32944] DEBUG PayPal.Manager.ConnectionManager [(null)] Service response
2013-07-01 16:47:03,296 [32944] DEBUG PayPal.Manager.ConnectionManager [(null)] {"scope":"https://api.paypal.com/v1/payments/.* https://api.paypal.com/v1/vault/credit-card https://api.paypal.com/v1/vault/credit-card/.* openid","access_token":"[access token that was generated]","token_type":"Bearer","app_id":"[app ID]","expires_in":28800}
2013-07-01 16:47:05,069 [32944] DEBUG PayPal.PayPalResource [(null)] Content-Type:application/json
2013-07-01 16:47:05,069 [32944] DEBUG PayPal.PayPalResource [(null)] Authorization:Bearer [access code]
2013-07-01 16:47:05,069 [32944] DEBUG PayPal.PayPalResource [(null)] User-Agent:PayPalSDK/rest-sdk-dotnet 0.7.1 ;lang=DOTNET;v=4.0.30319.18046;bit=64;os=Windows 8 6.2.9200.0;
2013-07-01 16:47:05,069 [32944] DEBUG PayPal.PayPalResource [(null)] PayPal-Request-Id:303be909-4268-4909-b1cb-b51b6dc7ea54
2013-07-01 16:47:05,365 [32944] DEBUG PayPal.Manager.ConnectionManager [(null)] {"intent":"sale","payer":{"payment_method":"credit_card","funding_instruments":[{"credit_card":{"number":"4111111111111111","type":"visa","expire_month":4,"expire_year":2017,"cvv2":"123","first_name":"First","last_name":"Last","billing_address":{"line1":"123 Any St.","city":"City","country_code":"US","postal_code":"12345","state":"OH"}}}]},"transactions":[{"amount":{"currency":"USD","total":"4.93","details":{"shipping":"3.55","subtotal":"1.30","tax":"0.08"}},"description":"Description"}]}
2013-07-01 16:47:35,657 [32944] ERROR PayPal.Manager.ConnectionManager [(null)] Error Response: {"name":"INTERNAL_SERVICE_ERROR","information_link":"https://api.sandbox.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR","debug_id":"ce04de98d51f2"}
2013-07-01 16:47:35,657 [32944] INFO PayPal.Manager.ConnectionManager [(null)] Got InternalServerError status code from server
2013-07-01 16:47:35,708 [32944] ERROR PayPal.Exception.PayPalException [(null)] Exception in HttpConnection Execute: Stream was not readable.
PayPal.Exception.PayPalException: Exception in HttpConnection Execute: Stream was not readable. ---> System.ArgumentException: Stream was not readable.
at System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean leaveOpen)
at System.IO.StreamReader..ctor(Stream stream)
at PayPal.HttpConnection.Execute(String payLoad, HttpWebRequest httpRequest)
--- End of inner exception stack trace ---
Any suggestions on this? I'm not really sure where to go from here.
Just ran our unit test cases, confirmed that Payment with CC seems to work. Please try with an alternate test credit card number "4417119669820331" and confirm if that works. We have seen some intermittent issues when using the test credit card number "4111111111111111".
If it works modify your test credit card for automated test cases to this number to prevent future failures till a fix is available.

Losing connection with Net::SSH::Perl

SOLUTION BELOW
We have an ETL system that extracts data into a CSV, uploads it to another server, and then needs to connect to the other server and call a java jar to load the csv into memcache. I've got a script that can perform every step of this but loses the SSH connection for the final step. The process on the remote machine continues and completes.
I'm using Net::SSH::Perl for this and it receives a "Connection failed: Connection reset by peer" error after running for a short time. I've boiled the script down to this and replicated the results:
#!/usr/bin/perl
use strict;
use Net::SSH::Perl;
use Log::Log4perl;
my ($stdout, $stderr, $exit, $ssh);
$ssh = Net::SSH::Perl->new('sshost',
identity_files => ['/path/to/key.rsa'],
protocol => 2,
debug => 1);
$ssh->login('user');
my $cmd = "java -Xms4096m -Xmx4096m -DetlDate=20120427 -DmemcacheHosts=host1,host2 -cp etl-0.1-SNAPSHOT.jar com.nnn.platform.service.etl";
$ssh->register_handler("stdout", sub {
my($channel, $buffer) = #_;
print "STDOUT: ", $buffer->bytes;
});
$ssh->register_handler("stderr", sub {
my($channel, $buffer) = #_;
print "STDERR: ", $buffer->bytes;
});
$ssh->cmd("cd /usr/local/loader; $cmd");
The SSH debug info I get is:
localhost: Reading configuration data /home/user/.ssh/config
localhost: Reading configuration data /etc/ssh_config
localhost: Connecting to sshost, port 22.
localhost: Remote protocol version 2.0, remote software version OpenSSH_4.3
localhost: Net::SSH::Perl Version 1.34, protocol version 2.0.
localhost: No compat match: OpenSSH_4.3.
localhost: Connection established.
localhost: Sent key-exchange init (KEXINIT), wait response.
localhost: Algorithms, c->s: 3des-cbc hmac-sha1 none
localhost: Algorithms, s->c: 3des-cbc hmac-sha1 none
localhost: Entering Diffie-Hellman Group 1 key exchange.
localhost: Sent DH public key, waiting for reply.
localhost: Received host key, type 'ssh-dss'.
localhost: Host 'sshost' is known and matches the host key.
localhost: Computing shared secret key.
localhost: Verifying server signature.
localhost: Waiting for NEWKEYS message.
localhost: Send NEWKEYS.
localhost: Enabling encryption/MAC/compression.
localhost: Sending request for user-authentication service.
localhost: Service accepted: ssh-userauth.
localhost: Trying empty user-authentication request.
localhost: Authentication methods that can continue: publickey,gssapi-with-mic.
localhost: Next method to try is publickey.
localhost: Trying pubkey authentication with key file '/path/to/key.rsa'
localhost: Login completed, opening dummy shell channel.
localhost: channel 0: new [client-session]
localhost: Requesting channel_open for channel 0.
localhost: channel 0: open confirm rwindow 0 rmax 32768
localhost: Got channel open confirmation, requesting shell.
localhost: Requesting service shell on channel 0.
localhost: channel 1: new [client-session]
localhost: Requesting channel_open for channel 1.
localhost: Entering interactive session.
localhost: Sending command: cd /usr/local/loader; java -Xms4096m -Xmx4096m -DetlDate=20120427 -DmemcacheHosts=host1,host2 -cp etl-0.1-SNAPSHOT.jar com.nnn.platform.service.etl
localhost: Sending command: cd /usr/local/loader; java -Xms4096m -Xmx4096m -DetlDate=20120427 -DmemcacheHosts=host1,host2 -cp etl-0.1-SNAPSHOT.jar com.nnn.platform.service.etl
localhost: Requesting service exec on channel 1.
localhost: channel 1: open confirm rwindow 0 rmax 32768
The jar's output is then printed to STDERR and I see it returned. After 9 seconds it stops and I eventually get the connection reset by peer error. The STDERR handler is working as expected.
I'm not sure if this is an issue with Net::SSH::Perl handling commands that take awhile to run/return only over STDERR or something more. I've been considering switching to Net::SSH2 as it seems like a fuller featured library, but I'd really like to know why this is failing.
SOLUTION
The problem was with the output only going to STDERR. I edited my command to add 2>&1 and thereby redirect STDERR to STDOUT and suddenly everything worked as expected.
Net::SSH::Perl is not maintained anymore and has a long list of known unsolved bugs. Nowadays there are better modules available from CPAN as Net::SSH2 or Net::OpenSSH.
For instance:
my $ssh = Net::OpenSSH->new($sshost,
user => $user,
key_path => '/path/to/key.rsa');
my ($out, $err) = $ssh->capture2($cmd);
The problem was with the output only going to STDERR. I edited my command to add 2>&1 and thereby redirect STDERR to STDOUT and suddenly everything worked as expected.
my $cmd = "java -Xms4096m -Xmx4096m -DetlDate=20120427 -DmemcacheHosts=host1,host2 -cp etl-0.1-SNAPSHOT.jar com.nnn.platform.service.etl 2>&1";