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

Grouping by Corp breaks container #487

Closed susMdT closed 2 years ago

susMdT commented 2 years ago

My container functions fine, but when I attempt to change the config so it groups by corp, my container breaks. Am I doing something wrong or is there an alternative?

Normal Startup activity

root@user-VirtualBox:/home/user/ProdRootTheBox# docker-compose up 
Starting prodrootthebox_memcached_1 ... done
Starting prodrootthebox_webapp_1    ... done
Attaching to prodrootthebox_memcached_1, prodrootthebox_webapp_1
...
webapp_1     | [I 220424 06:44:23 GameHistory:71] History load complete.
webapp_1     | [*] Switching CWD to '/opt/rtb'
webapp_1     | [*] Starting RTB on http://localhost:8888

Then I enter the container and change the config

root@user-VirtualBox:/home/user/ProdRootTheBox# docker exec -it 8df /bin/bash
root@8df6ea8c9f61:/# python3 /opt/rtb/rootthebox.py --save --group_by_corp=True
[*] Switching CWD to '/opt/rtb'
[I 220424 06:49:55 ConfigHelpers:15] Saving current config to: files/rootthebox.cfg
[*] If necessary, update the db username and password in the cfg and set any advanced configuration options.
root@8df6ea8c9f61:/# cat /opt/rtb/files/rootthebox.cfg  | grep corp
group_by_corp = True

Restart the container

^CGracefully stopping... (press Ctrl+C again to force)
Stopping prodrootthebox_memcached_1 ... done
Stopping prodrootthebox_webapp_1    ... done
root@user-VirtualBox:/home/user/ProdRootTheBox# docker-compose up 
Starting prodrootthebox_memcached_1 ... done
Starting prodrootthebox_webapp_1    ... done
Attaching to prodrootthebox_memcached_1, prodrootthebox_webapp_1
webapp_1     | [I 220424 06:51:12 rootthebox:262] Environment Configuration (SQL_DIALECT): sqlite
webapp_1     | [E 220424 06:51:12 rootthebox:54] Error: (sqlite3.OperationalError) no such table: theme
webapp_1     |     [SQL: SELECT anon_1.theme_id AS anon_1_theme_id, anon_1.theme_created AS anon_1_theme_created, anon_1.theme_uuid AS anon_1_theme_uuid, anon_1.theme__name AS anon_1_theme__name, theme_file_1.id AS theme_file_1_id, theme_file_1.created AS theme_file_1_created, theme_file_1.theme_id AS theme_file_1_theme_id, theme_file_1._file_name AS theme_file_1__file_name 
webapp_1     |     FROM (SELECT theme.id AS theme_id, theme.created AS theme_created, theme.uuid AS theme_uuid, theme._name AS theme__name 
webapp_1     |     FROM theme 
webapp_1     |     WHERE theme._name = ?
webapp_1     |      LIMIT ? OFFSET ?) AS anon_1 LEFT OUTER JOIN theme_file AS theme_file_1 ON anon_1.theme_id = theme_file_1.theme_id]
webapp_1     |     [parameters: ('Cyborg', 1, 0)]
webapp_1     |     (Background on this error at: https://sqlalche.me/e/14/e3q8)
prodrootthebox_webapp_1 exited with code 1

I want to group my deployment by corp, but it keeps doing this. Is there an alternative way to do this? Thanks.

eljeffeg commented 2 years ago

Thanks for the report. I've pushed a fix.