NSLS-II / Bug-Reports

Unified issue-tracker for bugs in the data acquisition, management, and analysis software at NSLS-II
BSD 3-Clause "New" or "Revised" License
2 stars 5 forks source link

PostPlan breaks #204

Open pelliciari opened 4 years ago

pelliciari commented 4 years ago

Hi All, The postplan gives us this error

+-----------+------------+ | seq_num | time | +-----------+------------+ /opt/conda_envs/collection-2020-1.0rc1/lib/python3.7/site-packages/databroker/assets/core.py:155: UserWarning: Ignoring attempt to insert Resource with duplicate uid, assuming that both ophyd and bluesky attempted to insert this document. Remove the Registry (reg parameter) from your ophyd instance to remove this warning. warnings.warn("Ignoring attempt to insert Resource with duplicate " | 1 | 15:50:48.2 | +-----------+------------+ generator count ['29ea576a'] (scan num: 93637) End-of-run baseline readings: +--------------------------------+--------------------------------+ | ring_curr | 399.13759941971904 | | gc_tcg_pressure | 0.001 | | epu1_gap_readback | 21.9477 | | epu1_phase_readback | 28.4999 | | feslt_hc_readback | -0.03978000000000015 | | feslt_vc_readback | -0.1999900000000001 | | feslt_hg_readback | 1.9997200000000004 | | feslt_vg_readback | 1.9999000000000002 | | m1_x | 0.50055 | | m1_pit | 1797.3085 | | m1_rol | 3911.4801 | | pgm_cff | 3.9406000000000003 | | pgm_en | 530.0 | | pgm_grx | 61.0 | | pgm_m2pit | 87.21760733549651 | | pgm_grpit | 85.56069670742103 | | pgm_m3slt_hs | -37.802185 | | pgm_m3slt_ha | -17.2005625 | | m3slt_hg | -17.2006 | | m3slt_hc | -46.4028 | | m3slt_vg | -3853.2999 | | m3slt_vc | -1926.6489000000001 | | m3slt_hs | -37.802185 | | m3slt_ha | -17.2005625 | | m3slt_vs | 0.000635 | | m3slt_va | -3853.2998562499997 | | m3diag_y | -1.000521875 | | m3_x | 1.0 | | m3_y | 0.0 | | m3_z | 1.0 | | m3_yaw | -0.5 | | m3_pit | -0.7546950000000001 | | m3_rol | 0.14500000000000002 | | extslt_hg | 149.9977 | | extslt_vg | 10.9994 | | extslt_hc | -5.3574 | | gcdiag_y | -0.9999265625 | | m4_diag1 | -0.9999265625 | | m4slt_hg | 7.000699999999999 | | m4slt_hc | -1.8001999999999998 | | m4slt_vg | 1.9996 | | m4slt_vc | -0.19740000000000002 | | m4slt_inb | 5.79945 | | m4slt_out | 0.20025 | | m4slt_bot | -1.1971499999999993 | | m4slt_top | 0.8024500000000003 | | m4_x | 0.2601 | | m4_y | 94.95 | | m4_z | -5.550000000000001 | | m4_yaw | -0.70735 | | m4_pit | -4.104500000000001 | | m4_rol | -0.16425 | | cryo_x | 19.08670000000029 | | cryo_y | 58.99655000000007 | | cryo_z | 12.150000000000091 | | cryo_t | 30.00019448179998 | | stemp_ctrl1_readback | 110.0 | | stemp_ctrl2_readback | 300.0 | | ow | -9.930346093490016 | | m5_x | -0.37 | | m5_y | 0.0 | | m5_z | -0.4 | | m5_yaw | 0.0 | | m5_pit | 380.0 | | m5_rol | -1000.0 | | m5mask_y | 21.0 | | m6_msk | 89.0 | | m6_z | 105.99980000000001 | | m6_pit | 1.4320986789199999 | | espgm_m7pit | 6.470238935239999 | | espgm_grpit | 7.62262933172 | | espgmmask_y | 0.0 | | oc_y | 0.0 | | oc_z | 5.054700000000025 | | oc_roll | 0.0 | | oc_twoth | 149.97916024740002 | | oc_wlin | -1.1435500000000047 | | oc_wlot | -1.1432499999999663 | | dcslt_hg | 0.0 | | dcslt_hc | 0.0 | | dcslt_vg | 0.0 | | dcslt_vc | 0.0 | | dcslt_inb | 18.001 | | dcslt_out | 47.0 | | dcslt_bot | 13.501000000000001 | | dcslt_top | 15.999999999999996 | | dc_z | 225.49920000000003 | | dc_twoth | 149.35360505650002 | +--------------------------------+--------------------------------+

gvbt1 close 140606916789968

RedundantStaging Traceback (most recent call last) ~/science_comm/00-user_info.py in ----> 1 RE(rixs_one_energy_1(2,30,1,530,11,'test'))

~/src/bluesky/bluesky/run_engine.py in call(self, *args, **metadata_kw) 790 self._task_fut.add_done_callback(set_blocking_event) 791 --> 792 self._resume_task(init_func=_build_task) 793 794 if self._interrupted:

~/src/bluesky/bluesky/run_engine.py in _resume_task(self, init_func) 914 if (exc is not None 915 and not isinstance(exc, _RunEnginePanic)): --> 916 raise exc 917 918 def install_suspender(self, suspender):

~/src/bluesky/bluesky/run_engine.py in _run(self) 1481 exit_reason = str(err) 1482 self.log.exception("Run aborted") -> 1483 raise err 1484 finally: 1485 if not exit_reason:

~/src/bluesky/bluesky/run_engine.py in _run(self) 1348 else: 1349 try: -> 1350 msg = self._plan_stack[-1].send(resp) 1351 # We have exhausted the top generator 1352 except StopIteration:

~/src/bluesky/bluesky/preprocessors.py in call(self, plan) 1305 plan = monitor_during_wrapper(plan, self.monitors) 1306 plan = baseline_wrapper(plan, self.baseline) -> 1307 return (yield from plan) 1308 1309

~/src/bluesky/bluesky/preprocessors.py in baseline_wrapper(plan, devices, name) 1160 return (yield from plan) 1161 else: -> 1162 return (yield from plan_mutator(plan, insert_baseline)) 1163 1164

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 168 continue 169 else: --> 170 raise ex 171 # if inserting / mutating, put new generator on the stack 172 # and replace the current msg with the first element from the

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 121 ret = result_stack.pop() 122 try: --> 123 msg = plan_stack[-1].send(ret) 124 except StopIteration as e: 125 # discard the exhausted generator

~/src/bluesky/bluesky/preprocessors.py in monitor_during_wrapper(plan, signals) 801 plan1 = plan_mutator(plan, insert_after_open) 802 plan2 = plan_mutator(plan1, insert_before_close) --> 803 return (yield from plan2) 804 805

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 168 continue 169 else: --> 170 raise ex 171 # if inserting / mutating, put new generator on the stack 172 # and replace the current msg with the first element from the

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 121 ret = result_stack.pop() 122 try: --> 123 msg = plan_stack[-1].send(ret) 124 except StopIteration as e: 125 # discard the exhausted generator

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 168 continue 169 else: --> 170 raise ex 171 # if inserting / mutating, put new generator on the stack 172 # and replace the current msg with the first element from the

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 121 ret = result_stack.pop() 122 try: --> 123 msg = plan_stack[-1].send(ret) 124 except StopIteration as e: 125 # discard the exhausted generator

~/src/bluesky/bluesky/preprocessors.py in fly_during_wrapper(plan, flyers) 859 plan1 = plan_mutator(plan, insert_after_open) 860 plan2 = plan_mutator(plan1, insert_before_close) --> 861 return (yield from plan2) 862 863

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 168 continue 169 else: --> 170 raise ex 171 # if inserting / mutating, put new generator on the stack 172 # and replace the current msg with the first element from the

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 121 ret = result_stack.pop() 122 try: --> 123 msg = plan_stack[-1].send(ret) 124 except StopIteration as e: 125 # discard the exhausted generator

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 168 continue 169 else: --> 170 raise ex 171 # if inserting / mutating, put new generator on the stack 172 # and replace the current msg with the first element from the

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 121 ret = result_stack.pop() 122 try: --> 123 msg = plan_stack[-1].send(ret) 124 except StopIteration as e: 125 # discard the exhausted generator

~/science_comm/00-user_info.py in rixs_one_energy_1(split_time, total_exp, cycles, energy, ext_vg, reason, disable_sclr_plt) 62 try: 63 print('Starting cycle {} of {}' .format((i+1),cycles)) ---> 64 yield from count(dets, num=pts, md = {'reason':'Length = '+str(np.int(pts*split_time))+' s -'+reason} ) 65 yield from mvr(cryo.y,-0.002) # if you do not want to move comment out this line 66 #yield from sleep(3)

~/src/bluesky/bluesky/plans.py in count(detectors, num, delay, per_shot, md) 75 num=num, delay=delay)) 76 ---> 77 return (yield from inner_count()) 78 79

~/src/bluesky/bluesky/utils.py in dec_inner(*inner_args, inner_kwargs) 1041 plan = gen_func(*inner_args, *inner_kwargs) 1042 plan = wrapper(plan, args, kwargs) -> 1043 return (yield from plan) 1044 return dec_inner 1045 return dec

~/src/bluesky/bluesky/preprocessors.py in stage_wrapper(plan, devices) 950 return (yield from plan) 951 --> 952 return (yield from finalize_wrapper(inner(), unstage_devices())) 953 954

~/src/bluesky/bluesky/preprocessors.py in finalize_wrapper(plan, final_plan, pause_for_debug) 507 cleanup = True 508 try: --> 509 ret = yield from plan 510 except GeneratorExit: 511 cleanup = False

~/src/bluesky/bluesky/preprocessors.py in inner() 948 def inner(): 949 yield from stage_devices() --> 950 return (yield from plan) 951 952 return (yield from finalize_wrapper(inner(), unstage_devices()))

~/src/bluesky/bluesky/utils.py in dec_inner(*inner_args, inner_kwargs) 1041 plan = gen_func(*inner_args, *inner_kwargs) 1042 plan = wrapper(plan, args, kwargs) -> 1043 return (yield from plan) 1044 return dec_inner 1045 return dec

~/src/bluesky/bluesky/preprocessors.py in run_wrapper(plan, md) 325 yield from contingency_wrapper(plan, 326 except_plan=except_plan, --> 327 else_plan=close_run) 328 return rs_uid 329

~/src/bluesky/bluesky/preprocessors.py in contingency_wrapper(plan, except_plan, else_plan, final_plan, pause_for_debug) 573 cleanup = True 574 try: --> 575 ret = yield from plan 576 except GeneratorExit: 577 cleanup = False

~/src/bluesky/bluesky/plans.py in inner_count() 73 def inner_count(): 74 return (yield from bps.repeat(partial(per_shot, detectors), ---> 75 num=num, delay=delay)) 76 77 return (yield from inner_count())

~/src/bluesky/bluesky/plan_stubs.py in repeat(plan, num, delay) 1084 yield Msg('sleep', None, d) 1085 -> 1086 return (yield from repeated_plan())

~/src/bluesky/bluesky/plan_stubs.py in repeated_plan() 1067 now = time.time() # Intercept the flow in its earliest moment. 1068 yield Msg('checkpoint') -> 1069 yield from ensure_generator(plan()) 1070 try: 1071 d = next(delay)

~/src/bluesky/bluesky/plan_stubs.py in one_shot(detectors, take_reading) 927 """ 928 yield Msg('checkpoint') --> 929 yield from take_reading(list(detectors)) 930 931

~/src/bluesky/bluesky/plan_stubs.py in trigger_and_read(devices, name) 813 from .preprocessors import rewindable_wrapper 814 return (yield from rewindable_wrapper(inner_trigger_and_read(), --> 815 rewindable)) 816 817

~/src/bluesky/bluesky/preprocessors.py in rewindable_wrapper(plan, rewindable) 691 restore_rewindable())) 692 else: --> 693 return (yield from plan) 694 695

~/src/bluesky/bluesky/plan_stubs.py in inner_trigger_and_read() 802 # Skip 'wait' if none of the devices implemented a trigger method. 803 if not no_wait: --> 804 yield from wait(group=grp) 805 yield from create(name) 806 ret = {} # collect and return readings to give plan access to them

~/src/bluesky/bluesky/plan_stubs.py in wait(group) 368 Msg('wait', None, group=group) 369 """ --> 370 return (yield Msg('wait', None, group=group)) 371 372

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 193 try: 194 # yield out the 'current message' and collect the return --> 195 inner_ret = yield msg 196 except GeneratorExit: 197 # special case GeneratorExit. We must clean up all of our plans

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 193 try: 194 # yield out the 'current message' and collect the return --> 195 inner_ret = yield msg 196 except GeneratorExit: 197 # special case GeneratorExit. We must clean up all of our plans

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 193 try: 194 # yield out the 'current message' and collect the return --> 195 inner_ret = yield msg 196 except GeneratorExit: 197 # special case GeneratorExit. We must clean up all of our plans

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 193 try: 194 # yield out the 'current message' and collect the return --> 195 inner_ret = yield msg 196 except GeneratorExit: 197 # special case GeneratorExit. We must clean up all of our plans

~/src/bluesky/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 193 try: 194 # yield out the 'current message' and collect the return --> 195 inner_ret = yield msg 196 except GeneratorExit: 197 # special case GeneratorExit. We must clean up all of our plans

~/src/bluesky/bluesky/run_engine.py in _run(self) 1325 try: 1326 msg = self._plan_stack[-1].throw( -> 1327 stashed_exception or resp) 1328 except Exception as e: 1329 # The current plan did not handle it,

~/src/bluesky/bluesky/utils.py in (.0) 116 if not isinstance(gen, PLAN_TYPES): 117 # If plan does not support .send, we must wrap it in a generator. --> 118 gen = (msg for msg in gen) 119 120 return gen

~/src/bluesky/bluesky/run_engine.py in _run(self) 1325 try: 1326 msg = self._plan_stack[-1].throw( -> 1327 stashed_exception or resp) 1328 except Exception as e: 1329 # The current plan did not handle it,

~/src/bluesky/bluesky/utils.py in single_gen(msg) 121 122 --> 123 def single_gen(msg): 124 '''Turn a single message into a plan 125

~/src/bluesky/bluesky/run_engine.py in _run(self) 1325 try: 1326 msg = self._plan_stack[-1].throw( -> 1327 stashed_exception or resp) 1328 except Exception as e: 1329 # The current plan did not handle it,

~/science_comm/00-user_info.py in beamline_align_v3_for_suspenders() 164 # multiple suspenders are tripped at the same time. 165 run_name = f'alignment-{str(uuid.uuid4())[:8]}' --> 166 yield from bpp.set_run_key_wrapper(beamline_align_v3(), run=run_name) 167 168 #@bpp.set_run_key_decorator('alignment')

~/src/bluesky/bluesky/preprocessors.py in set_run_key_wrapper(plan, run) 1330 return msg 1331 -> 1332 return (yield from msg_mutator(plan, _set_run_key)) 1333 1334 set_run_key_decorator = make_decorator(set_run_key_wrapper)

~/src/bluesky/bluesky/preprocessors.py in msg_mutator(plan, msg_proc) 243 ret = None 244 continue --> 245 ret = yield msg 246 except StopIteration as e: 247 return e.value

~/src/bluesky/bluesky/run_engine.py in _run(self) 1406 # exceptions (coming in via throw) can be 1407 # raised -> 1408 new_response = await coro(msg) 1409 1410 # special case CancelledError and let the outer

~/src/bluesky/bluesky/run_engine.py in _stage(self, msg) 2143 if not hasattr(obj, 'stage'): 2144 return [] -> 2145 result = obj.stage() 2146 self._staged.add(obj) # add first in case of failure below 2147 await self._reset_checkpoint_state_coro()

/opt/conda_envs/collection-2020-1.0rc1/lib/python3.7/site-packages/ophyd/areadetector/trigger_mixins.py in stage(self) 119 def stage(self): 120 self._acquisition_signal.subscribe(self._acquire_changed) --> 121 super().stage() 122 123 def unstage(self):

/opt/conda_envs/collection-2020-1.0rc1/lib/python3.7/site-packages/ophyd/areadetector/base.py in stage(self, *args, kwargs) 286 287 def stage(self, *args, *kwargs): --> 288 ret = super().stage(args, kwargs) 289 try: 290 self.validate_asyn_ports()

/opt/conda_envs/collection-2020-1.0rc1/lib/python3.7/site-packages/ophyd/device.py in stage(self) 516 elif self._staged == Staged.yes: 517 raise RedundantStaging("Device {!r} is already staged. " --> 518 "Unstage it first.".format(self)) 519 elif self._staged == Staged.partially: 520 raise RedundantStaging("Device {!r} has been partially staged. "

RedundantStaging: Device RIXSCam(prefix='XF:02ID1-ES{RIXSCam}:', name='rixscam', read_attrs=['xip', 'xip.count_possible_event', 'xip.count_above_threshold', 'xip.count_below_threshold', 'xip.count_neighbours', 'xip.count_event_2x2', 'xip.count_event_3x3', 'hdf5', 'hdf2'], configuration_attrs=['cam', 'cam.acquire_period', 'cam.acquire_time', 'cam.num_images', 'cam.temperature', 'cam.temperature_actual', 'cam.trigger_mode', 'centroid_enable', 'xip', 'xip.algorithm', 'xip.output_mode', 'xip.bkgd_update_mode', 'xip.bkgd_value', 'xip.sum_3x3_threshold_min', 'xip.sum_3x3_threshold_max', 'xip.hist_start', 'xip.hist_bin_width', 'xip.hist_bin_count', 'xip.source_region', 'xip.dim0_region_start', 'xip.dim0_region_size', 'xip.dim1_region_start', 'xip.dim1_region_size', 'xip.x_expansion_factor', 'xip.y_expansion_factor', 'xip.centroid_correction', 'xip.beamline_energy', 'xip.isolinear_correction', 'xip.isolinear_coefficient_x2_1', 'xip.isolinear_coefficient_x1_1', 'xip.isolinear_coefficient_x0_1', 'xip.isolinear_coefficient_x2_2', 'xip.isolinear_coefficient_x1_2', 'xip.isolinear_coefficient_x0_2', 'xip.isolinear_threshold', 'hdf5', 'hdf2', 'set_node', 'sensor_region_xsize', 'sensor_region_ysize', 'sensor_region_xstart', 'sensor_region_ystart', 'sensor_binning_x', 'sensor_binning_y', 'ccd1_hv', 'ccd2_hv']) is already staged. Unstage it first.

We are testing it and when a command is interrupted it should run the function beamline_align_v3_for_suspenders(). However it stops and produces the above error

tacaswell commented 4 years ago

The plans used in the suspenders need to not try to re-stage the devices or need to explicitly unstage the them first.