Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Jupyter Notebook and interference with Flex HTTP server #16670

Open
labautom8 opened this issue Nov 1, 2024 · 0 comments
Open

bug: Jupyter Notebook and interference with Flex HTTP server #16670

labautom8 opened this issue Nov 1, 2024 · 0 comments
Labels

Comments

@labautom8
Copy link

Overview

when running a protocol from the JN interface, the protocol simulates as desired (example for simplicity here):

from opentrons import protocol_api
requirements = {"robotType": "Flex", "apiLevel": "2.20"}
def run(protocol: protocol_api.ProtocolContext):
    # load tip rack in deck slot C1
    t1000 = protocol.load_labware(load_name="opentrons_flex_96_tiprack_1000ul", 
                                    location="C1")
    t50 = protocol.load_labware(load_name="opentrons_flex_96_tiprack_50ul",
                                location = "A1")
    # attach pipette to left mount
    p1000 = protocol.load_instrument(instrument_name="flex_1channel_1000",
                                       mount="right",
                                       tip_racks=[t1000])
    
    p50 = protocol.load_instrument(instrument_name='flex_1channel_50',
                                   mount = 'left',
                                   tip_racks= [t50])
    # load trash bin
    trash = protocol.load_trash_bin("A3")
    # load destination plate in deck slot C2
    #standards_plate = protocol.load_labware(load_name="micronic_96_wellplate_1400ul",location="C2", label="Standards Plate")
    standards_plate = protocol.load_labware(load_name="nest_96_wellplate_2ml_deep",location="C2", label="Standards Plate")
    buffer_reservoir = protocol.load_labware("agilent_1_reservoir_290ml", "D1", label="Buffer Reservoir")
    
    p1000.pick_up_tip()
    p1000.return_tip()

and running the follow magic commands from the JN or via terminal in /var/usr/lib/jupyter/notebooks/ returns the following
image

however, when we switch the execution to execute, we get the following error:

root@c4cdb8:/var/lib/jupyter/notebooks# opentrons_execute protocoltest.py
/data/robot_settings.json not found. Loading defaults
from_conf None default {<InstrumentProbeType.PRIMARY: 1>: '/data/pressure_sensor_data.csv'}
Exception in Thread Manager build
Traceback (most recent call last):
  File "/opt/opentrons-robot-server/opentrons/hardware_control/thread_manager.py", line 314, in _build_and_start_loop
    managed_obj = loop.run_until_complete(builder(*args, loop=loop, **kwargs))
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/opt/opentrons-robot-server/opentrons/hardware_control/ot3api.py", line 382, in build_hardware_controller
    backend = await OT3Controller.build(
  File "/opt/opentrons-robot-server/opentrons/hardware_control/backends/ot3controller.py", line 294, in build
    inst = cls(
  File "/opt/opentrons-robot-server/opentrons/hardware_control/backends/ot3controller.py", line 323, in __init__
    self._drivers = self._build_system_hardware(
  File "/opt/opentrons-robot-server/opentrons/hardware_control/backends/ot3controller.py", line 450, in _build_system_hardw
are
    eeprom_driver.setup()
  File "/opt/opentrons-robot-server/opentrons_hardware/drivers/eeprom/eeprom.py", line 110, in setup
    self.property_read()
  File "/opt/opentrons-robot-server/opentrons_hardware/drivers/eeprom/eeprom.py", line 144, in property_read
    props, overflow = parse_data(data, prop_ids=prop_ids)
  File "/opt/opentrons-robot-server/opentrons_hardware/drivers/eeprom/utils.py", line 52, in parse_data
    prop = _parse_prop(prop_id, prop_len, prop_data)
  File "/opt/opentrons-robot-server/opentrons_hardware/drivers/eeprom/utils.py", line 65, in _parse_prop
    decoded_data = data[0]
IndexError: index out of range
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/opt/opentrons-robot-server/opentrons/execute.py", line 738, in <module>
    sys.exit(main())
  File "/opt/opentrons-robot-server/opentrons/execute.py", line 490, in main
    execute(
  File "/opt/opentrons-robot-server/opentrons/execute.py", line 431, in execute
    hardware_api=_get_global_hardware_controller(_get_robot_type()),
  File "/opt/opentrons-robot-server/opentrons/execute.py", line 708, in _get_global_hardware_controller
    _THREAD_MANAGED_HW = ThreadManager(
  File "/opt/opentrons-robot-server/opentrons/hardware_control/thread_manager.py", line 289, in __init__
    object.__getattribute__(self, "managed_thread_ready_blocking")()
  File "/opt/opentrons-robot-server/opentrons/hardware_control/thread_manager.py", line 294, in managed_thread_ready_blocking
    raise ThreadManagerException("Failed to create Managed Object")
opentrons.hardware_control.thread_manager.ThreadManagerException: Failed to create Managed Object
root@c4cdb8:/var/lib/jupyter/notebooks#

this can be circumvented if you are connected to a live robot (with hardware controller) and turn off the http server (much like was done on the OT2 with modules you wanted to use from the JN). If you are simulating, it does not appear to work.

!systemctl stop opentrons-robot-server
!opentrons_execute protocoltest.py

Steps to reproduce

add protocoltest.py to JN interface

run the following commands

!opentrons_simulate protocoltest.py

then

!opentrons_execute protocoltest.py

the error will occur

Current behavior

The exsiting behavior of the OT2 allowed one to call opentrons_execute from the terminal, via SSH, or via JN interface without the "create managed object" error

Expected behavior

If opentrons_execute is called, it succesfully creates a managed object, and executes against its python file (assuming its correct!)

Operating system

Linux

System and robot setup or anything else?

App & OT3 OS 8.2.0
Ethernet

@labautom8 labautom8 added the bug label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant