Whenever I try to run the prefect-shell trigger I ...
# ask-community
a
Whenever I try to run the prefect-shell trigger I get below error
Copy code
07:47:06.504 | ERROR   | asyncio - Exception in callback SubprocessStreamProtocol.pipe_data_received(2, b'/tmp/prefec...us redirect\n')
handle: <Handle SubprocessStreamProtocol.pipe_data_received(2, b'/tmp/prefec...us redirect\n')>
Traceback (most recent call last):
  File "/usr/lib64/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib64/python3.11/asyncio/subprocess.py", line 72, in pipe_data_received
    reader.feed_data(data)
  File "/usr/lib64/python3.11/asyncio/streams.py", line 480, in feed_data
    assert not self._eof, 'feed_data after feed_eof'
AssertionError: feed_data after feed_eof
but if i try the same using run() it works fine what am i doing wrong?? below is my trigger() logic
Copy code
with ShellOperation(
                commands=["mysqldump -h ${DB_HOST} -u ${DB_USER} -p ${DB_USER_PASSWORD} --databases --default-character-set=utf8 --events --routines --triggers --set-gtid-purged=OFF ${db} > ${backup_file_path}"],
                env={"DB_HOST": DB_HOST,
                "DB_USER":DB_USER,
                "DB_USER_PASSWORD":DB_USER_PASSWORD,
                "db":db,
                "backup_file_path":backup_file_path}
            ) as shell_operation:
                shell_process = shell_operation.trigger()
                shell_process.wait_for_completion()
                shell_output = shell_process.fetch_result()