How do I troubleshoot a IOException: The pipe has been ended

0 votes
asked Oct 10 in Question / help by asuser (140 points)
edited Oct 10 by asuser

Using Android Studio (2024.2.1)  PlantUML plugin, I generated a call diagram `MyClass_2_keyMethod_calls.puml`.

An attempt to display that file in Android Studio, results in error `GraphViz has crashed`, without any further information.

So, I downloaded `plantuml.jar` from https://sourceforge.net/projects/plantuml/ and attempted to run:

java -jar plantuml.jar MyClass_2_keyMethod_calls.puml

which resulted in:


java.io.IOException: The pipe has been ended
        at java.base/java.io.FileOutputStream.writeBytes(Native Method)
        at java.base/java.io.FileOutputStream.write(Unknown Source)
        at java.base/java.io.BufferedOutputStream.implWrite(Unknown Source)
        at java.base/java.io.BufferedOutputStream.write(Unknown Source)
        at java.base/java.io.FilterOutputStream.write(Unknown Source)
        at net.sourceforge.plantuml.dot.ProcessRunner$MainThread.startThreads(ProcessRunner.java:181)
        at net.sourceforge.plantuml.dot.ProcessRunner$MainThread.runJob(ProcessRunner.java:121)
        at net.sourceforge.plantuml.api.TimeoutExecutor$MyThread.run(TimeoutExecutor.java:77)


I did take care of running it in cmd terminal in admin mode as suggested in https://forum.plantuml.net/11828/for-some-reason-dot-graphviz-has-crashed?show=11894#a11894

I don't know what I am doing wrong that prevents me from displaying the PUML file successfully. I would appreciate your help in regard to known limitations or incompatibility with files generated by the PlantUML plugin for IntelliJ IDEA and Android Studio.

I highlighted "known limitations" because when running it on a 5KB `.puml` file, it works great. It fails, however, on the aforementioned MyClass_2_keyMethod_calls.puml, which is 51KB in size.

Is there a .puml validator tool?


My config:

java -Djava.awt.headless=true -jar plantuml.jar  -version
PlantUML version 1.2023.7 (Fri May 12 20:23:42 IDT 2023)
(GPLV2 source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: US

PLANTUML_LIMIT_SIZE: 4096

Dot version: dot - graphviz version 2.44.1 (20200629.0846)
Installation seems OK. File generation OK
 

commented Oct 10 by The-Lu (73,540 points)

Hi A.,

First:

Regards,
Th.

commented Oct 10 by asuser (140 points)
edited Oct 10 by asuser

Thank you @The-Lu. I just downloaded the latest plantuml-1.2024.7.jar and tried it. The good news is that it still works great with the 5KB and 16KB .puml files that Android Studio's PlantUML plugin generated.

With the 51KB .puml file (generated in the same run as the other two), however, it still errs with:

java.io.IOException: The pipe has been ended
        at java.base/java.io.FileOutputStream.writeBytes(Native Method)
        at java.base/java.io.FileOutputStream.write(Unknown Source)
        at java.base/java.io.BufferedOutputStream.implWrite(Unknown Source)
        at java.base/java.io.BufferedOutputStream.write(Unknown Source)
        at java.base/java.io.FilterOutputStream.write(Unknown Source)
        at net.sourceforge.plantuml.dot.ProcessRunner.run(ProcessRunner.java:75)
        at net.sourceforge.plantuml.dot.ProcessRunner.run(ProcessRunner.java:59)
        at net.sourceforge.plantuml.dot.AbstractGraphviz.createFile3(AbstractGraphviz.java:112)
        at net.sourceforge.plantuml.directdot.PSystemDot.exportDiagramNow(PSystemDot.java:83)
        at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:207)
        at net.sourceforge.plantuml.PSystemUtils.exportDiagramsDefault(PSystemUtils.java:207)
        at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(PSystemUtils.java:96)
        at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(SourceFileReaderAbstract.java:190)
        at net.sourceforge.plantuml.Run.manageFileInternal(Run.java:510)
        at net.sourceforge.plantuml.Run.processArgs(Run.java:404)
        at net.sourceforge.plantuml.Run.manageAllFiles(Run.java:371)
        at net.sourceforge.plantuml.Run.main(Run.java:206)

I figured out a way to run `java  -DPLANTUML_LIMIT_SIZE=8192   -jar plantuml-1.2024.7.jar -verbose <file.puml>`.

I am exploring my Graphviz installation and report once ready.

commented Oct 10 by The-Lu (73,540 points)

Hi A.,

You can read:
- https://plantuml.com/starting
- https://plantuml.com/graphviz-dot

And:

- What is 'Android Studio (2024.2.1)  PlantUML plugin' ?

If that can help,

Regards,
Th.

commented Oct 10 by asuser (140 points)
edited Oct 13 by asuser

Thanks again @The-Lu. I am going to study this a bit because I discovered numerous copies of plantuml jars on my system and I need to figure out which one is being used by the plugin.

The Android Studio PlantUML plugin is the one described here: https://plugins.jetbrains.com/plugin/15991-plantuml-diagram-generator

So I downloaded the latest plantuml version (plantuml-1.2024.7.jar). It includes a pretty old dot version:

java -jar plantuml-1.2024.7.jar -testdot
Dot version: dot - graphviz version 2.44.1 (20200629.0846)
Installation seems OK. File generation OK

I then downloaded the latest graphviz from graphviz.org and directed the GRAPHVIZ_DOT environment variable to it:

GRAPHVIZ_DOT=C:\Graphviz-12.1.2-win64\bin\dot.exe

and now:

java -jar plantuml-1.2024.7.jar -testdot
Dot version: dot - graphviz version 12.1.2 (20240928.0832)
Installation seems OK. File generation OK


But even with the latest version I am still getting the pipe error:


java -DPLANTUML_LIMIT_SIZE=65536 -jar plantuml-1.2024.7.jar -verbose MyClass_2_keyMethod_calls.puml
(0.001 - 256 Mo) 248 Mo - SecurityProfile LEGACY
(0.020 - 256 Mo) 248 Mo - PlantUML Version 1.2024.7
(0.020 - 256 Mo) 248 Mo - GraphicsEnvironment.isHeadless() false
(0.021 - 256 Mo) 248 Mo - Forcing resource load on OpenJdk
(0.293 - 256 Mo) 236 Mo - Found 1 files
(0.294 - 256 Mo) 236 Mo - Working on MyClass_2_keyMethod_calls.puml
(0.327 - 256 Mo) 235 Mo - Using default charset
(0.332 - 256 Mo) 235 Mo - Reading from MyClass_2_keyMethod_calls.puml
(0.361 - 256 Mo) 248 Mo - ...text loaded...
(0.415 - 256 Mo) 238 Mo - Setting current dir: C:\graphviz_lite_6.0.1_win32\.
(0.415 - 256 Mo) 238 Mo - Setting current dir: C:\graphviz_lite_6.0.1_win32
(0.416 - 256 Mo) 238 Mo - Reading file: MyClass_2_keyMethod_calls.puml
(0.453 - 256 Mo) 235 Mo - ..compiling diagram...
(0.627 - 256 Mo) 218 Mo - ...parsing ok...
(0.627 - 256 Mo) 218 Mo - Compilation duration 174
(0.628 - 256 Mo) 218 Mo - Creating file: C:\graphviz_lite_6.0.1_win32\MyClass_2_keyMethod_calls.puml.png
(0.630 - 256 Mo) 218 Mo - Starting Graphviz process [C:\Graphviz-12.1.2-win64\bin\dot.exe, -Tpng]
(0.630 - 256 Mo) 218 Mo - DotString size: 48331
java.io.IOException: The pipe has been ended
        at java.base/java.io.FileOutputStream.writeBytes(Native Method)
        at java.base/java.io.FileOutputStream.write(Unknown Source)
        at java.base/java.io.BufferedOutputStream.implWrite(Unknown Source)
        at java.base/java.io.BufferedOutputStream.write(Unknown Source)
        at java.base/java.io.FilterOutputStream.write(Unknown Source)
        at net.sourceforge.plantuml.dot.ProcessRunner.run(ProcessRunner.java:75)
        at net.sourceforge.plantuml.dot.ProcessRunner.run(ProcessRunner.java:59)
        at net.sourceforge.plantuml.dot.AbstractGraphviz.createFile3(AbstractGraphviz.java:112)
        at net.sourceforge.plantuml.directdot.PSystemDot.exportDiagramNow(PSystemDot.java:83)
        at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:207)
        at net.sourceforge.plantuml.PSystemUtils.exportDiagramsDefault(PSystemUtils.java:207)
        at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(PSystemUtils.java:96)
        at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(SourceFileReaderAbstract.java:190)
        at net.sourceforge.plantuml.Run.manageFileInternal(Run.java:510)
        at net.sourceforge.plantuml.Run.processArgs(Run.java:404)
        at net.sourceforge.plantuml.Run.manageAllFiles(Run.java:371)
        at net.sourceforge.plantuml.Run.main(Run.java:206)
(0.675 - 256 Mo) 217 Mo - Ending process ok
(0.677 - 256 Mo) 217 Mo - Ending Graphviz process
(0.843 - 256 Mo) 206 Mo - ...image drawing...
(0.844 - 256 Mo) 206 Mo - Creating image 153x21
(0.950 - 256 Mo) 203 Mo - Number of image(s): 1

It looks like the problem is the .puml file . How do I troubleshoot it?

commented Oct 13 by The-Lu (73,540 points)

Hello A.,

Perhaps can you send us your .puml file?

And if there are sensitive date, could you use `-cipher`?

See: 

Regards,
Th.

commented Oct 14 by The-Lu (73,540 points)

Hi A.,

If your file is too big, You can send your anonymized file to the main maintener:

  • gmail account of plantuml

Or create an issue on:

Regards,

Th.

commented Oct 15 by asuser (140 points)
I just replied to your email with the file as attachment. Sorry for delay, I got the COVID. ¯\_(ツ)_/¯
commented Oct 15 by The-Lu (73,540 points)

Hello A.,

Unfortunately the anonymizer anonymizes a little too much...
So the file is unfortunately unreadable. It generates a syntax error.

Also would you have a minimal anonymized file that would allow to test the pipe error?

Get well soon and Take care.

Regards,
Th.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...