shobhit-pathak / cs2-rcon-panel

A simple web panel to control CS2 servers using RCON
MIT License
50 stars 16 forks source link

panel keeps crashing in docker #3

Closed xe1os closed 8 months ago

xe1os commented 9 months ago

Hi Shobhit,

While testing your panel docker container keeps crashing/exiting after creating a match.

Below are the docker compose logs.

/usr/src/app/node_modules/rcon-srcds/dist/rcon.js:127 cs2-rcon-panel-cs2rcon-1 | reject(Error('Unable to write to socket')); cs2-rcon-panel-cs2rcon-1 | ^ cs2-rcon-panel-cs2rcon-1 | cs2-rcon-panel-cs2rcon-1 | Error: Unable to write to socket cs2-rcon-panel-cs2rcon-1 | at /usr/src/app/node_modules/rcon-srcds/dist/rcon.js:127:24 cs2-rcon-panel-cs2rcon-1 | at new Promise () cs2-rcon-panel-cs2rcon-1 | at RCON.execute (/usr/src/app/node_modules/rcon-srcds/dist/rcon.js:120:16) cs2-rcon-panel-cs2rcon-1 | at Interface. (/usr/src/app/routes/game.js:246:35) cs2-rcon-panel-cs2rcon-1 | at Interface.emit (node:events:517:28) cs2-rcon-panel-cs2rcon-1 | at [_onLine] [as _onLine] (node:internal/readline/interface:423:12) cs2-rcon-panel-cs2rcon-1 | at [_normalWrite] [as _normalWrite] (node:internal/readline/interface:617:22) cs2-rcon-panel-cs2rcon-1 | at ReadStream.ondata (node:internal/readline/interface:250:23) cs2-rcon-panel-cs2rcon-1 | at ReadStream.emit (node:events:517:28) cs2-rcon-panel-cs2rcon-1 | at addChunk (node:internal/streams/readable:335:12)

xe1os commented 9 months ago

Hi Shobit,

It is still crashing. Attached detailed docker logs cs2-rcon-panel_docker_logs.txt

shobhit-pathak commented 9 months ago

Hi @xe1os,

Thanks for the logs and reporting this issue! I'm looking into this, will try to fix this ASAP.

Soren90 commented 9 months ago

Hello xe1os.

I'm the one that commited the Dockerfile to the repository. I've tested it locally on my machine and it works fine.

rcon are in general kind of buggy at the moment. Can you please check and make sure that it works in your server?

Based in the error "Unable to write to socket". I would try the following:

  1. Can you use rcon on your server? If you join your server it won't work (assuming you run it on Linux) so test with rcon_adress.
  2. Make sure your firewall allow TCP/ICMP between your server and the web panel.
  3. Try it out with my image. I have added an example in my CS2 project: Soren90/cs2-docker (remove the CS2 part if you don't want to host the server.

If you need assistance, you can contact me on Discord: soren90

ccarpo commented 9 months ago

Hi. I have this problem as well but only once in a while like every 4-5th command or maybe some special commands I send. I use the docker image. Would be nice if you could at leat catch the error so that it does not crash the app.

shobhit-pathak commented 9 months ago

Hi @ccarpo @xe1os, I have pushed some fixes to avoid crashing and also improved error handling. Let me know if you face any issues and thanks for reporting these issues!

ccarpo commented 9 months ago

Two things.

  1. Both of us use the docker image. And I think this has not been updated. grafik

  2. I had a look at other rcon tools like https://hub.docker.com/r/siythrun/rcon-web-admin and noticed that it uses a separate websocket port. Might this be somehow interconnected?

shobhit-pathak commented 9 months ago

Hi @ccarpo, that docker image is made by @Soren90 and I think that is not updated.

To use the latest code with docker, you can take the latest pull and Run docker-compose build to build the image Run docker-compose up to start the container

I've also updated the readme for using the panel with/without docker.

Soren90 commented 9 months ago

That is completely right. I created that image as a replacement while waiting for the Dockerfile being committed to this repo. It's outdated for now, but I could update it later today if you want to.

ccarpo commented 9 months ago

No worries. For now I built it from the repo. The crash is gone. Good work. :) From my side we could close this issue.

A QoL improvement would be if I could send a custom rcon command with Enter (instead of pressing the button) and put the response label above the input so that I don't have to scroll down to see it.