Heroku: Cannot run more than 1 Free size dynos
Asked Answered
R

7

109

I was trying to run

heroku run rake db:migrate

And was getting the error

Cannot run more than 1 Free size dynos.

See below for how to fix...

Raisaraise answered 11/1, 2016 at 17:30 Comment(0)
P
189

Most Efective

in console run:

heroku ps

the result is some like this:

run.4859 (Free): up 2016/01/12 21:28:41 (~ 7m ago): rails c

So the numbers 4859 represent the session that is open and needs to be closed. To fix the error you need to run(Obviusly, replace the number 4859 by the number obtained):

heroku ps:stop run.4859

It is a very simple solution.

Photofluorography answered 15/11, 2016 at 19:40 Comment(1)
This helped me. And this answer is more descriptive than the accepted answer.Mun
R
132

The answer is to look for any open heroku sessions (you can use 'heroku ps' as john points out above), in my case I already had a started a heroku console session 30mins earlier and just forgot about it. So if you see the "Cannot run more than 1 Free size dynos" error just close any existing console or other heroku sessions you have open.

Hopefully this saves someone the ten minutes it took me to come to my senses.

Raisaraise answered 11/1, 2016 at 17:30 Comment(7)
You would do this via heroku ps and then heroku ps:stop <DYNO> to stop the process.Barone
@JohnBeynon I like this as correct answer. Saved my butt! FYI for others: the first command (heroku ps) is like linux "netstat". Will show you running processes. In my case it looked like run.5656 (Free): up 2016/01/12 21:28:41 (~ 7m ago): rails c. As you can see I left rails console open by mistake. So all I had to do was run heroku ps:stop run.5656. Easy Peasy :) Thanks John!Bacteriology
As a compliment to John's comment, here it is the documentation from Heroku to stop a one-off-dyno: devcenter.heroku.com/articles/…Octopus
Alternatively, try: heroku ps:stop run.9121 --app my-app-name My bash number was 9121. You can see yours with heroku psMicrofilm
Ten minutes is quite good, I needed 14 hours ;-) - I thought it was a codeship problem (see #37683602)Sanitation
It would be good to mark your own answer as "solution" since it helps others browsing for similar topics.Sanitation
Just 'seconding' OBu, this should be the accepted answerRectangle
A
7

Had the exact same issue and came to this page. After reading realized what was going on but want to add following.

just run

heroku kill DYNO --app your_app_name

After this close all open consoles.

Then run db migrate command, it will work.

Arrear answered 26/7, 2016 at 3:14 Comment(0)
F
2

In my case, I ran heroku ps:restart to restart all dynos and the heroku run * command worked again.

Examples

If you just have one Git remote for Heroku, use this:

heroku ps:restart && heroku run *

If you have multiple Git remotes for Heroku, use this:

heroku ps:restart --remote your-remote-name && heroku run * --remote your-remote-name

OR

heroku ps:restart --app your-heroku-app-name && heroku run * --app your-heroku-app-name

Replace * with your command e.g. console for Rails console.


What I meant by your-heroku-app-name here is the sub-domain for your Heroku app. For example, if your app URL is https://cute-cat.herokuapp.com, that means your-heroku-app-name is cute-cat.

If you are not sure/forgot what's your Git remote name for Heroku, git remote -v can help you with that.

Example:

$ git remote -v
this-is-the-remote-name      https://git.heroku.com/xxx.git (fetch)
this-is-the-remote-name      https://git.heroku.com/xxx.git (push)
this-is-another-remote-name  https://git.heroku.com/yyy.git (fetch)
this-is-another-remote-name  https://git.heroku.com/yyy.git (push)
Flourishing answered 11/12, 2018 at 20:19 Comment(0)
C
1

Just restart all dynos. heroku restart

Codon answered 7/4, 2021 at 21:4 Comment(0)
K
0

For me there was one command running on the web run console, I just ended its session there and it was resolved.

Kirman answered 6/6, 2022 at 10:34 Comment(0)
A
-1

Heads up: Heroku free tier is going away soon

"What happens if I take no action on my free apps or databases or do not upgrade to a paid plan?

free dynos will be scaled down to 0 and hobby-dev databases will be deleted starting November 28, 2022."

"Starting November 28, 2022, free Heroku Dynos, free Heroku Postgres, and free Heroku Data for Redis® plans will no longer be available. If you have apps using any of these resources, you must upgrade to paid plans by this date to ensure your apps continue to run and retain your data. See our blog and FAQ for more info."

REF:

https://blog.heroku.com/next-chapter

https://devcenter.heroku.com/articles/free-dyno-hours

https://help.heroku.com/RSBRUH58/removal-of-heroku-free-product-plans-faq

Annettannetta answered 26/8, 2022 at 2:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.