moloch-- / RootTheBox

A Game of Hackers (CTF Scoreboard & Game Manager)
http://root-the-box.com/
Apache License 2.0
935 stars 295 forks source link

Error rtb.service #511

Closed dd121 closed 2 years ago

dd121 commented 2 years ago

New install, database sqlite.

Service wont start with error:

$ sudo systemctl status rtb
● rtb.service - Root The Box daemon
     Loaded: loaded (/etc/systemd/system/rtb.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Mon 2022-10-10 12:46:28 UTC; 5s ago
    Process: 1424 ExecStart=/opt/CTF/RootTheBox/rootthebox.py --start (code=exited, status=203/EXEC)
   Main PID: 1424 (code=exited, status=203/EXEC)

When normal starting with rootthebox.py --start I get this error:

$ python3 rootthebox.py --start
[I 221010 13:01:05 __init__:267] Checking for Database Updates...
[I 221010 13:01:05 migration:204] Context impl SQLiteImpl.
[I 221010 13:01:05 migration:207] Will assume non-transactional DDL.
[I 221010 13:01:05 GameHistory:54] Loading game history from database ...
[I 221010 13:01:05 GameHistory:71] History load complete.
[*] Starting RTB on http://localhost:8888
[W 221010 13:01:05 __init__:329] Debug mode is enabled; DO NOT USE THIS IN PRODUCTION
/home/rtb/RootTheBox/libs/Scoreboard.py:56: RuntimeWarning: coroutine 'Scoreboard._update_gamestate' was never awaited
  asyncio.ensure_future(self._update_gamestate(self, app))
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

I suspect maybe the error is throwing the service, but I don't know how to fix it.

eljeffeg commented 2 years ago

The latest commit catches this error, so try and run an update. It should be a non issue and not sure why it even wants an await. What python version you running. The debug is likely set in your config file.

dd121 commented 2 years ago

Yes, debug was set in config file. Fixed that Issue still stands Update says I am running the latest version of rtb and I am running Python 3.10.6

error now:

tb@ctfserver:~/RootTheBox$ sudo systemctl status rtb 
● rtb.service - Root The Box daemon
     Loaded: loaded (/etc/systemd/system/rtb.service; disabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Mon 2022-10-10 14:22:14 UTC; 4s ago
    Process: 1694 ExecStart=/opt/CTF/RootTheBox/rootthebox.py --start (code=exited, status=203/EXEC)
   Main PID: 1694 (code=exited, status=203/EXEC)
rtb@ctfserver:~/RootTheBox$ 
eljeffeg commented 2 years ago

The latest version of Python that RTB supports is 3.8.x as 3.9 / 3.10 removed features that slows us to support 2.7.x. We haven't yet made the full conversion to depreciate the backward compatibility.

Also, just wanted to make sure you have the latest commit as I put in a try except on that warning recently.

PunitTailor55 commented 2 years ago

If you are deploying in aws then change in rtb.service .

[Service]
Type=simple
User=<username>
Group=<username>
eljeffeg commented 2 years ago

Version 3.12.0 removes the async and will resolve the RuntimeWarning: coroutine 'Scoreboard._update_gamestate' was never awaited warning.