[2019-10-17 17:02:22,992] ERROR in app: Exception on /server_info [GET]
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/jan/Documents/15_iot/balena/active/balena-pulseaudio/pulseaudio-rest-api/app.py", line 33, in getServerInfo
pulsectlObject=pulse.server_info()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pulsectl/pulsectl.py", line 525, in _decorator_or_method
return _wrapper(func_or_self, index)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pulsectl/pulsectl.py", line 512, in _wrapper
pulse_func(self._ctx, *([index, cb, None] if index is not None else [cb, None]))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 119, in __exit__
next(self.gen)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pulsectl/pulsectl.py", line 480, in _pulse_op_cb
while self.connected and self._actions[act_id] is None: self._pulse_iterate()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pulsectl/pulsectl.py", line 470, in _pulse_iterate
with self._pulse_loop() as loop: c.pa.mainloop_iterate(loop, int(block), self._ret)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 112, in __enter__
return next(self.gen)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pulsectl/pulsectl.py", line 454, in _pulse_loop
'Running blocking pulse operations from pulse eventloop callbacks'
pulsectl.pulsectl.PulseError: Running blocking pulse operations from pulse eventloop callbacks or other threads while loop is running is not supported by this python module. Supporting this would require threads or proper asyncio/twisted-like async code. Workaround can be to stop the loop (raise PulseLoopStop in callback or event_loop_stop() from another thread), doing whatever pulse calls synchronously and then resuming event_listen() loop.
127.0.0.1 - - [17/Oct/2019 17:02:22] "GET /sink_list HTTP/1.1" 200 -