Closed kukat closed 4 years ago
Hi @kukat, the ktunnel client attempts to dial to localhost:9002, what happens if you try to netcat/telnet/curl manually? are you able to bind? if so, the client has a 50ms dial timeout and maybe increasing it will solve this.
I've released v1.2.6 that includes the actual error in the log message, could you please use that version and let me know what error the client is showing?
Thanks @omrikiei
still failed with the latest v1.2.6, extra error info:
dial tcp [::1]:9002: i/o timeout
❯ ./ktunnel -v inject deployment hip-new-api-part-424 9000:9002 -n playground
INFO[2020-05-04 22:20:53] Injecting tunnel sidecar to playground/hip-new-api-part-424
INFO[2020-05-04 22:20:55] Waiting for deployment to be ready
INFO[2020-05-04 22:21:50] All pods located for port-forwarding
DEBU[2020-05-04 22:21:50] Injecting to this pods: [hip-new-api-part-424-657d599bc6-ttzlt]
INFO[2020-05-04 22:21:50] Waiting for port forward to finish
INFO[2020-05-04 22:21:51] Forwarding from 127.0.0.1:28688 -> 28688
Forwarding from [::1]:28688 -> 28688
INFO[2020-05-04 22:21:51] starting tcp tunnel from source 9000 to target 9002
DEBU[2020-05-04 22:21:52] attempting to receive from stream
DEBU[2020-05-04 22:23:33] e8524eb5-a010-42bd-9759-e78b50c43505; got session from server: 499<?xml version="1.0" encoding="iso-8859-1"?>
<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/html/www/public/index.php" language="PHP" xdebug:language_version="7.3.17" protocol_version="1.0" appid="72" idekey="PHPSTORM"><engine version="2.7.2"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2019 by Derick Rethans]]></copyright></init>
INFO[2020-05-04 22:23:33] e8524eb5-a010-42bd-9759-e78b50c43505; new session; connecting to port 9002
ERRO[2020-05-04 22:23:33] failed connecting to localhost on port 9002 scheme tcp: dial tcp [::1]:9002: i/o timeout
I've increased the dial timeout to 500ms in v1.2.7(being released now..). please let me know if it helps
Awesome, 1.2.7 works! Thank you @omrikiei
btw, do you think if it makes sense to add timeout
as an argument
also, is there a reconnect strategy? i noticed that if i restart the phpstorm, the connection is dead, i have to quit ktunnel and run ktunnel inject again.
Hi @kukat, I'm working on a version that includes the timeout as a cli flag. regarding the reconnect strategy, it shouldn't happen, because on each request a new connection is created to the local machine.. I'll try to reproduce it
@kukat I closed and opened phpstorm, and managed to connect with no issue
closing issue for now
ktunnel version 1.2.4 (1.2.5 actually)
my PHPStorm is listening port 9002.
And I also tried to start a TCP server to respond to the connection.
same error.