https://dagster.io/ logo
#announcements
Title
# announcements
r

Richard Brady

07/29/2020, 8:01 AM
Hey, I am currently learning dagstermill. I am using the python api and trying to run a simple notebook but am having some issues. Below is my notebook.
Copy code
import dagstermill as dm

sum_num = 2 + 2

print(sum_num)

dm.yield_result(sum_num, 'sum_num')
And below is my script to create and execute a reconstructable pipline.
Copy code
hello = dm.define_dagstermill_solid(
    'Hello', script_relative_path('hello_world.ipynb'), output_defs=[OutputDefinition(name="sum_num")]
)

solid_defs = [hello]


def make_backward_pipeline():
    print(solid_defs)
    return PipelineDefinition(name="_pipeline", solid_defs=solid_defs)


execute_pipeline(reconstructable(make_backward_pipeline))
Exception below
dagster.check.CheckError: Failure condition: Can not produce an instance reference for <dagster.core.instance.DagsterInstance object at 0x7f4d0e01d2d0>
I can't find much in the documentation so am hoping someone can help. I have tested the solid using dagit and changing the reconstructable pipeline to a decorated @pipline function and it seems to run OK, so I am sure it is a problem with my PipelineDefinition. Any ideas?
m

max

07/29/2020, 1:53 PM
Hi Richard -- can i see the full traceback?
r

Richard Brady

07/29/2020, 1:57 PM
Hey Max here is the traceback
Copy code
2020-07-29 14:53:43 - dagster - DEBUG - p_line - 6b51d3f1-1592-4e1f-a63b-1b45dd12e288 - PIPELINE_START - Started execution of pipeline "p_line".
                 pid = 27218
2020-07-29 14:53:43 - dagster - DEBUG - p_line - 6b51d3f1-1592-4e1f-a63b-1b45dd12e288 - ENGINE_EVENT - Executing steps in process (pid: 27218)
 event_specific_data = {"error": null, "marker_end": null, "marker_start": null, "metadata_entries": [["pid", null, ["27218"]], ["step_keys", null, ["['Sum.compute']"]]]}
                 pid = 27218
2020-07-29 14:53:43 - dagster - DEBUG - p_line - 6b51d3f1-1592-4e1f-a63b-1b45dd12e288 - STEP_START - Started execution of step "Sum.compute".
                 pid = 27218
               solid = "Sum"
    solid_definition = "Sum"
            step_key = "Sum.compute"
2020-07-29 14:53:43 - dagster - ERROR - p_line - 6b51d3f1-1592-4e1f-a63b-1b45dd12e288 - STEP_FAILURE - Execution of step "Sum.compute" failed.
            cls_name = "CheckError"
       error_message = "dagster.check.CheckError: Failure condition: Can not produce an instance reference for <dagster.core.instance.DagsterInstance object at 0x7fbd7c674210>\n"
                 pid = 27218
               solid = "Sum"
    solid_definition = "Sum"
            step_key = "Sum.compute"

dagster.check.CheckError: Failure condition: Can not produce an instance reference for <dagster.core.instance.DagsterInstance object at 0x7fbd7c674210>

  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/errors.py", line 181, in user_code_error_boundary
    yield
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_step.py", line 399, in _user_event_sequence_for_step_compute_fn
    for event in gen:
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/compute.py", line 101, in _execute_core_compute
    for step_output in _yield_compute_results(compute_context, inputs, compute_fn):
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/compute.py", line 72, in _yield_compute_results
    for event in user_event_sequence:
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagstermill/solids.py", line 173, in _t_fn
    get_papermill_parameters(system_compute_context, inputs, output_log_path),
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagstermill/solids.py", line 137, in get_papermill_parameters
    parameters['__dm_instance_ref_dict'] = pack_value(compute_context.instance.get_ref())
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/instance/__init__.py", line 310, in get_ref
    check.failed('Can not produce an instance reference for {t}'.format(t=self))
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/check/__init__.py", line 109, in failed
    raise_with_traceback(CheckError('Failure condition: {desc}'.format(desc=desc)))
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/future/utils/__init__.py", line 446, in raise_with_traceback
    raise exc.with_traceback(traceback)

2020-07-29 14:53:43 - dagster - ERROR - p_line - 6b51d3f1-1592-4e1f-a63b-1b45dd12e288 - PIPELINE_FAILURE - Execution of pipeline "p_line" failed.
                 pid = 27218
Traceback (most recent call last):
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_plan.py", line 153, in _dagster_event_sequence_for_step
    for step_event in check.generator(step_events):
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_step.py", line 269, in core_dagster_event_sequence_for_step
    _step_output_error_checked_user_event_sequence(step_context, user_event_sequence)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_step.py", line 53, in _step_output_error_checked_user_event_sequence
    for user_event in user_event_sequence:
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_step.py", line 400, in _user_event_sequence_for_step_compute_fn
    yield event
  File "/anaconda3/envs/spine-branca/lib/python3.7/contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/errors.py", line 192, in user_code_error_boundary
    error_cls(msg_fn(), user_exception=e, original_exc_info=sys.exc_info(), **kwargs), e
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/future/utils/__init__.py", line 403, in raise_from
    exec(execstr, myglobals, mylocals)
  File "<string>", line 1, in <module>
dagster.core.errors.DagsterExecutionStepExecutionError: Error occurred during the execution of step:
        step key: "Sum.compute"
        solid invocation: "Sum"
        solid definition: "Sum"
        

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Spine/spine/test_notebook.py", line 18, in <module>
    execute_pipeline(reconstructable(make_backward_pipeline))
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/definitions/reconstructable.py", line 243, in reconstructable
    return bootstrap_standalone_recon_pipeline(pointer)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/definitions/reconstructable.py", line 250, in bootstrap_standalone_recon_pipeline
    pipeline_def = pipeline_def_from_pointer(pointer)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/definitions/reconstructable.py", line 306, in pipeline_def_from_pointer
    target = def_from_pointer(pointer)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/definitions/reconstructable.py", line 284, in def_from_pointer
    target = pointer.load_target()
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/code_pointer.py", line 178, in load_target
    module = load_python_file(self.python_file, None)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/code_pointer.py", line 95, in load_python_file
    module = import_module_from_path(module_name, python_file)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/seven/__init__.py", line 100, in import_module_from_path
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Spine/spine/test_notebook.py", line 18, in <module>
    execute_pipeline(reconstructable(make_backward_pipeline))
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/api.py", line 303, in execute_pipeline
    environment_dict=environment_dict,
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/telemetry.py", line 89, in wrap
    result = f(*args, **kwargs)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/api.py", line 351, in _logged_execute_pipeline
    return execute_run(pipeline, pipeline_run, instance, raise_on_error=raise_on_error)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/api.py", line 149, in execute_run
    event_list = list(_execute_run_iterable)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/api.py", line 677, in __iter__
    retries=self.retries,
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/api.py", line 617, in _pipeline_execution_iterator
    pipeline_context, execution_plan, steps_started, pipeline_success_ref
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/api.py", line 576, in _core_execution_iterator
    for event in pipeline_context.executor.execute(pipeline_context, execution_plan):
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/executor/in_process.py", line 37, in execute
    pipeline_context, execution_plan, self.retries
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_plan.py", line 73, in inner_plan_execution_iterator
    _dagster_event_sequence_for_step(step_context, retries)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_plan.py", line 213, in _dagster_event_sequence_for_step
    raise dagster_user_error.user_exception
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/errors.py", line 181, in user_code_error_boundary
    yield
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_step.py", line 399, in _user_event_sequence_for_step_compute_fn
    for event in gen:
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/compute.py", line 101, in _execute_core_compute
    for step_output in _yield_compute_results(compute_context, inputs, compute_fn):
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/compute.py", line 72, in _yield_compute_results
    for event in user_event_sequence:
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagstermill/solids.py", line 173, in _t_fn
    get_papermill_parameters(system_compute_context, inputs, output_log_path),
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagstermill/solids.py", line 137, in get_papermill_parameters
    parameters['__dm_instance_ref_dict'] = pack_value(compute_context.instance.get_ref())
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/instance/__init__.py", line 310, in get_ref
    check.failed('Can not produce an instance reference for {t}'.format(t=self))
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/check/__init__.py", line 109, in failed
    raise_with_traceback(CheckError('Failure condition: {desc}'.format(desc=desc)))
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/future/utils/__init__.py", line 446, in raise_with_traceback
    raise exc.with_traceback(traceback)
dagster.check.CheckError: Failure condition: Can not produce an instance reference for <dagster.core.instance.DagsterInstance object at 0x7fbd7c674210>
m

max

07/29/2020, 2:37 PM
can you try running:
Copy code
from dagster import DagsterInstance

execute_pipeline(
    reconstructable(make_backward_pipeline),
    instance=DagsterInstance.get()
)
r

Richard Brady

07/29/2020, 2:43 PM
Same exception
Copy code
2020-07-29 15:40:42 - dagster - DEBUG - p_line - d00f7446-0f37-4574-a730-3b271c6b9701 - PIPELINE_START - Started execution of pipeline "p_line".
                 pid = 6167
2020-07-29 15:40:42 - dagster - DEBUG - p_line - d00f7446-0f37-4574-a730-3b271c6b9701 - ENGINE_EVENT - Executing steps in process (pid: 6167)
 event_specific_data = {"error": null, "marker_end": null, "marker_start": null, "metadata_entries": [["pid", null, ["6167"]], ["step_keys", null, ["['Sum.compute']"]]]}
                 pid = 6167
2020-07-29 15:40:42 - dagster - DEBUG - p_line - d00f7446-0f37-4574-a730-3b271c6b9701 - STEP_START - Started execution of step "Sum.compute".
                 pid = 6167
               solid = "Sum"
    solid_definition = "Sum"
            step_key = "Sum.compute"
2020-07-29 15:40:42 - dagster - ERROR - p_line - d00f7446-0f37-4574-a730-3b271c6b9701 - STEP_FAILURE - Execution of step "Sum.compute" failed.
            cls_name = "CheckError"
       error_message = "dagster.check.CheckError: Failure condition: Can not produce an instance reference for <dagster.core.instance.DagsterInstance object at 0x7feedf23cfd0>\n"
                 pid = 6167
               solid = "Sum"
    solid_definition = "Sum"
            step_key = "Sum.compute"

dagster.check.CheckError: Failure condition: Can not produce an instance reference for <dagster.core.instance.DagsterInstance object at 0x7feedf23cfd0>

  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/errors.py", line 181, in user_code_error_boundary
    yield
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_step.py", line 399, in _user_event_sequence_for_step_compute_fn
    for event in gen:
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/compute.py", line 101, in _execute_core_compute
    for step_output in _yield_compute_results(compute_context, inputs, compute_fn):
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/compute.py", line 72, in _yield_compute_results
    for event in user_event_sequence:
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagstermill/solids.py", line 173, in _t_fn
    get_papermill_parameters(system_compute_context, inputs, output_log_path),
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagstermill/solids.py", line 137, in get_papermill_parameters
    parameters['__dm_instance_ref_dict'] = pack_value(compute_context.instance.get_ref())
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/instance/__init__.py", line 310, in get_ref
    check.failed('Can not produce an instance reference for {t}'.format(t=self))
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/check/__init__.py", line 109, in failed
    raise_with_traceback(CheckError('Failure condition: {desc}'.format(desc=desc)))
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/future/utils/__init__.py", line 446, in raise_with_traceback
    raise exc.with_traceback(traceback)

2020-07-29 15:40:42 - dagster - ERROR - p_line - d00f7446-0f37-4574-a730-3b271c6b9701 - PIPELINE_FAILURE - Execution of pipeline "p_line" failed.
                 pid = 6167
Traceback (most recent call last):
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_plan.py", line 153, in _dagster_event_sequence_for_step
    for step_event in check.generator(step_events):
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_step.py", line 269, in core_dagster_event_sequence_for_step
    _step_output_error_checked_user_event_sequence(step_context, user_event_sequence)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_step.py", line 53, in _step_output_error_checked_user_event_sequence
    for user_event in user_event_sequence:
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_step.py", line 400, in _user_event_sequence_for_step_compute_fn
    yield event
  File "/anaconda3/envs/spine-branca/lib/python3.7/contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/errors.py", line 192, in user_code_error_boundary
    error_cls(msg_fn(), user_exception=e, original_exc_info=sys.exc_info(), **kwargs), e
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/future/utils/__init__.py", line 403, in raise_from
    exec(execstr, myglobals, mylocals)
  File "<string>", line 1, in <module>
dagster.core.errors.DagsterExecutionStepExecutionError: Error occurred during the execution of step:
        step key: "Sum.compute"
        solid invocation: "Sum"
        solid definition: "Sum"
        

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Spine/spine/test_notebook.py", line 18, in <module>
    execute_pipeline(reconstructable(make_backward_pipeline), instance=DagsterInstance.get())
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/definitions/reconstructable.py", line 243, in reconstructable
    return bootstrap_standalone_recon_pipeline(pointer)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/definitions/reconstructable.py", line 250, in bootstrap_standalone_recon_pipeline
    pipeline_def = pipeline_def_from_pointer(pointer)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/definitions/reconstructable.py", line 306, in pipeline_def_from_pointer
    target = def_from_pointer(pointer)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/definitions/reconstructable.py", line 284, in def_from_pointer
    target = pointer.load_target()
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/code_pointer.py", line 178, in load_target
    module = load_python_file(self.python_file, None)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/code_pointer.py", line 95, in load_python_file
    module = import_module_from_path(module_name, python_file)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/seven/__init__.py", line 100, in import_module_from_path
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Spine/spine/test_notebook.py", line 18, in <module>
    execute_pipeline(reconstructable(make_backward_pipeline), instance=DagsterInstance.get())
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/api.py", line 303, in execute_pipeline
    environment_dict=environment_dict,
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/telemetry.py", line 89, in wrap
    result = f(*args, **kwargs)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/api.py", line 351, in _logged_execute_pipeline
    return execute_run(pipeline, pipeline_run, instance, raise_on_error=raise_on_error)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/api.py", line 149, in execute_run
    event_list = list(_execute_run_iterable)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/api.py", line 677, in __iter__
    retries=self.retries,
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/api.py", line 617, in _pipeline_execution_iterator
    pipeline_context, execution_plan, steps_started, pipeline_success_ref
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/api.py", line 576, in _core_execution_iterator
    for event in pipeline_context.executor.execute(pipeline_context, execution_plan):
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/executor/in_process.py", line 37, in execute
    pipeline_context, execution_plan, self.retries
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_plan.py", line 73, in inner_plan_execution_iterator
    _dagster_event_sequence_for_step(step_context, retries)
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_plan.py", line 213, in _dagster_event_sequence_for_step
    raise dagster_user_error.user_exception
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/errors.py", line 181, in user_code_error_boundary
    yield
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/execute_step.py", line 399, in _user_event_sequence_for_step_compute_fn
    for event in gen:
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/compute.py", line 101, in _execute_core_compute
    for step_output in _yield_compute_results(compute_context, inputs, compute_fn):
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/execution/plan/compute.py", line 72, in _yield_compute_results
    for event in user_event_sequence:
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagstermill/solids.py", line 173, in _t_fn
    get_papermill_parameters(system_compute_context, inputs, output_log_path),
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagstermill/solids.py", line 137, in get_papermill_parameters
    parameters['__dm_instance_ref_dict'] = pack_value(compute_context.instance.get_ref())
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/core/instance/__init__.py", line 310, in get_ref
    check.failed('Can not produce an instance reference for {t}'.format(t=self))
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/dagster/check/__init__.py", line 109, in failed
    raise_with_traceback(CheckError('Failure condition: {desc}'.format(desc=desc)))
  File "/anaconda3/envs/spine-branca/lib/python3.7/site-packages/future/utils/__init__.py", line 446, in raise_with_traceback
    raise exc.with_traceback(traceback)
dagster.check.CheckError: Failure condition: Can not produce an instance reference for <dagster.core.instance.DagsterInstance object at 0x7feedf23cfd0>
m

max

07/29/2020, 2:55 PM
is this the same pipeline? i'm just wondering where this solid
Sum
is coming from
r

Richard Brady

07/29/2020, 3:29 PM
Oh sorry, exact same pipeline. Just renamed it.