This is the stack trace I’m getting when I try to ...
# announcements
j
This is the stack trace I’m getting when I try to run the execution of the ingest pipeline in the airline demo:
Copy code
An exception was thrown during execution that is likely a framework error, rather than an error in user code.
Original error message: dagster.core.errors.DagsterResourceFunctionError: Error executing resource_fn on ResourceDefinition db_info

Stack Trace:
  File "/Users/johnstory/.local/share/virtualenvs/dagster_airline_demo-WDH392CN/lib/python3.7/site-packages/dagster_graphql/implementation/pipeline_execution_manager.py", line 299, in execute_pipeline_through_queue
    DagsterInstance.from_ref(instance_ref),

  File "/Users/johnstory/.local/share/virtualenvs/dagster_airline_demo-WDH392CN/lib/python3.7/site-packages/dagster/core/execution/api.py", line 133, in execute_run_iterator
    pipeline, pipeline_run.environment_dict, run_config, instance

  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)

  File "/Users/johnstory/.local/share/virtualenvs/dagster_airline_demo-WDH392CN/lib/python3.7/site-packages/dagster/core/execution/context_creation_pipeline.py", line 204, in scoped_pipeline_context
    raise dagster_error

  File "/Users/johnstory/.local/share/virtualenvs/dagster_airline_demo-WDH392CN/lib/python3.7/site-packages/dagster/core/execution/context_creation_pipeline.py", line 179, in scoped_pipeline_context
    log_manager,

  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)

  File "/Users/johnstory/.local/share/virtualenvs/dagster_airline_demo-WDH392CN/lib/python3.7/site-packages/dagster/core/execution/context_creation_pipeline.py", line 63, in create_resource_builder
    yield resources_stack.create()

  File "/Users/johnstory/.local/share/virtualenvs/dagster_airline_demo-WDH392CN/lib/python3.7/site-packages/dagster/core/execution/context_creation_pipeline.py", line 346, in create
    user_fn, DagsterResourceFunctionError, _create_msg_fn(resource_name)

  File "/Users/johnstory/.local/share/virtualenvs/dagster_airline_demo-WDH392CN/lib/python3.7/site-packages/contextlib2.py", line 442, in enter_context
    result = _cm_type.__enter__(cm)

  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)

  File "/Users/johnstory/.local/share/virtualenvs/dagster_airline_demo-WDH392CN/lib/python3.7/site-packages/dagster/core/execution/context_creation_pipeline.py", line 462, in user_code_context_manager
    check.invariant(stopped, 'Must yield one item. Yielded more than one item')

  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)

  File "/Users/johnstory/.local/share/virtualenvs/dagster_airline_demo-WDH392CN/lib/python3.7/site-packages/dagster/core/errors.py", line 112, in user_code_error_boundary
    error_cls(msg_fn(), user_exception=e, original_exc_info=sys.exc_info(), **kwargs), e

  File "/Users/johnstory/.local/share/virtualenvs/dagster_airline_demo-WDH392CN/lib/python3.7/site-packages/future/utils/__init__.py", line 398, in raise_from
    exec(execstr, myglobals, mylocals)

  File "<string>", line 1, in <module>
Anyone have a clue? cc @nate
p
Don’t know if this helps, but once I had this kind of error because my RAM was full.
a
Well something is wrong with the database resource but that is not a useful stack trace being shown so I'll look in to that. Did you see the guide here for the airline demo here https://dagster.readthedocs.io/en/latest/sections/learn/airline_demo.html there is a requirement on a locally running pg db you may have missed. My best given the error you are seeing.
n
yeah this is a rough stack trace, we’ll take a look at improving it. towards helping us figure out what went wrong, what’s your environment look like? a clean python venv w/ just dagster/dagit?
j
Yep. Ran up a new env and install dagster. Even w/ the setup.py file I still had to
pip install
a few modules; sqlalchemy, papermill, etc.
@alex pg db is up and running -- I've attached and everything looks good.
a
ya im working on fixing the systemic problems that are hiding the real stack trace / exception from you
i think if you do it through the CLI you can see what you need -
dagster pipeline execute airline_demo_ingest_pipeline -p local_fast
j
Yeah, it ran via CLI. Now I'm getting an error that the role 'test' doesn't exist. Seems as though everything is marked as "test" in the docker compose file. IDK. Will keep looking at it.
@alex now getting this error when running from the CLI:
Copy code
py4j.protocol.Py4JJavaError: An error occurred while calling o128.jdbc.
: org.postgresql.util.PSQLException: FATAL: role "test" does not exist
where should I be assigning the role for the demo?
a
Huh I’ve never seen that before. Curious what could be different about your environment since no one else has hit this. Maybe scan your env variables or Java version? I’ll take a closer look in the morning.
j
Been tinkering around with the env stuff. This is what I get from
echo $JAVA_HOME
:
/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home
Can't figure out what else I might be doing here. Please lmk what you'd do to proceed. Thanks!
a
FATAL: role "test" does not exist
So this error seems to mean that the 'test' user was never created for the table. We set that up here https://github.com/dagster-io/dagster/blob/master/examples/docker-compose.yml . It looks like you used
docker-compose up
with this yml to get it started so im not sure what went wrong.
heres a somewhat related issue that may offer some things to try https://github.com/docker-library/postgres/issues/203
j
still fighting against this airline demo. now getting errors when i try to run dagit from CLI -- did something happen to the dagster_chron module? I just cloned a fresh copy.
Copy code
Johns-MacBook-Pro:airline_demo johnstory$ dagit
Loading repository...
Traceback (most recent call last):
  File "/usr/local/bin/dagit-cli", line 11, in <module>
    load_entry_point('dagit==0.6.1', 'console_scripts', 'dagit-cli')()
  File "/Library/Python/2.7/site-packages/dagit/cli.py", line 106, in main
    cli = create_dagit_cli()
  File "/Library/Python/2.7/site-packages/dagit/cli.py", line 21, in create_dagit_cli
    return ui(auto_envvar_prefix='DAGIT')  # pylint: disable=no-value-for-parameter
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/dagit/cli.py", line 72, in ui
    host_dagit_ui(handle, host, port, storage_fallback, reload_trigger)
  File "/Library/Python/2.7/site-packages/dagit/cli.py", line 81, in host_dagit_ui
    app = create_app(handle, instance, reloader)
  File "/Library/Python/2.7/site-packages/dagit/app.py", line 144, in create_app
    version=__version__,
  File "/Library/Python/2.7/site-packages/dagster_graphql/implementation/context.py", line 17, in __init__
    self.repository_definition = self.get_handle().build_repository_definition()
  File "/Library/Python/2.7/site-packages/dagster/core/definitions/handle.py", line 392, in build_repository_definition
    obj = self.entrypoint.perform_load()
  File "/Library/Python/2.7/site-packages/dagster/core/definitions/handle.py", line 445, in entrypoint
    return self.data.get_repository_entrypoint(from_handle=self)
  File "/Library/Python/2.7/site-packages/dagster/core/definitions/handle.py", line 522, in get_repository_entrypoint
    return LoaderEntrypoint.from_yaml(self.repository_yaml, from_handle=from_handle)
  File "/Library/Python/2.7/site-packages/dagster/core/definitions/handle.py", line 175, in from_yaml
    return LoaderEntrypoint.from_module_target(module_name, fn_name, from_handle)
  File "/Library/Python/2.7/site-packages/dagster/core/definitions/handle.py", line 161, in from_module_target
    module = importlib.import_module(module_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/johnstory/code/airline/dagster/examples/dagster_examples/__init__.py", line 1, in <module>
    from dagster_cron import SystemCronScheduler
ImportError: No module named dagster_cron
/Users/johnstory/Library/Python/2.7/lib/python/site-packages/backports/tempfile.py:61: RuntimeWarning: Implicitly cleaning up <TemporaryDirectory '/var/folders/m_/wf6sq5_d3xx7x1gd5b2xpfwm0000gn/T/tmprqHJbn'>
  _warnings.warn(warn_message, _ResourceWarning)
/Users/johnstory/Library/Python/2.7/lib/python/site-packages/backports/tempfile.py:61: RuntimeWarning: Implicitly cleaning up <TemporaryDirectory '/var/folders/m_/wf6sq5_d3xx7x1gd5b2xpfwm0000gn/T/tmp6gaf85'>
  _warnings.warn(warn_message, _ResourceWarning)
@alex
a
I just cloned a fresh copy
Did you re-run
make dev_install
?
Thats assuming you checked out the repo and are running from source via that make command or manually run `pip install -e`s
worth taking a look at
pip list | grep -e dagster -e dagit
to double check your set up either way
j
Copy code
dagit                                  0.6.1       
dagster                                0.6.1       
dagster-examples                       dev         /Users/johnstory/code/airline/dagster/examples
dagster-graphql                        0.6.1
^ this is what i'm getting w/ that command, I think this is expected no? still, the dagit CLI is giving me that cron error.
a
you need to do
pip install -e examples[full]
to get all the required deps for running the demos
j
Great. Did that, now getting a syntax error from one of the files:
Copy code
Loading repository...
Traceback (most recent call last):
  File "/usr/local/bin/dagit-cli", line 11, in <module>
    load_entry_point('dagit==0.6.1', 'console_scripts', 'dagit-cli')()
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/dagit/cli.py", line 106, in main
    cli = create_dagit_cli()
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/dagit/cli.py", line 21, in create_dagit_cli
    return ui(auto_envvar_prefix='DAGIT')  # pylint: disable=no-value-for-parameter
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/dagit/cli.py", line 72, in ui
    host_dagit_ui(handle, host, port, storage_fallback, reload_trigger)
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/dagit/cli.py", line 81, in host_dagit_ui
    app = create_app(handle, instance, reloader)
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/dagit/app.py", line 144, in create_app
    version=__version__,
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/dagster_graphql/implementation/context.py", line 17, in __init__
    self.repository_definition = self.get_handle().build_repository_definition()
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/dagster/core/definitions/handle.py", line 392, in build_repository_definition
    obj = self.entrypoint.perform_load()
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/dagster/core/definitions/handle.py", line 445, in entrypoint
    return self.data.get_repository_entrypoint(from_handle=self)
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/dagster/core/definitions/handle.py", line 522, in get_repository_entrypoint
    return LoaderEntrypoint.from_yaml(self.repository_yaml, from_handle=from_handle)
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/dagster/core/definitions/handle.py", line 175, in from_yaml
    return LoaderEntrypoint.from_module_target(module_name, fn_name, from_handle)
  File "/Users/johnstory/Library/Python/2.7/lib/python/site-packages/dagster/core/definitions/handle.py", line 161, in from_module_target
    module = importlib.import_module(module_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/johnstory/code/airline/dagster/examples/dagster_examples/airline_demo/repository.py", line 3, in <module>
    from .pipelines import define_airline_demo_ingest_pipeline, define_airline_demo_warehouse_pipeline
  File "/Users/johnstory/code/airline/dagster/examples/dagster_examples/airline_demo/pipelines.py", line 123
    def process_delays_by_geo() -> S3FileHandle:
                                ^
SyntaxError: invalid syntax
/Users/johnstory/Library/Python/2.7/lib/python/site-packages/backports/tempfile.py:61: RuntimeWarning: Implicitly cleaning up <TemporaryDirectory '/var/folders/m_/wf6sq5_d3xx7x1gd5b2xpfwm0000gn/T/tmptDwL4I'>
  _warnings.warn(warn_message, _ResourceWarning)
/Users/johnstory/Library/Python/2.7/lib/python/site-packages/backports/tempfile.py:61: RuntimeWarning: Implicitly cleaning up <TemporaryDirectory '/var/folders/m_/wf6sq5_d3xx7x1gd5b2xpfwm0000gn/T/tmppadZXq'>
  _warnings.warn(warn_message, _ResourceWarning)
When I fix the syntax error it sends me another, seems like all are revolving around the s3 resource. @alex -- any thoughts?
a
Shoot I should have caught this from the stack trace earlier: the airline demo uses python 3 type annotations so it won't work in python 2
Sending a diff to update the guide to call that out explicitly
you could keep removing the type hints and you will eventually get it working in py2 with inputs and outputs ending up typed as
Any