cli
cli copied to clipboard
Command parsing error when using heroku run with exit code flag -x
This project is for the Heroku CLI only. Use https://help.heroku.com for anything that is not specific to the CLI itself.
Do you want to request a feature or report a bug?
Bug report
What is the current behavior?
When I run heroku run
with the -x
flag, it gives a command parsing error
irrespective of the command that is used or the app that it is being run on.
Example from my terminal:
❯ heroku run -x echo hello world! -a test-app
Running echo hello world! on ⬢ test-app... up, run.5122 (Hobby)
command parsing error%
What is the expected behavior?
It should return a zero exit code for the above command, and return the exit code of the specified command when I'm running arbitrary commands.
Heroku version:
❯ heroku --version
heroku/7.42.11 darwin-x64 node-v12.16.2
OS version:
Mac OSX 10.15.5
No HTTP proxies or firewalls.
Unable to reproduce this. Can you upgrade the CLI and try running the command on another app as well to see if we can't isolate the issue?
Have upgraded the CLI, and tried on linux:
❯ heroku --version
heroku/7.44.0 linux-x64 node-v12.16.2
On a different app, it still give the same command parsing error
.
Can you share an example command of it working, to make sure I've got the syntax right?
I've just tried running in Gitlab CI too:
$ heroku run -x /bin/bash -c 'exit 1' -a test-app
Running /bin/bash -c "exit 1" on test-app...
starting, run.1580 (Hobby)
Running /bin/bash -c "exit 1" on test-app... connecting, run.1580 (Hobby)
Running /bin/bash -c "exit 1" on test-app... up, run.1580 (Hobby)
command parsing error
ERROR: Job failed: command terminated with exit code 1
The bug appears to be only for heroku apps running docker containers. When I set up a normal app without using containers, it runs fine. I think the command parsing error must be on the heroku platform API side of things?
This looks related to https://github.com/heroku/cli/pull/930, which has more information on the problem. I'm also seeing this "parsing error" because my containers don't use a shell as the entry point.
Actually this doesn't seem to be related to a particular entry point. I can't really manage to make it work at all with containers.
Thanks for looking into it. It's quite an issue for us, as we run database migrations from Gitlab CI after deploying and if they fail we never know about it because all the jobs succeed because they are not receiving the exit code from the heroku dyno. Anyone on the heroku team able to look into it? Thanks.
me too, when deploying using containers
This is an issue for me too!
yes same issue here deploying on containers
We are seeing this same issue as described. App is running as a container, it doesn't matter which command is run.
Using heroku/7.60.2 darwin-x64 node-v14.19.0
on OSX locally at the moment.