cli icon indicating copy to clipboard operation
cli copied to clipboard

Piping commands to Redis CLI fails

Open lcottingham opened this issue 1 year ago • 2 comments

Piping a FLUSHALL and QUIT command to the redis:cli is returning a No Redis instances found error.

This one is a new issue that has emerged at some point within the last 4 days with no CI code changes on my side. I managed to replicate this in both CI and local environments. Heroku cli version heroku/10.0.2 darwin-x64 node-v2017.0

CLI commands

cat ./build/flushall | heroku redis:cli --app my-app-name --confirm my-app-name The flushall file (stored in ./build)

FLUSHALL
QUIT

Output: Error: No Redis instances found

echo "FLUSHALL\r\nQUIT" | heroku redis:cli --app my-app-name --confirm my-app-name Output: Error: No Redis instances found

heroku redis:cli --app my-app-name --confirm my-app-name Output: The expected redis prompt - but no commands to run.

I have confirmed the state and presence of the redis addon instance prior to these commands with: heroku addons --app my-app-name

Current Workaround

expect -c '
spawn heroku redis:cli --app my-app-name --confirm my-app-name
expect ">"
send "FLUSHALL\r"
expect ">"
send "QUIT\r"
expect eof'

It seems that a recent change means that piping a command to the redis cli is causing heroku to lose reference to the REDIS instance.

lcottingham avatar Jan 20 '25 13:01 lcottingham

Thank you for reporting, I was able to reproduce this. We will get the fix prioritized.

Internal work item

k80bowman avatar Jan 29 '25 21:01 k80bowman

Do we know if this has been fixed/addressed yet?

lcottingham avatar Jun 10 '25 15:06 lcottingham

@lcottingham I apologize for the delay on this. I have merged a fix and it will be released next week.

k80bowman avatar Sep 12 '25 20:09 k80bowman