Fireworks 1.05 and Pymongo "Cursor" bug

53 views
Skip to first unread message

sman...@lbl.gov

unread,
Jun 1, 2015, 7:37:09 PM6/1/15
to firewo...@googlegroups.com
After some recent maintenance, Edison was upgraded to Fireworks version 1.05 recently (you may need to run "module avail fireworks" to load this recent update). Utilizing the "lpad get_wflows" command from the Edison login nodes, I received the following error traceback:

Exception AttributeError: "'Cursor' object has no attribute '_Cursor__id'" in <bound method Cursor.__del__ of <pymongo.cursor.Cursor object at 0x2aaab1835610>> ignored
Traceback (most recent call last):
 
File "/usr/common/usg/python/fireworks/1.05-2.7.9/bin/lpad", line 6, in <module>
    lpad
()
 
File "/usr/common/usg/python/fireworks/1.05-2.7.9/lib/python2.7/site-packages/fireworks/scripts/lpad_run.py", line 876, in lpad
    args
.func(args)
 
File "/usr/common/usg/python/fireworks/1.05-2.7.9/lib/python2.7/site-packages/fireworks/scripts/lpad_run.py", line 250, in get_wfs
    d
= lp.get_wf_summary_dict(i, args.display_format)
 
File "/usr/common/usg/python/fireworks/1.05-2.7.9/lib/python2.7/site-packages/fireworks/core/launchpad.py", line 376, in get_wf_summary_dict
    wf
= self.workflows.find_one({"nodes": fw_id}, fields=wf_fields)
 
File "/usr/common/usg/python/fireworks/1.05-2.7.9/lib/python2.7/site-packages/pymongo/collection.py", line 796, in find_one
   
*args, **kwargs).max_time_ms(max_time_ms)
 
File "/usr/common/usg/python/fireworks/1.05-2.7.9/lib/python2.7/site-packages/pymongo/collection.py", line 929, in find
   
return Cursor(self, *args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'fields'


Looking more into the TypeError, it looks like there is a 'fields' attribute used in line 376 of the launchpad.py code: wf = self.workflows.find_one({"nodes": fw_id}, fields=wf_fields)

Looking at the pymongo's collection.py code (/usr/common/usg/python/fireworks/1.05-2.7.9/lib/python2.7/site-packages/pymongo/collection.py) within the "find" function, I noticed the following changelog entry on line 899:

 .. versionchanged:: 3.0
           
Changed the parameter names `spec`, `fields`, `timeout`, and
           
`partial` to `filter`, `projection`, `no_cursor_timeout`, and
           
`allow_partial_results` respectively.
...

It looks like the "fields" attribute has been depreciated in the find() function but the launchpad code has not been updated to reflect this. Hence, the "fields" attribute is being passed to the Cursor construction through *args and causing an error.

Hopefully this helps in highlighting the issue and a possible cause. I suspect the '_Cursor_id' error may have similar roots, although I have not delved into that issue. Let me know if you need any more info regarding this issue. I will note that I am using python 2.7.9.

Anubhav Jain

unread,
Jun 2, 2015, 12:15:58 PM6/2/15
to Sahit Mandala, firewo...@googlegroups.com
Hi,

This has to do with API changes for the most recent pymongo. I will need to update FWS so that it is compatible with the most recent pymongo version; I hope to do this later today.

Best,
Anubhav

--
You received this message because you are subscribed to the Google Groups "fireworkflows" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fireworkflow...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fireworkflows/cabc78c7-1868-42d0-a0ee-aab9418a0842%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anubhav Jain

unread,
Jun 3, 2015, 1:15:28 PM6/3/15
to firewo...@googlegroups.com, aj...@lbl.gov, sman...@lbl.gov, aj...@lbl.gov
(this should be completed in FWS v1.07)
To unsubscribe from this group and stop receiving emails from it, send an email to fireworkflows+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages