Fireworks 1.05 and Pymongo "Cursor" bug

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
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.

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

···

On Mon, Jun 1, 2015 at 4:37 PM, [email protected] wrote:

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
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.

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 [email protected].

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.

(this should be completed in FWS v1.07)

···

On Tuesday, June 2, 2015 at 9:15:58 AM UTC-7, Anubhav Jain wrote:

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

On Mon, Jun 1, 2015 at 4:37 PM, [email protected] wrote:

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
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.

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 [email protected].

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.