RefractorGSCM / Refractor

An open-source game server community manager built with Go.

Home Page:https://refractor.dmas.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Playerlist Refresh bug

Deathay opened this issue · comments

Sometimes playerlist cannot be refreshed until you have edited the rcon password again, then it works again. Feels like it's not remembering the password after a while, although it shows new players that joins the servers still pops up but some people never leaves when this issue occurred & all commands just works perfectly still fine.

I'll need server error logs to determine the cause of this. I assume it is likely because you are trying to refresh a server which Refractor is not currently connected to, but I can't be sure without logs.

Hey, i have found the issue into this. When you ban a person and the banned person joins back then the playerlist bugs. when a banned player joins the server he keeps showing up in the server list and unable to refresh, you have to edit the server info again to able to use refresh player list again.

Hey, i have found the issue into this. When you ban a person and the banned person joins back then the playerlist bugs. when a banned player joins the server he keeps showing up in the server list and unable to refresh, you have to edit the server info again to able to use refresh player list again.

This implies that a disconnect may be occurring. The underlying components behind infraction creation and RCON are unrelated, so I doubt this is being caused by banning someone. Please provide some error logs so I can determine the cause.

Hey, it's not disconnecting actually, everything still is in function. When a player joins who is banned by Refractor for X minutes then the playerlist is no longer able to refresh when the banned person rejoins. I will get logs for you soon and post them if you want to still look into that or check by yourself for example banning a friend, when he joins back the issue happens, but other stuff still works.

Alright seems like i was wrong, just bad timing.

Here a log when me trying to refresh the playerlist meanwhile every single command still works + new player join/leave too.

{"level":"error","ts":1636758159.9820487,"caller":"service/rcon_service.go:317","msg":"Could not execute RCON player list command","Server":31,"Command":"PlayerList","error":"could not get command response: mailbox read operation timed out: read timeout","errorVerbose":"read timeout\ngithub.com/refractorgscm/rcon/errs.init\n\t/go/pkg/mod/github.com/refractorgscm/rcon@v1.1.1/errs/errors.go:8\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6498\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6475\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6475\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6475\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6475\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:238\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1581\nmailbox read operation timed out\ngithub.com/refractorgscm/rcon.(*Client).getResponse\n\t/go/pkg/mod/github.com/refractorgscm/rcon@v1.1.1/client.go:408\ngithub.com/refractorgscm/rcon.(*Client).ExecCommand\n\t/go/pkg/mod/github.com/refractorgscm/rcon@v1.1.1/client.go:345\nRefractor/internal/rcon/service.(*rconService).getOnlinePlayers\n\t/build/internal/rcon/service/rcon_service.go:315\nRefractor/internal/rcon/service.(*rconService).RefreshPlayerList\n\t/build/internal/rcon/service/rcon_service.go:231\nRefractor/internal/server/delivery/http.(*serverHandler).RefreshPlayerList\n\t/build/internal/server/delivery/http/server_handler.go:94\nRefractor/pkg/api/middleware.(*Enforcer).CheckAuth.func1.1\n\t/build/pkg/api/middleware/enforcer.go:100\nRefractor/pkg/api/middleware.NewActivationMiddleware.func1.1\n\t/build/pkg/api/middleware/protect.go:162\nRefractor/pkg/api/middleware.NewAPIProtectMiddleware.func1.1\n\t/build/pkg/api/middleware/protect.go:250\ngithub.com/labstack/echo/v4.(*Echo).add.func1\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/echo.go:536\ngithub.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/middleware/cors.go:186\ngithub.com/labstack/echo/v4.(*Echo).ServeHTTP\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/echo.go:646\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2878\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1929\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1581\ncould not get command response\ngithub.com/refractorgscm/rcon.(*Client).ExecCommand\n\t/go/pkg/mod/github.com/refractorgscm/rcon@v1.1.1/client.go:347\nRefractor/internal/rcon/service.(*rconService).getOnlinePlayers\n\t/build/internal/rcon/service/rcon_service.go:315\nRefractor/internal/rcon/service.(*rconService).RefreshPlayerList\n\t/build/internal/rcon/service/rcon_service.go:231\nRefractor/internal/server/delivery/http.(*serverHandler).RefreshPlayerList\n\t/build/internal/server/delivery/http/server_handler.go:94\nRefractor/pkg/api/middleware.(*Enforcer).CheckAuth.func1.1\n\t/build/pkg/api/middleware/enforcer.go:100\nRefractor/pkg/api/middleware.NewActivationMiddleware.func1.1\n\t/build/pkg/api/middleware/protect.go:162\nRefractor/pkg/api/middleware.NewAPIProtectMiddleware.func1.1\n\t/build/pkg/api/middleware/protect.go:250\ngithub.com/labstack/echo/v4.(*Echo).add.func1\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/echo.go:536\ngithub.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/middleware/cors.go:186\ngithub.com/labstack/echo/v4.(*Echo).ServeHTTP\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/echo.go:646\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2878\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1929\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1581","stacktrace":"Refractor/internal/rcon/service.(*rconService).getOnlinePlayers\n\t/build/internal/rcon/service/rcon_service.go:317\nRefractor/internal/rcon/service.(*rconService).RefreshPlayerList\n\t/build/internal/rcon/service/rcon_service.go:231\nRefractor/internal/server/delivery/http.(*serverHandler).RefreshPlayerList\n\t/build/internal/server/delivery/http/server_handler.go:94\nRefractor/pkg/api/middleware.(*Enforcer).CheckAuth.func1.1\n\t/build/pkg/api/middleware/enforcer.go:100\nRefractor/pkg/api/middleware.NewActivationMiddleware.func1.1\n\t/build/pkg/api/middleware/protect.go:162\nRefractor/pkg/api/middleware.NewAPIProtectMiddleware.func1.1\n\t/build/pkg/api/middleware/protect.go:250\ngithub.com/labstack/echo/v4.(*Echo).add.func1\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/echo.go:536\ngithub.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/middleware/cors.go:186\ngithub.com/labstack/echo/v4.(*Echo).ServeHTTP\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/echo.go:646\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2878\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1929"} {"level":"error","ts":1636758159.9822,"caller":"api/errorhandler.go:69","msg":"An error occurred","error":"could not get command response: mailbox read operation timed out: read timeout","errorVerbose":"read timeout\ngithub.com/refractorgscm/rcon/errs.init\n\t/go/pkg/mod/github.com/refractorgscm/rcon@v1.1.1/errs/errors.go:8\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6498\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6475\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6475\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6475\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6475\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:238\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1581\nmailbox read operation timed out\ngithub.com/refractorgscm/rcon.(*Client).getResponse\n\t/go/pkg/mod/github.com/refractorgscm/rcon@v1.1.1/client.go:408\ngithub.com/refractorgscm/rcon.(*Client).ExecCommand\n\t/go/pkg/mod/github.com/refractorgscm/rcon@v1.1.1/client.go:345\nRefractor/internal/rcon/service.(*rconService).getOnlinePlayers\n\t/build/internal/rcon/service/rcon_service.go:315\nRefractor/internal/rcon/service.(*rconService).RefreshPlayerList\n\t/build/internal/rcon/service/rcon_service.go:231\nRefractor/internal/server/delivery/http.(*serverHandler).RefreshPlayerList\n\t/build/internal/server/delivery/http/server_handler.go:94\nRefractor/pkg/api/middleware.(*Enforcer).CheckAuth.func1.1\n\t/build/pkg/api/middleware/enforcer.go:100\nRefractor/pkg/api/middleware.NewActivationMiddleware.func1.1\n\t/build/pkg/api/middleware/protect.go:162\nRefractor/pkg/api/middleware.NewAPIProtectMiddleware.func1.1\n\t/build/pkg/api/middleware/protect.go:250\ngithub.com/labstack/echo/v4.(*Echo).add.func1\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/echo.go:536\ngithub.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/middleware/cors.go:186\ngithub.com/labstack/echo/v4.(*Echo).ServeHTTP\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/echo.go:646\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2878\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1929\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1581\ncould not get command response\ngithub.com/refractorgscm/rcon.(*Client).ExecCommand\n\t/go/pkg/mod/github.com/refractorgscm/rcon@v1.1.1/client.go:347\nRefractor/internal/rcon/service.(*rconService).getOnlinePlayers\n\t/build/internal/rcon/service/rcon_service.go:315\nRefractor/internal/rcon/service.(*rconService).RefreshPlayerList\n\t/build/internal/rcon/service/rcon_service.go:231\nRefractor/internal/server/delivery/http.(*serverHandler).RefreshPlayerList\n\t/build/internal/server/delivery/http/server_handler.go:94\nRefractor/pkg/api/middleware.(*Enforcer).CheckAuth.func1.1\n\t/build/pkg/api/middleware/enforcer.go:100\nRefractor/pkg/api/middleware.NewActivationMiddleware.func1.1\n\t/build/pkg/api/middleware/protect.go:162\nRefractor/pkg/api/middleware.NewAPIProtectMiddleware.func1.1\n\t/build/pkg/api/middleware/protect.go:250\ngithub.com/labstack/echo/v4.(*Echo).add.func1\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/echo.go:536\ngithub.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/middleware/cors.go:186\ngithub.com/labstack/echo/v4.(*Echo).ServeHTTP\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/echo.go:646\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2878\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1929\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1581","stacktrace":"Refractor/pkg/api.GetEchoErrorHandler.func1\n\t/build/pkg/api/errorhandler.go:69\ngithub.com/labstack/echo/v4.(*Echo).ServeHTTP\n\t/go/pkg/mod/github.com/labstack/echo/v4@v4.3.0/echo.go:647\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2878\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1929"}

This seems to be an issue with RefractorGSCM/RCON client or the configuration being passed into it. Might need to refactor how the read queue works. I'll look into it sometime soon.

Unfortunately, I'm not able to replicate this. If you could provide a more complete log file that might help. I've done thorough stress testing and I'm no longer convinced that it's the fault of RefractorGSCM/RCON like I assumed in my previous comment.

If your log file is too big to send or read, you can always recreate the docker container which will reset the file.

You can do this using the following command: docker-compose -f docker-compose.yml -f compose-frontend-svelte.yml up -d --force-recreate --no-deps refractor

If you're able to send me a complete log file, I'll be able to do further diagnostics.

The cause was a very weird race condition in our RCON service. It's been resolved in release v0.3.1.