nicolargo / glances

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
http://nicolargo.github.io/glances/
Other
26.86k stars 1.53k forks source link

Error 501: HTTPStatus.NOT_IMPLEMENTED - Server does not support this operation. #1713

Closed codecakes closed 1 year ago

codecakes commented 4 years ago

Similar to #1343 but bottle is installed

image

Description

For a bug: Describe the bug and list the steps you used when the issue occurred. pip3 install -u 'glances[all]' Successfully installed bernhard-0.2.6 bottle-0.12.18 docker-4.3.1 future-0.18.2 glances-3.1.5 ifaddr-0.1.7 pbkdf2-1.3 ply-3.11 protobuf-3.13.0 psutil-5.7.2 py-cpuinfo-7.0.0 py3nvml-0.2.6 pySMART.smartx-0.3.10 pyasn1-0.4.8 pycryptodomex-3.9.8 pygal-2.4.0 pymdstat-0.4.2 pysmi-0.3.4 pysnmp-4.4.12 pystache-0.5.4 scandir-1.10.0 sparklines-0.4.2 websocket-client-0.57.0 wifi-0.3.8 xmltodict-0.12.0 zeroconf-0.28.1

Versions

Logs

https://pastebin.com/gpTYEZ3r

nicolargo commented 4 years ago

Hi @codecakes

what is the Bottle version installed on your system ?

pip freeze | grep bottle

?

codecakes commented 4 years ago

He @nicolargo

bottle==0.12.18

I see the bottle dep is not version-locked. what ver is needed for this? running just glances works on cli

nicolargo commented 4 years ago

Tested on my side with Bottle 0.12.18 and no issue on my Ubuntu OS...

Any others Mac OS users with this issue ?

codecakes commented 4 years ago

@nicolargo can you tell me what is the first route it is trying to get ? I can inspect

nicolargo commented 4 years ago

You can try to get the following route via a curl command: /api/3/all

See all Glances API routes here: https://github.com/nicolargo/glances/wiki/The-Glances-RESTFULL-JSON-API#get-api3all

codecakes commented 4 years ago
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <title>Error response</title>
    </head>
    <body>
        <h1>Error response</h1>
        <p>Error code: 501</p>
        <p>Message: Unsupported method ('GET').</p>
        <p>Error code explanation: HTTPStatus.NOT_IMPLEMENTED - Server does not support this operation.</p>
    </body>
</html>

i think ill take a look under the hood

nicolargo commented 4 years ago

@codecakes Any news concerning the issue ?

codecakes commented 4 years ago

@nicolargo im gona look at this one next sat. haven't been able to look at it;

act10 commented 3 years ago

I had a similar error if I ran in server mode and connected to the port 61209 fixed in start script glances -w and connect to :61208

ThomasCr commented 2 years ago

I have the same error, but I installed glances from Ubuntu 22.04 package repository

$ apt policy glances
glances:
  Installed: 3.2.4.2+dfsg-1
  Candidate: 3.2.4.2+dfsg-1
  Version table:
 *** 3.2.4.2+dfsg-1 500
        500 http://de.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        100 /var/lib/dpkg/status

and modified service file to run not localhost only (because I expected a problem with reverse proxy):

$ cat /etc/systemd/system/glances.service.d/override.conf 
[Service]
ExecStart=
ExecStart=/usr/bin/glances -s -w -p 61208
#ExecStart=/usr/bin/glances -s -w -B 127.0.0.1 -p 61208

$ systemctl status glances.service 
● glances.service - Glances
     Loaded: loaded (/lib/systemd/system/glances.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/glances.service.d
             └─override.conf
     Active: active (running) since Fri 2022-09-30 22:53:05 UTC; 14h ago
       Docs: man:glances(1)
             https://github.com/nicolargo/glances
   Main PID: 9813 (glances)
      Tasks: 1 (limit: 38076)
     Memory: 26.4M
        CPU: 15.890s
     CGroup: /system.slice/glances.service
             └─9813 /usr/bin/python3 /usr/bin/glances -s -w -p 61208

Sep 30 22:53:05 zentrale2 systemd[1]: Started Glances.

But it makes no difference if I access glances with apache reverse proxy or direct - I always get the 501 message:

Unsupported method ('GET').

Error code explanation: HTTPStatus.NOT_IMPLEMENTED - Server does not support this operation.

My pip output is:

bottle==0.12.19

$ python3 --version
Python 3.10.6

Any update to this issue?

KingPin commented 1 year ago

@ThomasCr did you by any chance resolve this issue? I'm having this issue currently on Debian bullseye with apt installed glances.

RazCrimson commented 1 year ago

@nicolargo

Does glances currently support running both XML-RPC Server mode and the Web UI mode on the same ports?

nicolargo commented 1 year ago

Nope...

RazCrimson commented 1 year ago

A very fast reply from Nicolas :)

@KingPin One solution if you want both Web API ( -w) and XML-RPC (-s) to be run at the same time, would be to start 2 glances instances (or systemd services) and use them

Here is an example to make a custom systemd service: https://github.com/nicolargo/glances/wiki/Start-Glances-through-Systemd

RazCrimson commented 1 year ago

Closing this as glances doesn't support both Web API & XMP-RPC at the same time.

Issue for that is tracked here: https://github.com/nicolargo/glances/issues/995