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

Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. #10

Closed
Raju opened this issue Jun 23, 2020 · 4 comments

Comments

@Raju
Copy link

Raju commented Jun 23, 2020

❯ docker run -d --restart=always --name nginxui -p 3333:8080 -v /etc/nginx:/nginx schenkd/nginx-ui:latest

❯ docker logs nginxui
*** Starting uWSGI 2.0.18 (64bit) on [Tue Jun 23 01:55:51 2020] ***
compiled with version: 9.3.0 on 21 June 2020 09:42:26
os: Linux-5.4.0-37-generic #41-Ubuntu SMP Wed Jun 3 18:57:02 UTC 2020
nodename: f5f7495cb4e6
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /webapp
detected binary path: /usr/local/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on 0.0.0.0:8080 fd 4
spawned uWSGI http 1 (pid: 6)
uwsgi socket 0 bound to TCP address 127.0.0.1:33773 (port auto-assigned) fd 3
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Python version: 3.7.7 (default, Jun 3 2020, 19:58:28) [GCC 9.3.0]
Python main interpreter initialized at 0x55f7fbfe7ce0
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 145984 bytes (142 KB) for 8 cores
*** Operational MODE: threaded ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x55f7fbfe7ce0 pid: 1 (default app)
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 1, cores: 8)
[2020-06-23 01:56:30,544] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "./app/ui/views.py", line 15, in index
config = [f for f in os.listdir(nginx_path) if os.path.isfile(os.path.join(nginx_path, f))]
FileNotFoundError: [Errno 2] No such file or directory: '/etc/nginx'
[pid: 1|app: 0|req: 1/1] 172.17.0.1 () {48 vars in 914 bytes} [Tue Jun 23 01:56:30 2020] GET / => generated 290 bytes in 3 msecs (HTTP/1.1 500) 2 headers in 99 bytes (1 switches on core 1)
[pid: 1|app: 0|req: 2/2] 172.17.0.1 () {46 vars in 832 bytes} [Tue Jun 23 01:56:30 2020] GET /favicon.ico => generated 232 bytes in 0 msecs (HTTP/1.1 404) 2 headers in 87 bytes (1 switches on core 1)

❯ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f5f7495cb4e6 schenkd/nginx-ui:latest "uwsgi --http 0.0.0.…" 32 seconds ago Up 30 seconds 0.0.0.0:3333->8080/tcp nginxui

unable to run on http://localhost:3333/

Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

@debuggerboy
Copy link

Raju,

You need to have a fully working nginx install on your host.
If yes, then your "/etc/nginx" should have the "nginx.conf" file and "conf.d" directory.

Then when you launch "nginx-ui" docker container, you need to add your local /etc/nginx as a volume inside the "nginx-ui" docker container mapped to /etc/nginx such that the Python Flask application can read it's configuration and display the website.

  1. Make sure that you local nginx is setup properly and your /etc/nginx directory is populated.
  2. When you launch nginx-ui container mount your local nginx config directory into the container. use "-v /etc/nginx:/etc/nginx"

Other option

Launch 2 containers "nginx-ui" and "nginx" using "docker-compose.yml" and the use "/etc/nginx" as a shared volume on both "nginx-ui" and "nginx".

@LucaNerlich
Copy link
Contributor

What @debuggerboy mentioned, using the correct volumemapping works:

docker run -d --restart=always --name nginxui -v /etc/nginx:/etc/nginx -p 7777:8080 schenkd/nginx-ui:latest

The docs are "wrong".

@Raju
Copy link
Author

Raju commented Jun 24, 2020

now i got it, as i'm new to docker so a bit confusing with all those options and stuffs but now i can confirm its working on localhost:7777

I'll go head and close the issue.

@Raju Raju closed this as completed Jun 24, 2020
@amitsax
Copy link

amitsax commented Mar 21, 2021

Adding to this issue - When used with LinuxServer.io image of swag.

Map the swag/nginx directory to /etc/nginx of docker image of nginx-ui.
you will get the same error reported htere, because conf.d directory is not available.
Workaround:
create a symbolic link conf.d directory linked to proxy-confs directory. that
in swag/nginx directory execute: ln -s proxy-confs conf.d

restart container for nginx-ui. now this error would be resolved.

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

No branches or pull requests

4 participants