Skip to content

File errors silently fail and not reported to the web browser #152

@clach04

Description

@clach04

Loading files will fail with an exception that's visible in the server log but not to the end user in the browser. If the web browser debug console is opened and errors are displayed there is some information but its essentially hidden from the user.

test case, on server in note directory:

sudo bash
# echo root_owned_file > root_owned_file.txt
# ls -alr root_owned_file.txt
-rw-r--r-- 1 root root 16 Jul 10 10:29 root_owned_file.txt
# chmod 700 root_owned_file.txt
# ls -alr root_owned_file.txt
-rwx------ 1 root root 16 Jul 10 10:29 root_owned_file.txt

try and open file in web browser. Nothing appears to happen in browser.

Open web browser console and display errors:

root_owned_file.txt:1 Failed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR)

Same error whether debug on or off when starting server.

Server log:

PermissionError: [Errno 13] Permission denied: '...pervane/example/root_owned_file.txt'
ERROR:root:There is an error while reading: ...pervane/example/root_owned_file.txt. Error: [Errno 13] Permission denied: '...pervane/example/root_owned_file.txt'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions