quantile-development / dagster-meltano

A Dagster plugin that allows you to run Meltano in Dagster
MIT License
41 stars 17 forks source link

Issue running on Windows: 'preexec_fn is not supported' #27

Closed acarter24 closed 1 year ago

acarter24 commented 1 year ago

Trying a bit of a proof of concept with Dagster to run the meltano pipelines using this packageand the dagster_ext extension, but running up against this error. Will be Windows for dev and production, so am I just out of luck?

File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster_shell\utils.py", line 88, in execute_script_file
    sub_process = Popen(
  File "C:\Users\***\scoop\apps\python39\3.9.13\lib\subprocess.py", line 782, in __init__
    raise ValueError("preexec_fn is not supported on Windows "

python = "~3.9" meltano = "^2.16.1" dagster = "^1.1.20" dagit = "^1.1.20" dagster-meltano = "^1.2.0"

Full trace below 👇

```python-stacktrace dagster._core.errors.DagsterExecutionStepExecutionError: Error occurred while executing op "run_tap_google_analytics_target_duckdb": File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster\_core\execution\plan\execute_plan.py", line 269, in dagster_event_sequence_for_step for step_event in check.generator(step_events): File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster\_core\execution\plan\execute_step.py", line 380, in core_dagster_event_sequence_for_step for user_event in check.generator( File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster\_core\execution\plan\execute_step.py", line 95, in _step_output_error_checked_user_event_sequence for user_event in user_event_sequence: File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster\_core\execution\plan\compute.py", line 190, in execute_core_compute for step_output in _yield_compute_results(step_context, inputs, compute_fn): File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster\_core\execution\plan\compute.py", line 158, in _yield_compute_results for event in iterate_with_context( File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster\_utils\__init__.py", line 473, in iterate_with_context return File "C:\Users\***\scoop\apps\python39\3.9.13\lib\contextlib.py", line 137, in __exit__ self.gen.throw(typ, value, traceback) File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\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: ValueError: preexec_fn is not supported on Windows platforms File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster\_core\execution\plan\utils.py", line 55, in op_execution_error_boundary yield File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster\_utils\__init__.py", line 471, in iterate_with_context next_output = next(iterator) File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster\_core\execution\plan\compute_generator.py", line 121, in _coerce_solid_compute_fn_to_iterator result = invoke_compute_fn( File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster\_core\execution\plan\compute_generator.py", line 115, in invoke_compute_fn return fn(context, **args_to_pass) if context_arg_provided else fn(**args_to_pass) File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster_meltano\ops.py", line 94, in dagster_op output = meltano_resource.execute_command(f"{command}", env, context.log) File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster_meltano\meltano_resource.py", line 55, in execute_command output, exit_code = execute_shell_command( File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster_shell\utils.py", line 163, in execute return execute_script_file( File "C:\Users\***\VSCodeProjects\***_elt\.venv\lib\site-packages\dagster_shell\utils.py", line 88, in execute_script_file sub_process = Popen( File "C:\Users\***\scoop\apps\python39\3.9.13\lib\subprocess.py", line 782, in __init__ raise ValueError("preexec_fn is not supported on Windows " ```
JulesHuisman commented 1 year ago

I am afraid you're out of luck for now. This package uses the dagster-shell extension, which is where the error occurs. You might be able to fix the problem there.

acarter24 commented 1 year ago

Thanks, appreciate the pointer. I've tried playing around with commenting the offending lines.

One thing I did notice on my journey, that in meltano_resource.py:L34

        return {
            **os.environ.copy(),
            "MELTANO_CLI_LOG_CONFIG": Path(__file__).parent / "logging.yaml",
            "DBT_USE_COLORS": "false",
            "NO_COLOR": "1",
        }

This causes a TypeError: environment can only contain strings error down the track due to the "MELTANO_CLI_LOG_CONFIG" being a Path object, not sure if that's relevant or worth fixing, can raise a PR if its a simple case of stringifying the path.

JulesHuisman commented 1 year ago

Ah interesting, might be a Windows issue. A PR would be great! Thanks.