Supervisor/supervisor

HTTP/1.1 500 Internal Server Error returned for "http://127.0.0.1:9551/RPC2".

Closed this issue · 9 comments

2024-02-29 21:13:18,096 DEBG fd 9 closed, stopped monitoring <POutputDispatcher at 140343553258320 for <Subprocess at 140343556830224 with name php-fpm in state STOPPING> (stderr)>
2024-02-29T21:13:18.102407046Z 2024-02-29 21:13:18,096 INFO stopped: php-fpm (exit status 0)
2024-02-29T21:13:18.107026294Z 2024-02-29 21:13:18,096 DEBG received SIGCHLD indicating a child quit
2024-02-29T21:14:29.936922163Z 2024-02-29 21:14:29,936 CRIT Handling XML-RPC request with data '\nsupervisor.stopProcessnamephp-fpm:php-fpmwait1\n' raised an unexpected exception: Traceback (most recent call last):
2024-02-29T21:14:29.937053386Z File "/usr/lib/python3.11/site-packages/supervisor/xmlrpc.py", line 410, in continue_request
2024-02-29T21:14:29.937067088Z value = self.call(method, params)
2024-02-29T21:14:29.937221676Z ^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-29T21:14:29.938532266Z File "/usr/lib/python3.11/site-packages/supervisor/xmlrpc.py", line 446, in call
2024-02-29T21:14:29.942304543Z return traverse(self.rpcinterface, method, params)
2024-02-29T21:14:29.947793429Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-29T21:14:29.952036358Z File "/usr/lib/python3.11/site-packages/supervisor/xmlrpc.py", line 469, in traverse
2024-02-29T21:14:29.956913387Z return func(*params)
2024-02-29T21:14:29.960603970Z ^^^^^^^^^^^^^
2024-02-29T21:14:29.964021784Z File "/usr/lib/python3.11/site-packages/supervisor/rpcinterface.py", line 405, in stopProcess
2024-02-29T21:14:29.967590583Z group, process = self._getGroupAndProcess(name)
2024-02-29T21:14:29.971473395Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-29T21:14:29.975135931Z File "/usr/lib/python3.11/site-packages/supervisor/rpcinterface.py", line 262, in _getGroupAndProcess
2024-02-29T21:14:29.979496402Z group_name, process_name = split_namespec(name)
2024-02-29T21:14:29.984002905Z ^^^^^^^^^^^^^^^^^^^^
2024-02-29T21:14:29.988220673Z File "/usr/lib/python3.11/site-packages/supervisor/options.py", line 2232, in split_namespec
2024-02-29T21:14:29.992056253Z names = namespec.split(':', 1)
2024-02-29T21:14:29.995667572Z ^^^^^^^^^^^^^^
2024-02-29T21:14:29.999032439Z AttributeError: 'dict' object has no attribute 'split'

Input:

<?xml version="1.0"?>
<methodCall><methodName>supervisor.stopProcess</methodName><params><param><value><struct><member><name>name</name><value><string>php-fpm:php-fpm</string></value></member><member><name>wait</name><value><boolean>1</boolean></value></member></struct></value></param></params></methodCall>

I formatted the string according to the xml rpc but got an error

<?xml version="1.0"?>
<methodCall>
<methodName>supervisor.stopProcess</methodName>
<params>
    <param>
        <value>
            <struct>
                <member>
                    <name>name</name>
                    <value><string>php-fpm:php-fpm</string></value>
                </member>
                <member>
                    <name>wait</name>
                    <value><boolean>1</boolean></value>
                </member>
            </struct>
        </value>
    </param>
</params>
</methodCall>

Works with

<?xml version="1.0"?>
<methodCall><methodName>supervisor.stopProcess</methodName><params><name>php-fpm:php-fpm</name><wait>1</wait></params></methodCall>

In general supervisor does not support encoding it seems, bug...

The issue is solved, in general XML RPC is a BULLSHIT!!!! And supervisor implements it in its own way, it accepts according to wrong structure.

Expected
params

  • param
    -- value
    --- struct
    ---- ...

Actually
params:

  • struct

In general, the main thing is not to be mistaken in the arguments :0

That's roughly the structure right now

params:

  • string
    --- ...
  • struct
    --- ...

You can also use this

params:
<key_name>value</key_name>.
struct ...

The issue is solved

Closing since the issue is solved.