'Manage WF Templates' causes infinite loop

Help
2006-05-19
2012-10-29
  • leo_holmberg

    leo_holmberg - 2006-05-19

    Hi again. We have the same particulars,
    Fedora 2.1.1, Fez 1.2Beta, and graphviz version
    2.6.

    In administrative mode, when trying to manage
    Work Flow Templates,clicking on
    'Create Collection In Selected Community',
    which invokes workflow_states.php, causes
    our system to go into an infinite loop.

    Examing the processes running I see a process
    'dot' running in an infinite loop. This is part
    of graphviz.

    Can you offer any suggestions on how to
    figure out what is going on? After killing the
    process, the 'States Link Diagram' has a missing
    graphic for its link.

    Thanks in advance...

     
    • leo_holmberg

      leo_holmberg - 2006-05-26

      Mathew:

      I took your suggestion, and made the changes in
      workflow_states.php and graphviz.php, and it now
      works fine. Thanks again!

       
    • Matthew Smith

      Matthew Smith - 2006-05-22

      The dot stuff is not really needed, you can configure the workflows without it. It is a convenience for visualising the steps you are creating for the workflow.

      Are you saying though that the actual page won't load until you kill the 'dot' process? You could try echoing out the command that runs dot to see whether it is doign something wierd - see class.graphviz.php and add the line Error_Handler::logError($dot,FILE,LINE); to those function calls. Then look at 'error_handler.log' to see what is being fed to the dot command.

       
      • Christiaan

        Christiaan - 2006-05-22

        Hi Leo,

        Is the 'dot' executable path in the 'PATH' linux environment variable? This is covered in the install instructions that Fez needs that directory to be in the environment PATH variable.

        Cheers,
        Christiaan

         
    • leo_holmberg

      leo_holmberg - 2006-05-24

      Sorry for taking so long getting back.

      1. Yes, the dot executable is in the PATH. I also
        upgraded to the latest version (2.8).

      2. I took Mathew's suggestion, and captured what
        is going on. Starting with "Manage Workflow
        Templates" then clicking on the "Workflow States
        Link" in "Create Collection in Selected
        Communitity" dot is run twice. The first time:

      dot -Tcmapx /tmp/espace_gv_k225Q1

      The contents of /tmp/espace_gv_k225Q1:

      digraph States {
      graph [fontpath="/usr/share/fonts/default/Type1/"];
      rankdir=LR;
      node [color=lightblue, style=filled, fontname=n019003l, fontsize=10];23 [labe
      l="Enter Metadata\n(start)" URL="http://testmatdl.lci.kent.edu/fez/manage/workf
      low_states?cat=edit&wfl_id=5&wfs_id=23" shape=box ]
      ;
      84 [label="Publish\n(end|auto)" URL="http://testmatdl.lci.kent.edu/fez/manage/w
      orkflow_states?cat=edit&wfl_id=5&wfs_id=84" style=bold color="lightgoldenrod1
      " ]
      ;
      85 [label="Submit for Approval\n(end|auto)" URL="http://testmatdl.lci.kent.edu/
      fez/manage/workflow_states?cat=edit&wfl_id=5&wfs_id=85" style=bold color="lig
      htgoldenrod1" ]
      ;
      "23" -> "84";
      "23" -> "85";
      }

      The 2nd time dot is run:

      dot -Tpng /tmp/espace_gv_M5GhZf

      this is what happens:
      Error: /tmp/espace_gv_M5GhZf:6: syntax error near line 6
      ÂÈntext: "23" >>> - <<<
      HÂB

      and dot is in an infinite loop.

      The contents of the tmp file:
      digraph States {
      graph [fontpath="/usr/share/fonts/default/Type1/"];
      rankdir=LR;
      node [color=lightblue, style=filled, fontname=n019003l, fontsize=10];23 [labe
      l="Enter Metadata\n(start)" URL="http://testmatdl.lci.kent.edu/fez/manage/workf
      low_states?cat=edit&wfl_id=5&wfs_id=23" shape=box ]
      ;
      84 [label="Publish\n(end|auto)" URL="http://testmatdl.lci.kent.edu/fez/manage/w
      orkflow_states?cat=edit&wfl_id=5&wfs_id=84" style=bold color="lightgoldenrod1
      " ]
      ;
      85 [label="Submit for Approval\n(end|auto)" URL="http://testmatdl.lci.kent.edu/
      fez/manage/workflow_states?cat=edit&wfl_id=5&wfs_id=85" style=bold color="lig
      htgoldenrod1" ]
      ;
      ÂÈ3" -
      HÂB

      There seems to be some junk at the end following
      the '];'.

       
      • Matthew Smith

        Matthew Smith - 2006-05-24

        Wierd. How do those extra garbage bytes get there?

        The first run with Tcmapx generates the image map XML bit that defines all the clickable boundaries for the nodes on the graph.

        The second run generates the actual png stream to be displayed. The actual dot script should be the same both times, so in the second run, the last few bytes are garbled - should be

        "23" -> "84";
        "23" -> "85";
        }

        instead of the garbled bytes.

        BTW, you can have a play with this using testgraphviz.php in the base dir of fez (I forgot to delete it before we released the software). Cut and paste the dot scripts in to see if the graph is generated ok.

        Anyway, the issue seems to be with the base64_encode step. The map is retrieved directly by the scripts (workflow_states.php:90) where as the call for the png is retrieved through an img tag which causes the browser to retrieve graphviz.php?dot=<encoded_dot_script>. So it seems that base64_encoding and base64_decoding causes the garbled bytes, perhaps the length of the base64_encoded url is the issue.

        Here's something to try:
        in manage/workflow_states.php:89
        instead of the $tpl->assign('encoded_dot... thing, replace it with these lines:

        $dot_id = md5($dot);
        $_SESSION['dot'][$dot_id] = $dot;
        $tpl->assign("encoded_dot", $dot_id);

        Then in webservices/graphviz.php:39 get rid of the base64_decode stuff and use the lines:

        $dot_id = $_GET['dot'];
        $dot = $_SESSION['dot'][$dot_id];

        That way we avoid the long url and also avoid the base64_encode/decode step (not sure which one is the cause of the issue - maybe both).

        Matt

         

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks