Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroku CLI run command should separate stdout from stderr #304

Open
2 tasks done
ezekg opened this issue Jul 12, 2024 · 1 comment
Open
2 tasks done

Heroku CLI run command should separate stdout from stderr #304

ezekg opened this issue Jul 12, 2024 · 1 comment
Assignees
Labels
Proposed Tooling Heroku CLI and other tools

Comments

@ezekg
Copy link

ezekg commented Jul 12, 2024

Required Terms

What service(s) is this request for?

CLI

Tell us about what you're trying to solve. What challenges are you facing?

I assume this is a limitation of the rendezvous protocol, but when using the heroku run command, stdout and stderr streams are not separated, leading to mixed output. This behavior deviates from typical Unix command behavior where stdout and stderr are distinct. For example, if you were to run a Rake task that exports a CSV to stdout and prints a digest to stderr, the resulting file includes both outputs. This makes the CSV file invalid.

Local example

rake export:csv > export.csv
# Output to stderr: 50d858e0985ecc7f60418aaf0cc5ab587f42c2570a884095a9e8ccacd0f6545c
cat export.csv 
# Result: a valid CSV file

Heroku example

heroku run rake export:csv > export.csv
# Output to stderr: <nothing>
cat export.csv 
# Result: a malformed CSV file

Typically, if you wanted to combine stdout and stderr, you'd explicitly use 2>&1.

Refs: heroku/cli#1835, heroku/legacy-cli#1214

@ezekg ezekg added the Proposed label Jul 12, 2024
@k80bowman k80bowman added the Tooling Heroku CLI and other tools label Jul 15, 2024
@k80bowman
Copy link

Thank you for bringing this issue to our attention. We will take a look at it and get some changes prioritized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Proposed Tooling Heroku CLI and other tools
Projects
None yet
Development

No branches or pull requests

3 participants