flyctl icon indicating copy to clipboard operation
flyctl copied to clipboard

"error reading server preface" under proxy environment.

Open hidehide55 opened this issue 1 year ago • 2 comments

Describe the bug I am running the flyctl command on a PC under a proxy server for internet access. The proxy server is specified in the https_proxy environment variable. Since v0.1.135 of flyctl, I get the some error messages. I have tried from v0.1.135 to v0.1.147 and get the same message. apps list is not much of a problem, but the deploy process stalls.

  • Operating system
    • Ubuntu 20.04 LTS Desktop
  • fly version
    • flyctl v0.1.134 linux/amd64 Commit: 4068ab361d741dc37df5c1b40d3adad290024f2e BuildDate: 2023-12-08T18:58:44Z
    • flyctl v0.1.135 linux/amd64 Commit: 4cd282a8ce995bec8fb408d880f159159eb209bc BuildDate: 2023-12-22T00:44:24Z

Command output:

  • v0.1.135 ~
flyctl apps list

NAME         	OWNER   	STATUS  	PLATFORM	LATEST DEPLOY        
xxxx-xxxx-999	personal	deployed	machines	2023-xx-xxTxx:xx:xxZ	

2024/xx/xx xx:xx:xx traces export: context deadline exceeded: rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: read tcp [IP ADDRESS OF PC]:43168-[IP ADDRESS OF PROXY SERVER]:[PORT]: read: connection reset by peer"

  • v0.1.134
flyctl apps list

NAME         	OWNER   	STATUS  	PLATFORM	LATEST DEPLOY        
xxxx-xxxx-999	personal	deployed	machines	2023-xx-xxTxx:xx:xxZ	

hidehide55 avatar Feb 08 '24 05:02 hidehide55

Thanks for reporting the issue. I believe the issue is that some telemetry is going over HTTP so it's not being proxied by the HTTPS_PROXY. Can you try setting http_proxy as well and see if that fixes it? If so, I can make the fix on the CLI.

benbjohnson avatar Feb 09 '24 19:02 benbjohnson

The previous attempt also had http_proxy already set.

I tried with v0.2.0 and get the same message.

set | grep proxy
----
http_proxy=http://xxx.xxx.xxx.xxx:xxxx/
https_proxy=http://xxx.xxx.xxx.xxx:xxxx/
no_proxy='localhost,...'
----

flyctl apps list
----
NAME           	OWNER   	STATUS  	LATEST DEPLOY     
xxxx-xxxx-999	personal	deployed	Xxx xx 2023 xx:xx

2024/xx/xx xx:xx:xx traces export: context deadline exceeded: rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: read tcp [IP ADDRESS OF PC]:52798->[IP ADDRESS OF PROXY SERVER]:[PORT]: read: connection reset by peer"
----

Thanks.

hidehide55 avatar Feb 13 '24 01:02 hidehide55