Complex workflow for procurement causes pydot error

Bug #405962 reported by Don Kirkby on 2009-07-28
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Medium
OpenERP's Framework R&D
5.0
Invalid
Medium
Unassigned

Bug Description

I'm running OpenERP version 5.0.1 on Ubuntu 8.10.

I select a procurement order in the desktop client and from the Plugins menu, I choose Execute a plugin. I double click Print Workflow (Complex). I quickly get a blank page. When I check the server output, I see this:

[2009-07-28 11:59:01,045] ERROR:workflow:[01]: Exception in call: Traceback (most recent call last):
[2009-07-28 11:59:01,047] ERROR:workflow:[02]: File "/home/don/workspace/openerp-server-5.0.1/addons/base/ir/workflow/print_instance.py", line 150, in __init__
[2009-07-28 11:59:01,047] ERROR:workflow:[03]: ps_string = graph.create(prog='dot', format='ps')
[2009-07-28 11:59:01,047] ERROR:workflow:[04]: File "/var/lib/python-support/python2.5/pydot.py", line 1796, in create
[2009-07-28 11:59:01,048] ERROR:workflow:[05]: status, stderr_output) )
[2009-07-28 11:59:01,048] ERROR:workflow:[06]: InvocationException: Program terminated with status: -6. stderr follows: dot: mincross.c:835: install_in_rank: Assertion `(g)->u.rank[r].n <= (g)->u.rank[r].an' failed.

I've tried several procurement orders in different states, and they all cause the same error. I've tried the basic Print Workflow, and it works. I've tried the complex workflow on a production order, and it works.

Related branches

Don Kirkby (donkirkby) on 2009-07-28
tags: added: workflow

Hello Don,

We checked on several computers, but did not get such an error.But yes, its a blank page.

Which pydot version do you use? We use 0.9.10-2.

Thanks.

Error occurs with 8.10, not 8.04.

Changed in openobject-addons:
status: New → Confirmed
affects: openobject-addons → openobject-server
Don Kirkby (donkirkby) wrote :

I have python-pydot 1.0.2-1.

Changed in openobject-server:
assignee: nobody → gpa(tiny) (gpa-openerp)
status: Confirmed → In Progress
Changed in openobject-server:
assignee: gpa(tiny) (gpa-openerp) → nobody
status: In Progress → Confirmed
importance: Undecided → Critical
Changed in openobject-server:
importance: Critical → Medium

Reproduced on Ubtuntu 9.04 and 9.10 as well, both with Python 2.5 and 2.6, with pydot 1.0.2.

See the Graphviz bug reports, that do not seem to be getting any attention:
  - http://www.graphviz.org/bugs/b1258.html
  - http://www.graphviz.org/bugs/b1666.html

FWIW, line number in mincross.c differs in my trace:

 File "/home/olivier/openerp/server/bin/addons/base/ir/workflow/print_instance.py", line 150, in __init__
   ps_string = graph.create(prog='dot', format='ps')
 File "/var/lib/python-support/python2.6/pydot.py", line 1796, in create
   status, stderr_output) )
 InvocationException: Program terminated with status: -6. stderr follows: dot: mincross.c:846: install_in_rank: Assertion `(g)->u.rank[r].n <= (g)->u.rank[r].an' failed.

mrshelly (mrshelly) wrote :

I found the code of tools/misc.py

@function def exec_command_pipe(name, *args):

return os.popen2(cmd, 'b')

and I found the follow code in addons/base/ir/workflow/print_instance.py

        input, output = tools.exec_command_pipe(*args) #here ref:http://docs.python.org/library/popen2.html
        input.write(ps_string)
        input.close()
        self.result = output.read()
        output.close()

@ python manual says: 1st parameter is stdout, 2nd parameter is stdin.

Is it a bug?

and I try test.py @WinXP v5.0.6

import os

cmd = r'ps2pdf.bat - -'
(output, input) = os.popen2(cmd, 'b')

fp = file('test.ps', 'r')
fpContent = ''.join(fp.readlines())
fp.close()

input.write(fpContent+'\n')
input.close()
result = output.read()
output.close()
print result

I catch a exception:

Traceback (most recent call last):
  File "test.py", line 10, in <module>
    input.write(fpContent+'\n')
IOError: [Errno 9] Bad file descriptor

and what's the value of input after the assignation ?

thanks

Download full text (3.3 KiB)

dot test.dot -Tpng test.png

stephane@mbp:~$ dot test.dot -Tpng test.png -v
Activated plugin library: libgvplugin_pango.so.5
Using textlayout: textlayout:cairo
Activated plugin library: libgvplugin_dot_layout.so.5
Using layout: dot:dot_layout
Using render: cairo:cairo
Using device: png:cairo:cairo
The plugin configuration file:
 /usr/lib/graphviz/config4
  was successfully loaded.
    render : cairo dot fig gd map ps svg tk vml vrml xdot
    layout : circo dot fdp neato nop nop1 nop2 twopi
    textlayout : textlayout
    device : canon cmap cmapx cmapx_np dia dot eps fig gd gd2 gif hpgl imap imap_np ismap jpe jpeg jpg mif mp pcl pdf pic plain plain-ext png ps ps2 svg svgz tk vml vmlz vrml vtx wbmp xdot xlib
    loadimage : (lib) gd gd2 gif jpe jpeg jpg png ps svg
fontname: "Times-Roman" resolved to: (ps) "DejaVu Sans 15.9990234375"
network simplex: 6 nodes 8 edges 0 iter 0.00 sec
network simplex: 11 nodes 15 edges 0 iter 0.00 sec
network simplex: 7 nodes 14 edges 0 iter 0.00 sec
network simplex: 14 nodes 19 edges 1 iter 0.00 sec
network simplex: 23 nodes 39 edges 5 iter 0.00 sec
mincross: pass 0 iter 0 trying 0 cur_cross 2029 best_cross 2029
mincross: pass 0 iter 1 trying 1 cur_cross 6007 best_cross 2029
mincross: pass 0 iter 2 trying 2 cur_cross 7020 best_cross 2029
mincross: pass 0 iter 3 trying 3 cur_cross 8012 best_cross 2029
mincross: pass 1 iter 0 trying 0 cur_cross 12031 best_cross 2029
mincross: pass 1 iter 1 trying 1 cur_cross 5009 best_cross 2029
mincross: pass 1 iter 2 trying 2 cur_cross 7016 best_cross 2029
mincross: pass 1 iter 3 trying 3 cur_cross 5008 best_cross 2029
mincross: pass 2 iter 0 trying 0 cur_cross 2029 best_cross 2029
mincross: pass 2 iter 1 trying 1 cur_cross 6007 best_cross 2029
mincross: pass 2 iter 2 trying 2 cur_cross 7020 best_cross 2029
mincross: pass 2 iter 3 trying 3 cur_cross 8012 best_cross 2029
mincross: pass 2 iter 4 trying 4 cur_cross 7012 best_cross 2029
mincross: pass 2 iter 5 trying 5 cur_cross 3016 best_cross 2029
mincross: pass 2 iter 6 trying 6 cur_cross 9016 best_cross 2029
mincross: pass 2 iter 7 trying 7 cur_cross 5009 best_cross 2029
mincross: pass 2 iter 8 trying 8 cur_cross 1002013 best_cross 2029
merge2: graph G, rank 9 has only 8 < 9 nodes
merge2: graph G, rank 10 has only 8 < 9 nodes
merge2: graph G, rank 11 has only 9 < 11 nodes
merge2: graph G, rank 12 has only 9 < 11 nodes
merge2: graph G, rank 13 has only 10 < 16 nodes
merge2: graph G, rank 14 has only 9 < 15 nodes
merge2: graph G, rank 15 has only 9 < 22 nodes
merge2: graph G, rank 16 has only 9 < 21 nodes
merge2: graph G, rank 17 has only 9 < 34 nodes
merge2: graph G, rank 18 has only 9 < 29 nodes
merge2: graph G, rank 19 has only 9 < 37 nodes
merge2: graph G, rank 20 has only 9 < 21 nodes
merge2: graph G, rank 21 has only 10 < 23 nodes
merge2: graph G, rank 22 has only 10 < 21 nodes
merge2: graph G, rank 23 has only 11 < 22 nodes
merge2: graph G, rank 24 has only 11 < 17 nodes
merge2: graph G, rank 25 has only 11 < 19 nodes
merge2: graph G, rank 26 has only 10 < 19 nodes
merge2: graph G, rank 27 has only 10 < 22 nodes
merge2: graph G, rank 28 has only 9 < 13 nodes
merge2: graph G, rank 29 has only 13 < 15 nodes
merge2: gra...

Read more...

Duplicate of itself.

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
Vo Minh Thu (thu) wrote :

A fix is available in the branch https://code.launchpad.net/~openerp-dev/openobject-server/6.0-bug-405962-pydot-error-vmt
It will be merged in trunk soon.

As Olivier pointed out, the problem was indeed that we rendered subflows multiple times (as graphviz clusters, and inside different other clusters) when they occured multiple times. The fix renders completely each sublow only once and create a green node specifying the name of the sublfow when it would be otherwise repeated.

Changed in openobject-server:
status: Confirmed → Fix Committed
Vo Minh Thu (thu) wrote :
Vo Minh Thu (thu) wrote :

The fix to correct this behavior has been merged in trunk at revision 3361.

Changed in openobject-server:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments