sphinxcontrib-drawio icon indicating copy to clipboard operation
sphinxcontrib-drawio copied to clipboard

Xvfb Inifinite Loop

Open jdillard opened this issue 3 years ago • 2 comments

I recently ran into an issue where someone had permission issues with Xvfb and it couldn't start up. It seems this line caused an infinite loop in that case, but it was hard to tell what the issue was at first: https://github.com/modelmat/sphinxcontrib-drawio/blob/1f6d77cf63e6bbe2be7f6d7661f91163fb8e6d62/sphinxcontrib/drawio/init.py#L298-L299

I'm not quite sure the best approach, but do you think it would be a good idea to add a counter in the loop and output a "Xvfb is having difficulty starting" log message if it goes over a generous amount? I also don't know if it's possible (or a good idea) to kill the Sphinx process at the same time.

jdillard avatar Mar 30 '22 00:03 jdillard

Does Xvfb stay running when there is a permission error? The lines above it should be failing it if it fails to start up.

modelmat avatar Mar 30 '22 00:03 modelmat

I'm not sure the best way to tell if Xvfb is running or not (so maybe it was running, but there was a different issue due to permissions). This was the error when just running Xvfb in the CLI:

_XSERVTransmkdir: Mode of /tmp/.X11-unix should be set to 1777
_XSERVTransmkdir: this may cause subsequent errors
_XSERVTransSocketCreateListener: failed to bind listener
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for unix

Setting the permissions of /tmp/.X11-unix to 1777 ended up fixing the issue once I found that out.

jdillard avatar Mar 30 '22 01:03 jdillard