Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

files-folder not found - 404 (Uncaught exception GET /user/settings) #572

Open
adriandersen opened this issue Jun 21, 2023 · 1 comment
Open
Labels

Comments

@adriandersen
Copy link

adriandersen commented Jun 21, 2023

On first time setup, i get a 404 when i try to visit the settings to change the default password. Here is the error produced;

rootthebox                      | [E 230621 08:02:17 web:1871] Uncaught exception GET /user/settings (<foo>)
rootthebox                      |     HTTPServerRequest(protocol='https', host='<foo>', method='GET', uri='/user/settings', version='HTTP/1.1', remote_ip='<foo>')
rootthebox                      |     Traceback (most recent call last):
rootthebox                      |       File "/usr/local/lib/python3.8/site-packages/tornado/web.py", line 1784, in _execute
rootthebox                      |         result = method(*self.path_args, **self.path_kwargs)
rootthebox                      |       File "/opt/rtb/libs/SecurityDecorators.py", line 46, in wrapper
rootthebox                      |         return method(self, *args, **kwargs)
rootthebox                      |       File "/opt/rtb/handlers/UserHandlers.py", line 113, in get
rootthebox                      |         self.render_page()
rootthebox                      |       File "/opt/rtb/handlers/UserHandlers.py", line 139, in render_page
rootthebox                      |         self.render(
rootthebox                      |       File "/usr/local/lib/python3.8/site-packages/tornado/web.py", line 940, in render
rootthebox                      |         html = self.render_string(template_name, **kwargs)
rootthebox                      |       File "/usr/local/lib/python3.8/site-packages/tornado/web.py", line 1089, in render_string
rootthebox                      |         return t.generate(**namespace)
rootthebox                      |       File "/usr/local/lib/python3.8/site-packages/tornado/template.py", line 362, in generate
rootthebox                      |         return execute()
rootthebox                      |       File "user/settings_html.generated.py", line 38, in _tt_execute
rootthebox                      |         avatars = filter_avatars(dir)  # user/settings.html:20 (via main.html:28)
rootthebox                      |       File "/opt/rtb/libs/XSSImageCheck.py", line 64, in filter_avatars
rootthebox                      |         avatars = os.listdir(options.avatar_dir + "/" + dir)
rootthebox                      |     FileNotFoundError: [Errno 2] No such file or directory: './files/avatars/team'
rootthebox                      | [E 230621 08:02:17 BaseHandlers:196] Request from <snip> resulted in an error code 500:
rootthebox                      |     Traceback (most recent call last):
rootthebox                      |       File "/usr/local/lib/python3.8/site-packages/tornado/web.py", line 1784, in _execute
rootthebox                      |         result = method(*self.path_args, **self.path_kwargs)
rootthebox                      |       File "/opt/rtb/libs/SecurityDecorators.py", line 46, in wrapper
rootthebox                      |         return method(self, *args, **kwargs)
rootthebox                      |       File "/opt/rtb/handlers/UserHandlers.py", line 113, in get
rootthebox                      |         self.render_page()
rootthebox                      |       File "/opt/rtb/handlers/UserHandlers.py", line 139, in render_page
rootthebox                      |         self.render(
rootthebox                      |       File "/usr/local/lib/python3.8/site-packages/tornado/web.py", line 940, in render
rootthebox                      |         html = self.render_string(template_name, **kwargs)
rootthebox                      |       File "/usr/local/lib/python3.8/site-packages/tornado/web.py", line 1089, in render_string
rootthebox                      |         return t.generate(**namespace)
rootthebox                      |       File "/usr/local/lib/python3.8/site-packages/tornado/template.py", line 362, in generate
rootthebox                      |         return execute()
rootthebox                      |       File "user/settings_html.generated.py", line 38, in _tt_execute
rootthebox                      |         avatars = filter_avatars(dir)  # user/settings.html:20 (via main.html:28)
rootthebox                      |       File "/opt/rtb/libs/XSSImageCheck.py", line 64, in filter_avatars
rootthebox                      |         avatars = os.listdir(options.avatar_dir + "/" + dir)
rootthebox                      |     FileNotFoundError: [Errno 2] No such file or directory: './files/avatars/team'
rootthebox                      |

Content of the files-folder mounted as a volume with docker compose:
image

@adriandersen adriandersen changed the title 404 on /user/settings 404 (Uncaught exception GET /user/settings) Jun 21, 2023
@adriandersen adriandersen reopened this Jun 21, 2023
@adriandersen adriandersen changed the title 404 (Uncaught exception GET /user/settings) files-folder not found - 404 (Uncaught exception GET /user/settings) Jun 21, 2023
@eljeffeg
Copy link
Collaborator

The docker-compose mounts the .files folder, which is https://github.com/moloch--/RootTheBox/tree/master/files. It looks like you mounted an empty directory as the db files are created at first start. Did you run docker compose from outside the application root?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants