fn icon indicating copy to clipboard operation
fn copied to clipboard

fn create app myapp errors out with "read: connection reset by peer"

Open saurabhuja opened this issue 3 years ago • 1 comments

Description

fn create app myapp

Fn: Post "http://localhost:8080/v2/apps": read tcp [::1]:41904->[::1]:8080: read: connection reset by peer

Steps to reproduce the issue:

  1. Install Docker in linux environment
  2. Disconnect VPN
  3. Download and install fn
  4. fn start --log-level DEBUG Notice in output- time="2021-05-23T16:56:54Z" level=info msg="Fn serving on :8080" type=full version=0.3.749
  5. fn init --runtime go hello
  6. cd hello
  7. fn create app myapp

Describe the results you received: Fn: Post "http://localhost:8080/v2/apps": read tcp [::1]:41904->[::1]:8080: read: connection reset by peer

Describe the results you expected: myapp created

Additional information you deem important (e.g. issue happens only occasionally):

Output of fn version (CLI command):

fClient version is latest version: 0.6.6
Server version:  ?

Additional environment details (OSX, Linux, flags, etc.): Linux

saurabhuja avatar May 23 '21 17:05 saurabhuja

I had a similar (though not the same) issue, and managed to work around it. Here's what I found in my case:

  • The connection reset by peer is from docker-proxy. It happens because the fnserver container doesn't actually bind to a port inside its container.
  • My fnserver doesn't bind to a port because it is stuck before the startup procedure completes. If the startup did manage to complete, it would yield a message like Fn serving on :8080. You do have this message, but I do not. So your issue is probably with the point above.
  • In my case, the fnserver was stuck during startup because it failed to connect to docker. It tried connecting to the unix domain socket, even though my docker was configured to bind to tcp, and DOCKER_HOST was set. My workaround was to bind my docker to the unix domain socket instead.

Just in case someone else comes by from googling this issue as well :)

yawkat avatar Jun 25 '21 11:06 yawkat