https://dagster.io/ logo
#ask-community
Title
# ask-community
b

Bethany

03/09/2023, 8:07 AM
Hey, I’m trying to use custom io managers with assets, but I get a
FileNotFoundError: [Errno 2] No such file or directory: '/opt/dagster/dagster_home/storage/datawarehouse/stg/date_spine'
error when trying to use something other than “io_manager” as the key. If I use “io_manager” as the key it works fine, but then all other jobs and assets try to use that io manager.
c

chris

03/09/2023, 10:09 PM
mind posting the full stack trace?
b

Bethany

03/10/2023, 10:56 AM
@chris here it is 🙂
Copy code
dagster._core.errors.DagsterExecutionLoadInputError: Error occurred while loading input "date_spine" of step "run_date_spine":
  File "/usr/local/lib/python3.9/site-packages/dagster/_core/execution/plan/execute_plan.py", line 265, in dagster_event_sequence_for_step
    for step_event in check.generator(step_events):
  File "/usr/local/lib/python3.9/site-packages/dagster/_core/execution/plan/execute_step.py", line 344, in core_dagster_event_sequence_for_step
    for event_or_input_value in ensure_gen(
  File "/usr/local/lib/python3.9/site-packages/dagster/_core/execution/plan/inputs.py", line 206, in load_input_object
    yield from _load_input_with_input_manager(loader, load_input_context)
  File "/usr/local/lib/python3.9/site-packages/dagster/_core/execution/plan/inputs.py", line 867, in _load_input_with_input_manager
    value = input_manager.load_input(context)
  File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.9/site-packages/dagster/_core/execution/plan/utils.py", line 85, in op_execution_error_boundary
    raise error_cls(
The above exception was caused by the following exception:
FileNotFoundError: [Errno 2] No such file or directory: '/opt/dagster/dagster_home/storage/datawarehouse/stg/date_spine'
  File "/usr/local/lib/python3.9/site-packages/dagster/_core/execution/plan/utils.py", line 55, in op_execution_error_boundary
    yield
  File "/usr/local/lib/python3.9/site-packages/dagster/_core/execution/plan/inputs.py", line 867, in _load_input_with_input_manager
    value = input_manager.load_input(context)
  File "/usr/local/lib/python3.9/site-packages/dagster/_core/storage/upath_io_manager.py", line 143, in load_input
    return self._load_single_input(path, context)
  File "/usr/local/lib/python3.9/site-packages/dagster/_core/storage/upath_io_manager.py", line 101, in _load_single_input
    obj = self.load_from_path(context=context, path=path)
  File "/usr/local/lib/python3.9/site-packages/dagster/_core/storage/fs_io_manager.py", line 172, in load_from_path
    with path.open("rb") as file:
  File "/usr/local/lib/python3.9/pathlib.py", line 1252, in open
    return io.open(self, mode, buffering, encoding, errors, newline,
  File "/usr/local/lib/python3.9/pathlib.py", line 1120, in _opener
    return self._accessor.open(self, flags, mode)
c

chris

03/10/2023, 11:43 PM
Right so what’s happening is that the
io_manager_key
specified in the
@asset
decorator applies to the outputs constructed by that asset, not the inputs being ingested. I think what you actually want to do is define this custom IO manager as the
input_manager_key
to the
AssetIn
arg
21 Views