evandrocoan / PlantUmlDiagrams

A fork from https://github.com/jvantuyl/sublime_diagram_plugin package for Sublime Text, to render diagrams in your source code
Other
37 stars 10 forks source link

Error 400 when using local server #6

Open francislavoie opened 6 years ago

francislavoie commented 6 years ago
15:51:21:038.284302 1.48e+02 - PlantUmlDiagrams.diagram.plantuml.generate:101 - Failed to connect to the server: HTTP Error 400: Bad Request (http://localhost:8181/) Falling back to local rendering...

Ran it with docker like this: docker run --rm -p 8181:8080 plantuml/plantuml-server:jetty

Still getting the TypeError from #2 but I don't think it's relevant here.

evandrocoan commented 6 years ago

Sorry, I never had used docker. I just tested with my local server and worked.

I looked into their page and I saw this:

docker run -d -p 8080:8080 plantuml/plantuml-server:jetty

I do not know what are these 8080:8080, perhaps you can try to use 8181:8181 instead of 8181:8080, or just use 8080:8080 and set the local URL on your .sublime-settings to:

    "plantuml_server": "http://localhost:8080/plantuml/"

Or:

    "plantuml_server": "http://localhost:8181/plantuml/"

Or:

    "plantuml_server": "http://localhost:8080/"

Or:

    "plantuml_server": "http://localhost:8181/"
francislavoie commented 6 years ago

So in Docker, -p 8181:8080 means bind to port 8181 on the host machine and map it to 8080 in the container. I did this because I'm using 8080 for other stuff already. Very sure that's not the issue.

I'm thinking it might be an issue because I use an !include ../theme.puml?

francislavoie commented 6 years ago

Ah, yep, that's the issue. That's a bummer.

Got this error in the docker logs. Didn't look there before.

Preprocessor Error: Cannot include /var/lib/jetty/./../theme.puml
Preprocessor Error: Cannot include /var/lib/theme.puml

Idea - this lib could parse the file for an include and just copy the contents of that file in before sending it to the server? That would be great :smile: