cli icon indicating copy to clipboard operation
cli copied to clipboard

Fn server port not exposed

Open Franos13 opened this issue 5 years ago • 12 comments

Hello, Environment:

  • Windows 10 Home
  • Docker version: 18.06.1-ce (client and server)

Run: docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -v ${pwd}/data:/app/data -p 8080:8080 fnproject/fnserver

Run then: fn version Output: Client version is latest version: 0.5.15 Server version: ?

Check the network: netstat -ano I was not able to see any entry with 8080 listening :-(

But if i run docker ps, I was able to see: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES c6810db267e7 fnproject/fnserver "preentry.sh ./fnser…" 3 minutes ago Up 25 seconds 2375/tcp, 0.0.0.0:8080->8080/tcp functions

I don't know if it can help you to diagnose the issue I have but when I run the fn server using docker run, I got this in the stdout at the begining: mount: permission denied (are you root?) Could not mount /sys/kernel/security. AppArmor detection and --privileged mode might break. mount: permission denied (are you root?) [1]+ Done(1) dockerd-entrypoint.sh --storage-driver=${fsdriver} --mtu=${mtu}

Anyone can help me to solve this issue ?

Best regards.

Franos13 avatar Oct 07 '18 09:10 Franos13

Hi and welcome! First of all, I recommend to start a server with fn start (There’s a bunch of config options needed).

The other thing. Where your docker runs? It doesn’t seem that docker runs on your localhost, so, you need to work with docker inspect to figure out a real IP address of the container and use that to talk to Fn using CLI.

denismakogon avatar Oct 07 '18 09:10 denismakogon

Hello,

Thanks for the advices.

I have already tried fn start. I got this error: docker: Error response from daemon: invalid mode: /iofs.

Then I have found that: https://github.com/fnproject/docs/blob/master/fn/operate/windows.md This is why I have followed this by running

docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -v ${pwd}/data:/app/data -p 8080:8080 fnproject/fnserver

I tried by setting the FN_API_URL to http://192.168.99.100:8080 and it works now. If I run fn version, I now get: Client version is latest version: 0.5.15 Server version: 0.3.595

Best regards.

Franos13 avatar Oct 07 '18 13:10 Franos13

Well, you need that iofs. Without that Fn would not function normally. Would you mind to try the following command: fn start ––log-level DEBUG? And provide an output here please.

denismakogon avatar Oct 07 '18 13:10 denismakogon

Nothing more than when I run fn start: fn start --log-level DEBUG docker: Error response from daemon: invalid mode: /iofs. See 'docker run --help'. 2018/10/07 15:32:44 Error: processed finished with error exit status 125

Franos13 avatar Oct 07 '18 13:10 Franos13

Using the other way, I was able to deploy a first java function: fn deploy --app myapp --local Deploying myfirstfunction to app: myapp Bumped to version 0.0.3 Building image myfirstfunction:0.0.3 ............................................................................................................................................................................................................ Updating function myfirstfunction using image myfirstfunction:0.0.3... Successfully created app: myapp Successfully created function: myfirstfunction with myfirstfunction:0.0.3

But when I tried to run it (eg fn invoke myapp myfirstfunction), nothing happened :-( Even if on the server side I saw: INFO[2018-10-07T13:27:18Z] Hot function launcher starting action="server.handleFnInvokeCall)-fm" app_id=01CS7B3RYJNG8G00GZJ0000001 fnID=01CS7B3S08NG8G00GZJ0000002 fn_id=01CS7B3S08NG8G00GZJ0000002 id=01CS7BBVTHNG8G00GZJ0000001 launcher_timeout=1h0m0s

Is it normal ?

Franos13 avatar Oct 07 '18 13:10 Franos13

That’s not normal, if you’re going to run Fn through docker CLI you need to set up more env vars than you can imagine. That’s why you need to stick with Fn CLI. Try to run the same commands but on the Linux machine. I’m not quite sure that Win is quite supported well.

denismakogon avatar Oct 07 '18 15:10 denismakogon

This is the question: is Windows supported ?

My understanding is that it is supported according to the documentation available at https://github.com/fnproject/fn (paragraph Install CLI tool and sub paragraph 3. Download the bin - Linux, macOS and Windows and paragraph Run Fn Server > if you are on Windows, check here.).

So if it supported as I assume, there are some issues: - fn start doesn't work on Windows :-( - workaround here but after deploying my function, I wasn't able to run it :-(
I do request fixes for those bugs.

Who can provide this information (supported or not on Windows) ? and if not well supported yet, will Windows be supported at some point (in such case, the issues I have reported have to be fixed) ?

Best Regards.

Franos13 avatar Oct 07 '18 16:10 Franos13

Okay, here’s the thing. Try to do the same manipulations but with PowerShell.

denismakogon avatar Oct 07 '18 16:10 denismakogon

Using PowerShell:

  • Try to run fn start (same thing) PS C:\Users\xxxx\Downloads> .\fn.exe start ––log-level DEBUG docker: Error response from daemon: invalid mode: /iofs. See 'docker run --help'. 2018/10/07 18:33:42 Error: processed finished with error exit status 125
  • $env:FN_API_URL = 'http://192.168.99.100:8080' Deploy successfully my function: fn deploy --app myapp --local
  • Try to run my function: fn invoke myapp myfirstfunction Same issue :-( unfortunately Best Regards.

Franos13 avatar Oct 07 '18 16:10 Franos13

I see, well, let’s wait until Monday. Until that my guess is that Fn CLI start is not functioning well on Windows. Use Linux for now.

denismakogon avatar Oct 07 '18 17:10 denismakogon

Maybe I have found what's went wrong. After killing the containers I have seen that:

INFO[2018-10-07T16:45:00Z] hot function terminated app_id=01CS7PK33XNG8G00GZJ0000001 cpus= error="container out of memory, you may want to raise fn.memory for this function (default: 128MB)" fn_id=01CS7PK37HNG8G00GZJ0000002 format=http-stream id=01CS7PK77VNG8G00GZJ0000005 idle_timeout=30 image="myfirstfunction:0.0.4" memory=128

Most probably I haven't enough memory. I will try with another one with more available memory.

Thanks or your support anyway :-)

Best Regards.

Franos13 avatar Oct 07 '18 17:10 Franos13

Hello,

Try on another computer with more RAM. Still doesn't work :-(

Set Virtual Box with 4 Gb and 2 CPUs.

Launch fn server with docker run -e FN_LOG_LEVEL=DEBUG --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -v ${pwd}/data:/app/data -p 8080:8080 fnproject/fnserver Then: fn -v invoke myapp myfirstfunction

Nothing displayed in the log and nothing happened :-(

Best Regards.

Franos13 avatar Oct 14 '18 12:10 Franos13