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

uWSGI crashing but still gets the job done !! #46

Open
radurambet opened this issue Mar 3, 2024 · 0 comments
Open

uWSGI crashing but still gets the job done !! #46

radurambet opened this issue Mar 3, 2024 · 0 comments

Comments

@radurambet
Copy link

radurambet commented Mar 3, 2024

Update : It works as expected with Debian 10 ! No 11/12
That means you have to use backports for Wireguard / Batman-adv or whatever setup you have !


For whaterver reason uWSGI is crashing and creating CPU usage and also monster log. I dont' really get how come that it gets the job done in updating Wireuard server. Somehow I would have never noticed unless the machine wouldn't be so underpowered (2core Atom) and whenever something goes wrong the CPU usage spikes.

Its funny that it works still throws errors ! Somehow it restarts and stays in the loop !

Any ideas . Running Debian 12 and VxLAN maybe that is "too new" . it may happen sometimes. Second: I am running with self signed certificate and openwisp2_wireguard_curl_insecure: true

*** Starting uWSGI 2.0.24 (64bit) on [Sun Mar  3 23:28:50 2024] ***
compiled with version: 12.2.0 on 03 March 2024 17:30:05
os: Linux-6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01)
nodename: server
machine: x86_64
clock source: unix
detected number of CPU cores: 2
current working directory: /opt/wireguard-openwisp/wireguard-1
writing pidfile to openwisp2_wireguard_flask_app.pid
detected binary path: /opt/wireguard-openwisp/wireguard-1/env/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
setgid() to 1001
setuid() to 1001
chdir() to /opt/wireguard-openwisp/wireguard-1
your processes number limit is 2399
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on 0.0.0.0:8081 fd 3
uwsgi socket 0 bound to UNIX address openwisp2_wireguard_flask_app.sock fd 6
Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
Python main interpreter initialized at 0x7f4e0c160018
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 5 seconds
mapped 250128 bytes (244 KB) for 4 cores
*** Operational MODE: preforking+threaded ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 2814)
spawned uWSGI worker 1 (pid: 2815, cores: 2)
spawned uWSGI worker 2 (pid: 2816, cores: 2)
spawned uWSGI http 1 (pid: 2817)
Traceback (most recent call last):
  File "/opt/wireguard-openwisp/wireguard-1/vpn_updater.py", line 3, in <module>
    from flask import Flask, Response, request
  File "/opt/wireguard-openwisp/wireguard-1/env/lib/python3.11/site-packages/flask/__init__.py", line 7, in <module>
    from .app import Flask as Flask
  File "/opt/wireguard-openwisp/wireguard-1/env/lib/python3.11/site-packages/flask/app.py", line 28, in <module>
    from . import cli
  File "/opt/wireguard-openwisp/wireguard-1/env/lib/python3.11/site-packages/flask/cli.py", line 18, in <module>
    from .helpers import get_debug_flag
  File "/opt/wireguard-openwisp/wireguard-1/env/lib/python3.11/site-packages/flask/helpers.py", line 16, in <module>
    from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/opt/wireguard-openwisp/wireguard-1/env/lib/python3.11/site-packages/werkzeug/urls.py)
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. GAME OVER ***
SIGINT/SIGTERM received...killing workers...
Exception ignored in: <module 'threading' from '/usr/lib/python3.11/threading.py'>
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1534, in _shutdown
    def _shutdown():

KeyboardInterrupt:
Traceback (most recent call last):
  File "/opt/wireguard-openwisp/wireguard-1/vpn_updater.py", line 3, in <module>
    from flask import Flask, Response, request
  File "/opt/wireguard-openwisp/wireguard-1/env/lib/python3.11/site-packages/flask/__init__.py", line 7, in <module>
    from .app import Flask as Flask
  File "/opt/wireguard-openwisp/wireguard-1/env/lib/python3.11/site-packages/flask/app.py", line 28, in <module>
    from . import cli
  File "/opt/wireguard-openwisp/wireguard-1/env/lib/python3.11/site-packages/flask/cli.py", line 14, in <module>
    import click
  File "/opt/wireguard-openwisp/wireguard-1/env/lib/python3.11/site-packages/click/__init__.py", line 7, in <module>
    from .core import Argument as Argument
  File "/opt/wireguard-openwisp/wireguard-1/env/lib/python3.11/site-packages/click/core.py", line 2012, in <module>
    class Parameter:
  File "/opt/wireguard-openwisp/wireguard-1/env/lib/python3.11/site-packages/click/core.py", line 2101, in Parameter
    shell_complete: t.Optional[
                    ^^^^^^^^^^^
  File "/usr/lib/python3.11/typing.py", line 341, in inner
    return cached(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^
gateway "uWSGI http 1" has been buried (pid: 2817)
  File "/usr/lib/python3.11/typing.py", line 463, in __getitem__
    return self._getitem(self, parameters)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/typing.py", line 685, in Optional
    return Union[arg, type(None)]
           ~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/typing.py", line 341, in inner
    return cached(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/typing.py", line 1352, in __hash__
    return hash((self.__origin__, self.__args__))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/typing.py", line 877, in __hash__
    def __hash__(self):

KeyboardInterrupt
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. GAME OVER ***
OOPS ! failed loading app in worker 1 (pid 2815)
Sun Mar  3 23:28:52 2024 - need-app requested, destroying the instance...
OOPS ! failed loading app in worker 2 (pid 2816)
Sun Mar  3 23:28:52 2024 - need-app requested, destroying the instance...
goodbye to uWSGI.
VACUUM: unix socket openwisp2_wireguard_flask_app.sock removed.
[uWSGI] getting INI configuration from uwsgi.ini
*** Starting uWSGI 2.0.24 (64bit) on [Sun Mar  3 23:28:54 2024] ***
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

1 participant