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

Command parsing error when using heroku run with exit code flag -x #1624

Open
liamgarrison opened this issue Aug 26, 2020 · 12 comments
Open

Comments

@liamgarrison
Copy link

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.

@RasPhilCo
Copy link
Contributor

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?

@liamgarrison
Copy link
Author

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?

@liamgarrison
Copy link
Author

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

@liamgarrison
Copy link
Author

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?

@bbc2
Copy link

bbc2 commented Oct 13, 2020

This looks related to #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.

@bbc2
Copy link

bbc2 commented Oct 13, 2020

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.

@liamgarrison
Copy link
Author

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.

@matti
Copy link

matti commented Apr 26, 2021

me too, when deploying using containers

@nicholasmordecai
Copy link

This is an issue for me too!

@clemsos
Copy link

clemsos commented Sep 9, 2021

yes same issue here deploying on containers

@coryjoist
Copy link

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.

@altmas5
Copy link

altmas5 commented Jan 24, 2025

I have the same issue using the container stack for the app.

heroku --version                                       
heroku/10.0.2 darwin-x64 node-v20.17.0

Error:

heroku run --exit-code ls --app app-staging  
Running ls on ⬢ app-staging... up, run.5586
command parsing error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants