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

HTTP stats - unable to get uWSGI statistics #71

Open
EffectShapiro opened this issue Mar 6, 2023 · 2 comments
Open

HTTP stats - unable to get uWSGI statistics #71

EffectShapiro opened this issue Mar 6, 2023 · 2 comments

Comments

@EffectShapiro
Copy link

OS : Debian 11 ( bullseye )
uWSGI version : 2.0.19.1-7.1

app configuration

[uwsgi]
module = test:create_app()

master = true
enable-threads = true
processes = 1
listen = 800
thunder-lock = true
lazy-apps = true
no-orphans = true
die-on-term = true
stats = 127.0.0.1:9191

plugin = python3
socket = /run/uwsgi/app/test/socket
chmod-socket = 600
uid = www-data
gid = www-data
vacuum = true

log-4xx = True
log-5xx = True
py-tracebacker = /tmp/tbsocket

Then when trying to use uwsgitop

$ uwsgitop http://127.0.0.1:9191

Traceback (most recent call last):
  File "/usr/local/bin/uwsgitop", line 162, in main
    r = urllib2.urlopen(addr)
  File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.9/urllib/request.py", line 517, in open
    response = self._open(req, data)
  File "/usr/lib/python3.9/urllib/request.py", line 534, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.9/urllib/request.py", line 1375, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib/python3.9/urllib/request.py", line 1350, in do_open
    r = h.getresponse()
  File "/usr/lib/python3.9/http/client.py", line 1347, in getresponse
    response.begin()
  File "/usr/lib/python3.9/http/client.py", line 307, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.9/http/client.py", line 289, in _read_status
    raise BadStatusLine(line)
http.client.BadStatusLine: {


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/uwsgitop", line 331, in <module>
    main()
  File "/usr/local/bin/uwsgitop", line 179, in main
    raise Exception("unable to get uWSGI statistics")
Exception: unable to get uWSGI statistics
@xrmx
Copy link
Owner

xrmx commented Mar 6, 2023

@EffectShapiro please read the README

@ryanbagwell
Copy link

@EffectShapiro

You're trying to connect to the stats server over http without stats-http = true in your ini file.

Also I believe stats = 127.0.0.1:9191 should just have the port, i.e. stats = :9191 according to the readme, but I'm not sure if that matters

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

3 participants