openfga: bug: open fga crashes for no apparent reason

Hey,

I’m using open fga using docker (I’m using the latest version - 0.2.0). The docker works fine, but after some time - sending a request to openfga (using SDK) returns a 500 error with the following message: "FGA API Internal Error: post check : Error Internal Server Error"

Logs from docker container: 2022-08-17T20:55:47.861Z ERROR grpc error {"error": "rpc error: code = Unknown desc = rpc error: code = Code(4000) desc = Internal Server Error", "request_url": "/stores/01G9TE715A51EDP84Q7S9VH9CX/check"} github.com/openfga/openfga/pkg/logger.(*ZapLogger).ErrorWithContext /home/runner/work/openfga/openfga/pkg/logger/logger.go:80 github.com/openfga/openfga/server.New.func1 /home/runner/work/openfga/openfga/server/server.go:143 github.com/grpc-ecosystem/grpc-gateway/v2/runtime.HTTPError /home/runner/go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway/v2@v2.11.2/runtime/errors.go:81 go.buf.build/openfga/go/openfga/api/openfga/v1.RegisterOpenFGAServiceHandlerClient.func3 /home/runner/go/pkg/mod/go.buf.build/openfga/go/openfga/api@v1.2.27/openfga/v1/openfga_service.pb.gw.go:1591 github.com/grpc-ecosystem/grpc-gateway/v2/runtime.(*ServeMux).ServeHTTP /home/runner/go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway/v2@v2.11.2/runtime/mux.go:386 github.com/rs/cors.(*Cors).Handler.func1 /home/runner/go/pkg/mod/github.com/rs/cors@v1.8.2/cors.go:231 net/http.HandlerFunc.ServeHTTP /opt/hostedtoolcache/go/1.18.5/x64/src/net/http/server.go:2084 net/http.serverHandler.ServeHTTP /opt/hostedtoolcache/go/1.18.5/x64/src/net/http/server.go:2916 net/http.(*conn).serve /opt/hostedtoolcache/go/1.18.5/x64/src/net/http/server.go:1966

I can’t seem to reproduce it. The only thing that solves this is restarting the docker container.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 23 (13 by maintainers)

Most upvoted comments

I might look into the last one @craigpastro. The problem kind of fixed itself. I had forgot to add readiness/liveness probes to the OpenFGA pod. These ping the postgres db, so now it never reaches the 10 min auto_pause limit we’ve set in Aurora.

Anyway, thanks you so much for the detailed response!