nutter icon indicating copy to clipboard operation
nutter copied to clipboard

Issue with serialization of error in Test notebook

Open quanuw opened this issue 4 years ago • 2 comments

The test notebook will return the below error when the notebook under test gets an error. image

quanuw avatar Jun 05 '20 22:06 quanuw

Got a similar issue... Here is a debug log from the nutter CLI:

2020-10-13 09:57:40,000:DEBUG:Executing function with HTTP retry policy. Max tries:20  delay:30
2020-10-13 09:57:40,002:DEBUG:Message from queue: <common.statuseventhandler.StatusEvent object at 0x111446c10>
2020-10-13 09:57:40,410:DEBUG:https://adb-6447267702748866.6.azuredatabricks.net:443 "POST /api/2.0/jobs/runs/submit HTTP/1.1" 200 14
2020-10-13 09:57:40,411:DEBUG:Executing function with HTTP retry policy. Max tries:20  delay:30
2020-10-13 09:57:40,544:DEBUG:https://adb-6447267702748866.6.azuredatabricks.net:443 "GET /api/2.0/jobs/runs/get-output?run_id=755 HTTP/1.1" 200 None
2020-10-13 09:57:40,545:DEBUG:{'metadata': {'job_id': 755, 'run_id': 755, 'number_in_job': 1, 'state': {'life_cycle_state': 'PENDING', 'state_message': ''}, 'task': {'notebook_task': {'notebook_path': '/Shared/Temp-CI/testing/test_drop_employee_csv_full_timestamp'}}, 'cluster_spec': {'existing_cluster_id': '0915-120444-foe167'}, 'cluster_instance': {'cluster_id': '0915-120444-foe167'}, 'start_time': 1602575860358, 'setup_duration': 0, 'execution_duration': 0, 'cleanup_duration': 0, 'creator_user_name': '[email protected]', 'run_name': 'c41d56fe-0d29-11eb-b2a9-acde48001122', 'run_page_url': 'https://northeurope.azuredatabricks.net/?o=6447267702748866#job/755/run/1', 'run_type': 'SUBMIT_RUN'}, 'error': 'No output is available until the task begins.'}
2020-10-13 09:57:41,550:DEBUG:Executing function with HTTP retry policy. Max tries:20  delay:30
2020-10-13 09:57:41,873:DEBUG:https://adb-6447267702748866.6.azuredatabricks.net:443 "GET /api/2.0/jobs/runs/get-output?run_id=755 HTTP/1.1" 200 None
2020-10-13 09:57:41,874:DEBUG:{'metadata': {'job_id': 755, 'run_id': 755, 'number_in_job': 1, 'state': {'life_cycle_state': 'PENDING', 'state_message': ''}, 'task': {'notebook_task': {'notebook_path': '/Shared/Temp-CI/testing/test_drop_employee_csv_full_timestamp'}}, 'cluster_spec': {'existing_cluster_id': '0915-120444-foe167'}, 'cluster_instance': {'cluster_id': '0915-120444-foe167'}, 'start_time': 1602575860358, 'setup_duration': 0, 'execution_duration': 0, 'cleanup_duration': 0, 'creator_user_name': '[email protected]', 'run_name': 'c41d56fe-0d29-11eb-b2a9-acde48001122', 'run_page_url': 'https://northeurope.azuredatabricks.net/?o=6447267702748866#job/755/run/1', 'run_type': 'SUBMIT_RUN'}, 'error': 'No output is available until the task begins.'}
2020-10-13 09:57:42,879:DEBUG:Executing function with HTTP retry policy. Max tries:20  delay:30
2020-10-13 09:57:43,059:DEBUG:https://adb-6447267702748866.6.azuredatabricks.net:443 "GET /api/2.0/jobs/runs/get-output?run_id=755 HTTP/1.1" 400 None
2020-10-13 09:57:43,060:DEBUG:Error: 400 Client Error: Bad Request for url: https://adb-6447267702748866.6.azuredatabricks.net/api/2.0/jobs/runs/get-output?run_id=755
 Response from server:
 { 'error_code': 'INVALID_STATE',
  'message': 'Run result is empty. There may have been issues while saving or '
             'reading results.'}
2020-10-13 09:57:43,060:DEBUG:Function Handler. Exception in function. Error 400 Client Error: Bad Request for url: https://adb-6447267702748866.6.azuredatabricks.net/api/2.0/jobs/runs/get-output?run_id=755
 Response from server:
 { 'error_code': 'INVALID_STATE',
  'message': 'Run result is empty. There may have been issues while saving or '
             'reading results.'} False

Job 755 shows:

image

tomconte avatar Oct 13 '20 08:10 tomconte

This seems to be linked to an inability to pickle the Java exception? Right now I am using the following workaround:

  for res in result.test_results.results:
    # Workaround: suppress problematic exceptions 
    if isinstance(res.exception, py4j.protocol.Py4JJavaError):
      res.exception = None

tomconte avatar Oct 14 '20 07:10 tomconte