fnproject/fn

[BUG] Fn Invoke throwing 500 in Oracle Linux Server release 7.6 (kernel memory accounting disabled in this runc build)

irshadshalu opened this issue · 1 comments

Description
I was trying to get Fn working on a Oracle Linux Server release 7.6 and followed the instructions in here . However when I invoke the function created with fn invoke myapp hello, It fails and throws a 500 Error message :

Error invoking function. status: 500 message: internal server error

Steps to reproduce the issue:

  1. Get a fresh Oracle Linux 7.6 Machine
  2. Install docker and it's dependencies
  3. Install and run Fn by following instructions at https://github.com/fnproject/fn#install-cli-tool\

Describe the results you received:
Fn invoke fails with error:

Error invoking function. status: 500 message: internal server error

Describe the results you expected:
That function should be invoked and working properly

Additional information you deem important:

I checked the logs of fn docker container and found this to be the cause:

time="2019-05-27T06:43:54Z" level=error msg="error starting container" app_id=01DBMBMZ2YNG8G00GZJ0000001 call_id=01DBW0FZJDNG8G00GZJ000000J container=01DBW0FZJDNG8G00GZJ000000J container_id=01DBW0FZJDNG8G00GZJ000000J cpus= error="API error (500): OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:424: container init caused \"process_linux.go:390: setting cgroup config for procHooks process caused \\\"kernel memory accounting disabled in this runc build\\\"\"": unknown" fn_id=01DBMBP1MGNG8G00GZJ0000002 idle_timeout=30 image="hello:0.0.2" memory=128
time="2019-05-27T06:43:54Z" level=error msg="internal server error" action="server.handleFnInvokeCall)-fm" error="API error (500): OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:424: container init caused \"process_linux.go:390: setting cgroup config for procHooks process caused \\\"kernel memory accounting disabled in this runc build\\\"\"": unknown" fn_id=01DBMBP1MGNG8G00GZJ0000002 stack="goroutine 565 [running]:\nruntime/debug.Stack(0xc4202b3440, 0x103d560, 0xc42001cca0)\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0xa7\ngithub.com/fnproject/fn/api/server.HandleErrorResponse(0x10481e0, 0xc4205ba9c0, 0x7f404ccf2398, 0xc420372000, 0x103d560, 0xc42001cca0)\n\t/go/src/github.com/fnproject/fn/api/server/error_response.go:57 +0x57f\ngithub.com/fnproject/fn/api/server.handleErrorResponse(0xc420372000, 0x103d560, 0xc42001cca0)\n\t/go/src/github.com/fnproject/fn/api/server/error_response.go:25 +0xa9\ngithub.com/fnproject/fn/api/server.(*Server).handleFnInvokeCall(0xc4204320e0, 0xc420372000)\n\t/go/src/github.com/fnproject/fn/api/server/runner_fninvoke.go:53 +0x1da\ngithub.com/fnproject/fn/api/server.(*Server).(github.com/fnproject/fn/api/server.handleFnInvokeCall)-fm(0xc420372000)\n\t/go/src/github.com/fnproject/fn/api/server/server.go:976 +0x34\ngithub.com/fnproject/fn/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc420372000)\n\t/go/src/github.com/fnproject/fn/vendor/github.com/gin-gonic/gin/context.go:108 +0x43\ngithub.com/fnproject/fn/api/server.(*Server).runMiddleware(0xc4204320e0, 0xc420372000, 0x0, 0x0, 0x0)\n\t/go/src/github.com/fnproject/fn/api/server/middleware.go:42 +0x29f\ngithub.com/fnproject/fn/api/server.(*Server).rootMiddlewareWrapper.func1(0xc420372000)\n\t/go/src/github.com/fnproject/fn/api/server/middleware.go:32 +0x52\ngithub.com/fnproject/fn/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc420372000)\n\t/go/src/github.com/fnproject/fn/vendor/github.com/gin-gonic/gin/context.go:108 +0x43\ngithub.com/fnproject/fn/api/server.panicWrap(0xc420372000)\n\t/go/src/github.com/fnproject/fn/api/server/gin_middlewares.go:191 +0x51\ngithub.com/fnproject/fn/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc420372000)\n\t/go/src/github.com/fnproject/fn/vendor/github.com/gin-gonic/gin/context.go:108 +0x43\ngithub.com/fnproject/fn/api/server.panicWrap(0xc420372000)\n\t/go/src/github.com/fnproject/fn/api/server/gin_middlewares.go:191 +0x51\ngithub.com/fnproject/fn/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc420372000)\n\t/go/src/github.com/fnproject/fn/vendor/github.com/gin-gonic/gin/context.go:108 +0x43\ngithub.com/fnproject/fn/api/server.apiMetricsWrap.func1.1(0xc420372000)\n\t/go/src/github.com/fnproject/fn/api/server/gin_middlewares.go:155 +0x2f8\ngithub.com/fnproject/fn/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc420372000)\n\t/go/src/github.com/fnproject/fn/vendor/github.com/gin-gonic/gin/context.go:108 +0x43\ngithub.com/fnproject/fn/api/server.traceWrap(0xc420372000)\n\t/go/src/github.com/fnproject/fn/api/server/gin_middlewares.go:98 +0x58c\ngithub.com/fnproject/fn/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc420372000)\n\t/go/src/github.com/fnproject/fn/vendor/github.com/gin-gonic/gin/context.go:108 +0x43\ngithub.com/fnproject/fn/api/server.loggerWrap(0xc420372000)\n\t/go/src/github.com/fnproject/fn/api/server/gin_middlewares.go:213 +0x1ea\ngithub.com/fnproject/fn/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc420372000)\n\t/go/src/github.com/fnproject/fn/vendor/github.com/gin-gonic/gin/context.go:108 +0x43\ngithub.com/fnproject/fn/vendor/github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc4200c5680, 0xc420372000)\n\t/go/src/github.com/fnproject/fn/vendor/github.com/gin-gonic/gin/gin.go:361 +0x586\ngithub.com/fnproject/fn/vendor/github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc4200c5680, 0x1047ba0, 0xc42026d810, 0xc42036a700)\n\t/go/src/github.com/fnproject/fn/vendor/github.com/gin-gonic/gin/gin.go:326 +0x153\ngithub.com/fnproject/fn/vendor/go.opencensus.io/plugin/ochttp.(*Handler).ServeHTTP(0xc4204313b0, 0x1047ba0, 0xc42026d810, 0xc42026a800)\n\t/go/src/github.com/fnproject/fn/vendor/go.opencensus.io/plugin/ochttp/server.go:86 +0x1c8\nnet/http.serverHandler.ServeHTTP(0xc4201eea90, 0x1046aa0, 0xc42036e0e0, 0xc42026a800)\n\t/usr/local/go/src/net/http/server.go:2697 +0xbc\nnet/http.(*conn).serve(0xc420232140, 0x1048120, 0xc42044b1c0)\n\t/usr/local/go/src/net/http/server.go:1830 +0x651\ncreated by net/http.(*Server).Serve\n\t/usr/local/go/src/net/http/server.go:2798 +0x27b\n"

Specifically: kernel memory accounting disabled in this runc build

Output of fn version (CLI command):

Client version is latest version: 0.5.79 
Server version:  0.3.703

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

I was able to resolve this by following the instructions in https://github.com/fnproject/docs/blob/master/fn/operate/selinux.md . Please make sure this gets more attention. Closing the issue since it was resolved.