GithubHelp home page GithubHelp logo

403 errors after install about patrowlhears HOT 10 CLOSED

patrowl avatar patrowl commented on June 14, 2024
403 errors after install

from patrowlhears.

Comments (10)

pieterhouwen avatar pieterhouwen commented on June 14, 2024

Nginx error log:

2021/04/09 07:32:10 [error] 3681#3681: *1 open() "/root/PatrowlHears/backend_app/staticfiles/css/app.05e53b51.css" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/css/app.05e53b51.css HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"
2021/04/09 07:32:10 [error] 3681#3681: *3 open() "/root/PatrowlHears/backend_app/staticfiles/css/chunk-vendors.00404edb.css" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/css/chunk-vendors.00404edb.css HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"
2021/04/09 07:32:12 [error] 3681#3681: *3 open() "/root/PatrowlHears/backend_app/staticfiles/favicon.ico" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/favicon.ico HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"
2021/04/09 07:32:17 [error] 3681#3681: *3 open() "/root/PatrowlHears/backend_app/staticfiles/css/app.05e53b51.css" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/css/app.05e53b51.css HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"
2021/04/09 07:32:17 [error] 3681#3681: *1 open() "/root/PatrowlHears/backend_app/staticfiles/js/app.34a32470.js" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/js/app.34a32470.js HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"
2021/04/09 07:32:17 [error] 3681#3681: *6 open() "/root/PatrowlHears/backend_app/staticfiles/js/chunk-vendors.cb4027c4.js" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/js/chunk-vendors.cb4027c4.js HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"
2021/04/09 07:32:17 [error] 3682#3682: *7 open() "/root/PatrowlHears/backend_app/staticfiles/css/chunk-vendors.00404edb.css" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/css/chunk-vendors.00404edb.css HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"
2021/04/09 07:32:17 [error] 3682#3682: *7 open() "/root/PatrowlHears/backend_app/staticfiles/js/app.34a32470.js" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/js/app.34a32470.js HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"
2021/04/09 07:32:17 [error] 3682#3682: *7 open() "/root/PatrowlHears/backend_app/staticfiles/favicon.ico" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/favicon.ico HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"
2021/04/09 07:32:26 [error] 3682#3682: *7 open() "/root/PatrowlHears/backend_app/staticfiles/css/app.05e53b51.css" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/css/app.05e53b51.css HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"
2021/04/09 07:32:26 [error] 3681#3681: *6 open() "/root/PatrowlHears/backend_app/staticfiles/css/chunk-vendors.00404edb.css" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/css/chunk-vendors.00404edb.css HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"
2021/04/09 07:32:26 [error] 3681#3681: *1 open() "/root/PatrowlHears/backend_app/staticfiles/js/app.34a32470.js" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/js/app.34a32470.js HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"
2021/04/09 07:32:26 [error] 3681#3681: *3 open() "/root/PatrowlHears/backend_app/staticfiles/js/chunk-vendors.cb4027c4.js" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/js/chunk-vendors.cb4027c4.js HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"
2021/04/09 07:32:26 [error] 3681#3681: *3 open() "/root/PatrowlHears/backend_app/staticfiles/js/app.34a32470.js" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/js/app.34a32470.js HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"
2021/04/09 07:32:26 [error] 3681#3681: *3 open() "/root/PatrowlHears/backend_app/staticfiles/favicon.ico" failed (13: Permission denied), client: 192.168.2.147, server: myhears.patrowl.io, request: "GET /static/favicon.ico HTTP/1.1", host: "192.168.2.158:8383", referrer: "http://192.168.2.158:8383/"

from patrowlhears.

MaKyOtOx avatar MaKyOtOx commented on June 14, 2024

Hello, did you used the Docker-compose ?

from patrowlhears.

MaKyOtOx avatar MaKyOtOx commented on June 14, 2024

If not try this in the backend:

python manage collectstatic --noinput

and check the /root/PatrowlHears/backend_app/staticfiles/ permissions

from patrowlhears.

pieterhouwen avatar pieterhouwen commented on June 14, 2024

Hello, I used the install.sh script (the updated one). Trying to run the python command gave me this:

root@ubuntu-server:~/PatrowlHears/backend_app# python manage.py collectstatic --noinput
  File "manage.py", line 16
    ) from exc
         ^
SyntaxError: invalid syntax
root@ubuntu-server:~/PatrowlHears/backend_app# python3 manage.py collectstatic --noinput
Traceback (most recent call last):
  File "manage.py", line 10, in main
    from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 16, in main
    ) from exc
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
root@ubuntu-server:~/PatrowlHears/backend_app#

Checking the permissions gave me this:

root@ubuntu-server:~/PatrowlHears/backend_app# cd staticfiles/
root@ubuntu-server:~/PatrowlHears/backend_app/staticfiles# ls -l
total 44
drwxr-xr-x 6 root root  4096 Apr  7 15:50 admin
drwxr-xr-x 2 root root  4096 Apr  7 15:50 css
drwxr-xr-x 5 root root  4096 Apr  7 15:50 drf-yasg
-rw-r--r-- 1 root root 15086 Apr  7 15:50 favicon.ico
drwxr-xr-x 2 root root  4096 Apr  7 15:50 fonts
drwxr-xr-x 2 root root  4096 Apr  7 15:50 img
drwxr-xr-x 2 root root  4096 Apr  7 15:50 js
drwxr-xr-x 7 root root  4096 Apr  7 15:50 rest_framework
root@ubuntu-server:~/PatrowlHears/backend_app/staticfiles# ls -l js
total 6272
-rw-r--r-- 1 root root  308780 Apr  7 15:50 app.34a32470.js
-rw-r--r-- 1 root root 1062233 Apr  7 15:50 app.34a32470.js.map
-rw-r--r-- 1 root root 1085929 Apr  7 15:50 chunk-vendors.cb4027c4.js
-rw-r--r-- 1 root root 3955494 Apr  7 15:50 chunk-vendors.cb4027c4.js.map
root@ubuntu-server:~/PatrowlHears/backend_app/staticfiles#

from patrowlhears.

MaKyOtOx avatar MaKyOtOx commented on June 14, 2024

OK, try to import the python virtual env before: source env/bin/activate

from patrowlhears.

pieterhouwen avatar pieterhouwen commented on June 14, 2024

Seemed to work, gave me this:

0 static files copied to '/root/PatrowlHears/backend_app/staticfiles', 233 unmodified.

from patrowlhears.

MaKyOtOx avatar MaKyOtOx commented on June 14, 2024

OK, it seems you have an issue with the nginx config -> (13: Permission denied)

from patrowlhears.

pieterhouwen avatar pieterhouwen commented on June 14, 2024

My nginx config file for patrowl:

server {
    listen 8383;
    autoindex on;
    server_name myhears.patrowl.io localhost;

    root .;

    # access_log var/log/nginx.patrowlhears-access.log;
    # error_log var/log/nginx.patrowlhears-error.log;

    location / {
        proxy_pass http://127.0.0.1:8303;

        proxy_set_header X-Real-IP              $remote_addr;
        proxy_set_header X-Forwarded-For        $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Host       $host;
        proxy_set_header Proxy                  "";

        add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
              expires off;

        # Custom headers
        proxy_connect_timeout                   75s;
        proxy_read_timeout                      300s;

        proxy_redirect                          off;
        proxy_buffering                         off;
        proxy_buffer_size                       "4k";
    }

    location /static {
        alias /root/PatrowlHears/backend_app/staticfiles;
    }
    location /media {
        alias /root/PatrowlHears/backend_app/media;
    }
}

from patrowlhears.

MaKyOtOx avatar MaKyOtOx commented on June 14, 2024

Still an issue ?

from patrowlhears.

pieterhouwen avatar pieterhouwen commented on June 14, 2024

No idea what changed, but no, not an issue anymore

from patrowlhears.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.