mikitex70 / plantuml-markdown

PlantUML plugin for Python-Markdown
BSD 2-Clause "Simplified" License
192 stars 55 forks source link

Remote end closed connection without response #33

Closed shinkoryo closed 4 years ago

shinkoryo commented 4 years ago

I am encounter the following error when I use mkdocs's markdown_extensions. However, I still don't know where the problem is. Can you check it please. Thanks.

error message:

 [E 190911 07:25:26 ioloop:909] Exception in callback <bound method LiveReloadHandler.poll_tasks of <class 'livereload.handlers.LiveReloadHandler'>>
     Traceback (most recent call last):
       File "/usr/local/lib/python3.6/site-packages/tornado/ioloop.py", line 907, in _run
         return self.callback()
       File "/usr/local/lib/python3.6/site-packages/livereload-2.6.1-py3.6.egg/livereload/handlers.py", line 69, in poll_tasks
         filepath, delay = cls.watcher.examine()
       File "/usr/local/lib/python3.6/site-packages/livereload-2.6.1-py3.6.egg/livereload/watcher.py", line 105, in examine
         func()
       File "/usr/local/lib/python3.6/site-packages/mkdocs-1.0.4-py3.6.egg/mkdocs/commands/serve.py", line 114, in builder
         build(config, live_server=live_server, dirty=dirty)
       File "/usr/local/lib/python3.6/site-packages/mkdocs-1.0.4-py3.6.egg/mkdocs/commands/build.py", line 274, in build
         _populate_page(file.page, config, files, dirty)
       File "/usr/local/lib/python3.6/site-packages/mkdocs-1.0.4-py3.6.egg/mkdocs/commands/build.py", line 177, in _populate_page
         page.render(config, files)
       File "/usr/local/lib/python3.6/site-packages/mkdocs-1.0.4-py3.6.egg/mkdocs/structure/pages.py", line 184, in render
         self.content = md.convert(self.markdown)
       File "/usr/local/lib/python3.6/site-packages/Markdown-3.1.1-py3.6.egg/markdown/core.py", line 265, in convert
         self.lines = prep.run(self.lines)
       File "/usr/local/lib/python3.6/site-packages/plantuml_markdown.py", line 115, in run
         text, did_replace = self._replace_block(text)
       File "/usr/local/lib/python3.6/site-packages/plantuml_markdown.py", line 151, in _replace_block
         diagram = self._render_diagram(code, requested_format)
       File "/usr/local/lib/python3.6/site-packages/plantuml_markdown.py", line 214, in _render_diagram
         diagram = self._render_remote_uml_image(code, requested_format)
       File "/usr/local/lib/python3.6/site-packages/plantuml_markdown.py", line 243, in _render_remote_uml_image
         return PlantUML("%s/%s/" % (self.config['server'], img_format)).processes(plantuml_code)
       File "/usr/local/lib/python3.6/site-packages/plantuml.py", line 179, in processes
         response, content = self.http.request(url, **self.request_opts)
       File "/usr/local/lib/python3.6/site-packages/httplib2/__init__.py", line 1953, in request
         cachekey,
       File "/usr/local/lib/python3.6/site-packages/httplib2/__init__.py", line 1618, in _request
         conn, request_uri, method, body, headers
       File "/usr/local/lib/python3.6/site-packages/httplib2/__init__.py", line 1556, in _conn_request
         response = conn.getresponse()
       File "/usr/local/lib/python3.6/http/client.py", line 1331, in getresponse
         try:
       File "/usr/local/lib/python3.6/http/client.py", line 297, in begin
         # read until we get a non-100 response
       File "/usr/local/lib/python3.6/http/client.py", line 266, in _read_status
         # Presumably, the server closed the connection before
     http.client.RemoteDisconnected: Remote end closed connection without response
mikitex70 commented 4 years ago

Have you used a PlantUML server, like http://www.plantuml.com/plantuml ? If this is the case, maybe the plantuml server has closed the connection. Try to connect directly with a browser to see if there is some connection problem. Also check if you are behind a firewall/proxy that may block the outgoing connection.

shinkoryo commented 4 years ago

thanks for your reply.

I am using the server version of plantuml. But I have not found out why such an error occured. I suspect that it may be a connection problem with the proxy or a connection problem with the network. Because I use the docker image of PlantUML server and Material for MkDocs. so, I need to continue to confirm where the settings are having problems.

mikitex70 commented 4 years ago

My tests are working fine. These are my test steps:

cd /tmp
# prepare a virtualenv for testing
mkdir umltest
python -m venv umltest/env
source umltest/env/bin/activate
# install mkdocs and required plugins
pip install mkdocs mkdocs-material plantuml-markdown
# create a new mkdocs project
mkdocs new umltest
cd umltest
# add a simple UML diagram
cat >>docs/index.md <<'EOF'
```uml
A -> B

EOF

configure mkdocs

cat >> mkdocs.yml <<EOF markdown_extensions:

Navigating to http://localhost:8000 show the rendered UML diagram. Check your http proxy configuration.

shinkoryo commented 4 years ago

Thank you very much for your answer. When I delete the proxy settings of the mkdocs server, it works.