FN Hello World App 8080 Connection Issues

332 Views Asked by At

I'm following the Introduction to Fn with Python Tutorial here. I'm on Mac Catalina 10.15.7.

When I run the command "fn create app pythonapp" in my terminal, I receive the error

Fn: Post "http://127.0.0.1:8080/v2/apps": dial tcp 127.0.0.1:8080: connect: connection refused

I tried the solution explain here but it didn't fix the problem.

When I run "fn version" this is my output.

Client version is latest version: 0.6.1
Server version:  ?

If I run "fn start" this is my output.

020/12/14 10:29:57 ¡¡¡ 'fn start' should NOT be used for PRODUCTION !!! see https://github.com/fnproject/fn-helm/
time="2020-12-14T18:29:57Z" level=info msg="Setting log level to" fields.level=info
time="2020-12-14T18:29:57Z" level=info msg="Registering data store provider 'sql'"
time="2020-12-14T18:29:57Z" level=info msg="Connecting to DB" url="sqlite3:///app/data/fn.db"
time="2020-12-14T18:29:57Z" level=info msg="datastore dialed" datastore=sqlite3 max_idle_connections=256 url="sqlite3:///app/data/fn.db"
time="2020-12-14T18:29:57Z" level=info msg="agent starting cfg={MinDockerVersion:17.10.0-ce ContainerLabelTag: DockerNetworks: DockerLoadFile: DisableUnprivilegedContainers:false FreezeIdle:50ms HotPoll:200ms HotLauncherTimeout:1h0m0s HotPullTimeout:10m0s HotStartTimeout:5s DetachedHeadRoom:6m0s MaxResponseSize:0 MaxHdrResponseSize:0 MaxLogSize:1048576 MaxTotalCPU:0 MaxTotalMemory:0 MaxFsSize:0 MaxPIDs:50 MaxOpenFiles:0xc42020cb98 MaxLockedMemory:0xc42020cbb0 MaxPendingSignals:0xc42020cbb8 MaxMessageQueue:0xc42020cbc0 PreForkPoolSize:0 PreForkImage:busybox PreForkCmd:tail -f /dev/null PreForkUseOnce:0 PreForkNetworks: EnableNBResourceTracker:false MaxTmpFsInodes:0 DisableReadOnlyRootFs:false DisableDebugUserLogs:false IOFSEnableTmpfs:false EnableFDKDebugInfo:false IOFSAgentPath:/iofs IOFSMountRoot:/Users/shaymasirving/.fn/iofs IOFSOpts: ImageCleanMaxSize:0 ImageCleanExemptTags: ImageEnableVolume:false}"
time="2020-12-14T18:29:57Z" level=info msg="no docker auths from config files found (this is fine)" error="open /root/.dockercfg: no such file or directory"
time="2020-12-14T18:29:57Z" level=info msg="available memory" cgroup_limit=9223372036854771712 head_room=268435456 total_memory=1077936128
time="2020-12-14T18:29:57Z" level=info msg="ram reservations" avail_memory=809500672
time="2020-12-14T18:29:57Z" level=info msg="available cpu" avail_cpu=8000 total_cpu=8000
time="2020-12-14T18:29:57Z" level=info msg="cpu reservations" cpu=8000
time="2020-12-14T18:29:57Z" level=info msg="\n        ______\n       / ____/___\n      / /_  / __ \\\n     / __/ / / / /\n    /_/   /_/ /_/\n"
time="2020-12-14T18:29:57Z" level=info msg="Fn serving on `:8080`" type=full version=0.3.749
1

There are 1 best solutions below

0
On
  1. Ensure that Docker daemon (Docker desktop) is running
  2. run 'fn start' in one terminal. That would start the fn server in localhost. You can verify the same using 'fn list contexts' command
  3. Open an second terminal and run 'fn version'. It should display both client and server version.

If server version is missing then it means your fn server is still not running and you will not be able to deploy and invoke your function.