Hi everyone! I have a question to run `redic-cli` ...
# prefect-community
t
Hi everyone! I have a question to run
redic-cli
in prefect task. My flow runs in ECS cluster in prefect 1.2.0. I tried ShellTask and I got
Command failed with exit code 127
. The command I’m trying to run is something like this.
redis-cli -h myhost --scan --pattern "mypattern" | | xargs redis-cli -h myhost unlink
Is it possible to run this command using ShellTask? I tried to use `RedisExecute`as well but it complains about Secret, and i do not think my redis has password…Any help would be appreciated
m
Hi @Tomohiro Nakagawa The 127 error code indicates “command not found”. This occurs when any given command within your Bash script or on Bash command line is not found in any of the paths defined by PATH system environment variable. The solution is to make sure that the command your are using can be found within your $PATH. If the command is not in your path either include it or use absolute full path to it.
💯 1
t
hi matt, thank you. how do i set $PATH in ecs? do you have any example?
k
Does running
prefect
command on your terminal work?
t
yes
prefect
command works on my terminal.
redis-cli
works too on my terminal
a
why do you run it as CLI commands rather than redis Python library? this tutorial showing how to use Redis might be helpful
If you run things on ECS, then they run within a container, from where you likely have no access to your Redis instance you can try running it without Prefect first on ECS to ensure the base setup works fine in a container and then move to Prefect to orchestrate
👍 1
t
i see thank you!
🙌 1