Question
I'm trying to get this plugin working on a Windows System. But, I'm getting a "Bad File Descriptor" error in my log file, which looks like this:
Problem executing dot command: 'C:\www\Graphviz2.20\bin\dot C:\www\twiki\working\tmp\DiGraphPluginvS6oKYcNPQ.dot -Tpng -oC:\www\twiki\working\tmp\DGPTXx70z3GfG.png 2> C:\www\twiki\working\tmp\DiGraphPluginvS6oKYcNPQ.dot.err', got:
Bad file descriptor
I've removed the GV_FILE_PATH parameter and added it as a System Environment variable. Also, I can execute this dot command from the DOS prompt without a problem and it generates the png file.
Anyone have any thoughts?
Environment
--
GregJenci - 09 Oct 2008
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
I've done quite a bit of work on this plugin, and have a new trial version attached to the "Dev" topic, but I don't believe it addresses anything in this area. Unfortunately I don't have a windows server available to test on. If you can get any more info on what might be causing the issue I'll be glad to try to fix it.
--
GeorgeClark - 10 Oct 2008
Thanks for your help George, I'm spinning my wheels here. First, I've upgraded to the Development plugin - revision 17468 (31 Aug 2008). In my Topic, I recieve the error:
DirectedGraph Error (9): Problem executing dot command.
when I try to generate the first graph in the twiki.DirectedGraphPlugin example topic (or Plugin on twiki.org). Actually, I just noticed that the graphs aren't being generated on twiki.org, I also get the dot file rendered below "You get (if installed)" with the error message above.
The dot file is correctly generated to C:\www\twiki\working\tmp, but my PNG file is empty. However, I can execute the generated command line from any DOS prompt and it correctly creates the png file. Lastly, I've attached my debug.txt file. I can't tell where it's dying. Is there a place that lists the error codes?
--
GregJenci - 10 Oct 2008
At first glance, everything looks good in the debug.txt file. I'm assuming that the problem is in the file I/O. Twiki.org does not have the plugin installed, so I wouldn't expect that to work. It does work fine under Linux, but none of the code in the last several versions has been tested in Windows.
If debug is enabled, the plugin should leave behind all of the working files in the TWiki temp directory. So you can look at what was generated for input and if "dot" ran, what was generated as output. There is also a separate debug setting in the tools/DirectedGraphPlugin.pl, but in looking at it, it is probably hardcoded for linux file system. That code has been around for a very long time.
--
GeorgeClark - 10 Oct 2008
I have not tried my new version yet, but I've followed the TWiki on windows guide and installed
ActiveState, Apache, TWiki 4.2.3 Graphviz2.21, and configured it up on XP Home on a virtual machine. My DGP config is:
$TWiki::cfg{DirectedGraphPlugin}{enginePath} = 'c:/www/Graphviz2.21/bin/';
$TWiki::cfg{DirectedGraphPlugin}{magickPath} = '/usr/bin/';
$TWiki::cfg{DirectedGraphPlugin}{toolsPath} = 'C:/www/twiki/tools/';
$TWiki::cfg{DirectedGraphPlugin}{perlCmd} = 'C:/Perl/bin/perl.exe';
$TWiki::cfg{Plugins}{DirectedGraphPlugin}{Enabled} = 1;
The Clientside, Usecase, Component Architure and Simple LAN diagrams all fail - but that's expected for me as they are antialiased and require imagemagick to be installed. But the first few worked.
Other changes I made: Rewrite the shebang on tools/DirectedGraphPlugin.pl, enabled debug, updated the log filename in 4 places, and as you reported, removed the env. setting that's in unix format.
#!C:\Perl\bin\perl.exe -w
...
$DEBUG = 1
open( DEBUGFILE, ">>C:/www/twiki/working/tmp/DGP.pl.log" );
...
my $execCmd = "$ARGV[0] $ARGV[2] $ARGV[3] 2> $ARGV[4] ";
I don't have time tonight to install the dev. version and test that but it does appear that the released version will work. I'll work on it a bit more and see if I can figure out how to make this more portable than at present.
--
GeorgeClark - 11 Oct 2008
It took a bit more figuring but I managed to get the released plugin working completely on Windows.
- ImageMagick is required for the anti-aliased diagrams. I had to install the "Static" version - the -dll version was failing due to some windows Visual Studio library issues. I installed
ImageMagick-6.4.4-Q16-windows-static
- GhostScript is required for ImageMagick to convert the postscript files back to png. I Installed gs863w32.
Once this was set up and I was able to manually convert a .ps file to a .png from the command line, all of the attachments were correctly built by the plugin.
--
GeorgeClark - 11 Oct 2008
I've filed
Bugs:Item6058
to track this issue.
--
GeorgeClark - 11 Oct 2008
I've checked in the fixes to
Bugs:Item6058
, and attached test versions of the zip and tgz file to the
TWiki:Plugins.DirectedGraphPluginDev
topic. This version should have some better diagnostics, and not need any manual edits on Windows. Also another issue with /tmp files being left behind on Windows should also be fixed.
--
GeorgeClark - 12 Oct 2008
Thanks for the updates, having all the debugging files in the TMP directory helps out a lot, but I'm still getting an error:
DirectedGraph Error (2):
*DirectedGraphPlugin error:*
Problem executing dot command: 'C:\www\Graphviz2.20\bin\dot C:\www\twiki\working\tmp\DiGraphPluginoaaxFxxkLA.dot -Tpng -oC:\www\twiki\working\tmp\DGPQrUpKHeWUn.png 2> C:\www\twiki\working\tmp\DiGraphPluginoaaxFxxkLA.dot.err ', got:
01: child exited with value 255
02:
03:
I've updated my local installtion with the latest DEV plugin (10/12), the static version of
ImagMagick, and added
GhostScript (gs862w32). Lastly, if I run the above dot command from a DOS prompt, the PNG file is created fine from the DOT file in the working\tmp directory.
--
GregJenci - 15 Oct 2008
I had that too: George explains (at
DirectedGraphPluginError) that error 2 is a bad tools path: do you have forward slashes, and a trailing slash?
--
SeanCMorgan - 15 Oct 2008
Nope, they look Okay to me...
$TWiki::cfg{DirectedGraphPlugin}{enginePath} = 'C:/www/Graphviz2.20/bin/';
$TWiki::cfg{DirectedGraphPlugin}{magickPath} = 'C:/www/ImageMagick-6.4.4-Q16/';
$TWiki::cfg{DirectedGraphPlugin}{toolsPath} = 'C:/www/twiki/tools/';
$TWiki::cfg{DirectedGraphPlugin}{perlCmd} = 'C:/Perl/bin/perl.exe';
$TWiki::cfg{Plugins}{DirectedGraphPlugin}{Enabled} = 1;
BTW, I know putting the application in my www directory isn't advisable, but I'm just trying to get it to run locally before moving it into the server-based production Twiki.
--
GregJenci - 15 Oct 2008
Clean out your tmp directory and rerun the page one more time. There should be some files named "DiGraphPluginRunxxxxxxxx.log This is the log file generated by the tools script itself. And the file DiGraphPluginxxxxxxxx.dot.err is any error output from the dot execution. Not sure what else to look at - see if this adds anything to the puzzle.
If no DiGraphPluginRun... files are created, then something is really wrong with the tools/DirectedGraphPlugin.pl. Try to run that directly with the perl command. It will cause errors about uninitialized variables, and generate a help message.
C:\www\twiki\tools>perl DirectedGraphPlugin.pl
Use of uninitialized value $ARGV[0] in string at DirectedGraphPlugin.pl line 19.
(repeats 5 times)
print() on closed filehandle DEBUGFILE at DirectedGraphPlugin.pl line 37.
print() on closed filehandle DEBUGFILE at DirectedGraphPlugin.pl line 38.
Usage: DirectedGraphPlugin.pl dot_executable working_dir infile iostring errfile logfile
--
GeorgeClark - 16 Oct 2008
Closing this question after more than 30 days of inactivity. Feel free to re-open if needed.
--
PeterThoeny - 10 Dec 2008