dfo-mar-odis / dart

DFO At-sea Reporting Template, collect Elog, CTD and sample data at sea to produce reports then upload to BioChem at the end of the mission
3 stars 1 forks source link

Bottle Load Error - Missing Mission Dir #128

Closed upsonp closed 5 months ago

upsonp commented 5 months ago

If the bottle director is set, but does not exist an error is thrown and the Bottle Load card on the Sample load page does not load properly.

ERROR 2024-05-07 07:07:29,912 log log.py 241 log_response Internal Server Error: /en/core/JC24301/bottleload/card/1/
Traceback (most recent call last):
  File "D:\Gov\projects\python\dart\dart_env\Lib\site-packages\asgiref\sync.py", line 518, in thread_handler
    raise exc_info[1]
  File "D:\Gov\projects\python\dart\dart_env\Lib\site-packages\django\core\handlers\exception.py", line 42, in inner
    response = await get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Gov\projects\python\dart\dart_env\Lib\site-packages\asgiref\sync.py", line 518, in thread_handler
    raise exc_info[1]
  File "D:\Gov\projects\python\dart\dart_env\Lib\site-packages\django\core\handlers\base.py", line 253, in _get_response_async
    response = await wrapped_callback(
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Gov\projects\python\dart\dart_env\Lib\site-packages\asgiref\sync.py", line 468, in __call__
    ret = await asyncio.shield(exec_coro)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\asyncio\futures.py", line 287, in __await__
    yield self  # This tells Task to wait for completion.
    ^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\asyncio\tasks.py", line 339, in __wakeup
    future.result()
  File "C:\Program Files\Python311\Lib\asyncio\futures.py", line 203, in result
    raise self._exception.with_traceback(self._exception_tb)
  File "D:\Gov\projects\python\dart\dart_env\Lib\site-packages\asgiref\current_thread_executor.py", line 40, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Gov\projects\python\dart\dart_env\Lib\site-packages\asgiref\sync.py", line 522, in thread_handler
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "D:\Gov\projects\python\dart\core\form_btl_load.py", line 229, in bottle_load_card
    bottle_load_soup = get_bottle_load_card(request, database, mission_id, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Gov\projects\python\dart\core\form_btl_load.py", line 191, in get_bottle_load_card
    bottle_load_form = BottleLoadForm(mission=mission, collapsed=collapsed, initial=initial)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Gov\projects\python\dart\core\form_btl_load.py", line 169, in __init__
    files = [f for f in os.listdir(mission.bottle_directory) if f.upper().endswith('.BTL')]
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Gov\\OESD\\sample_data\\JC24301\\BTL_calibrated'