Heroku - prevent starting - heroku

I have a dyno on Heroku I use for one off jobs. I do not want it to "start". I added this in my Procfile:
heroku scale web=0
However it still tries to start every few hours as my log show:
=== web (Hobby): `npm start`
web.1: crashed 2015/09/29 07:28:12 (~ 4h ago)
How can I address this? When I searched for the solution the above Procfile entry was suggested.

Related

H14 - No web processes running on Heroku - previous posts with same concern doesn't resolve my issue. 550h eco dyno remaining but still not deployed [duplicate]

This question already has answers here:
H14 error in heroku - "no web processes running"
(22 answers)
Closed 11 days ago.
I have created a Flask-CRUD web application.
My app build is successful but is not deployed when I check the logs I get
`H14 No web processes running error`
I checked the dyno status through command
heroku ps and I got result
**Eco dyno hours quota remaining this month: 550h 0m** (100%) Eco dyno usage for this app: 0h 0m (0%)
My procfile is also named as Procfile (capital P)
web: gunicorn app: app
How can I resolve this my procfile is named as Procfile and I have also tried removing and adding back python buildpack
I think that the issue comes from the extra space in the Procfile after the ::
web: gunicorn app:app

Prevent Heroku from starting a web dyno

I'd like to configure a Heroku app to run a scheduled task once per day. My source tree looks like this:
bin/myScript
Procfile
package.json
When I deploy the app, I see the following error:
2017-01-11T04:31:36.660973+00:00 app[web.1]: npm ERR! missing script: start
I believe this is because Heroku tries to spin up a web dyno. I don't have a web dyno, nor do I want one. So I created a Procfile with this line:
heroku ps:scale web=0
To prevent heroku from spinning up a web dyno. That didn't work. What else can I do to prevent my app from crashing upon deployment? Does it matter if the scheduled task is going to be run in a separate one-off Dyno anyway?
You should not have the line "heroku ps:scale web=0" in your Procfile.
Doing so tells heroku to create a process type called "heroku" that attempts to run the following command on any dyno instances instantiated for it: "ps:scale web=0". That would probably generate errors, and at any rate, is not what you intended.
Instead You should run "heroku ps:scale web=0" as a Heroku toolbelt CLI command (or do the equivalent from the Resources tab of the GUI, as you already did).
I think I found a fix: in the "Resources" tab of the GUI for the web, there is a list of dynos with on/off sliders next to them. I switched the web dyno slider to off, and now when I deploy there is no crash. Still, it's unclear to me why the Procfile line was insufficient.

Deploying simple Ruby code with Heroku

I have a simple Ruby application that works fine inside of the Heroku console (heroku run ruby myapp.rb). How can I have it running fully autonomously?
It's not a web based application, it basically reads some information from a website and sends out an email.
I created a Procfile
worker: ruby myapp.rb
Log says "config.ru not found", what should I put in my config.ru?
Update
Still not working...
Procfile:
worker: bundle exec ruby parse_reg.rb
config.ru:
require './parse_reg'
Heroku log:
2014-09-17T03:27:39+00:00 heroku[slug-compiler]: Slug compilation
started 2014-09-17T03:27:47+00:00 heroku[slug-compiler]: Slug
compilation finished 2014-09-17T03:27:47.743136+00:00 heroku[api]:
Release v16 created by xyz#xyz.com
2014-09-17T03:27:47.743136+00:00 heroku[api]: Deploy d4e3e5f by
xyz#xyz.com 2014-09-17T03:27:48.989789+00:00 heroku[web.1]:
State changed from crashed to starting
2014-09-17T03:27:50.837609+00:00 heroku[web.1]: Starting process with
command bundle exec rackup config.ru -p 44532
2014-09-17T03:28:51.121035+00:00 heroku[web.1]: Error R10 (Boot
timeout) -> Web process failed to bind to $PORT within 60 seconds of
launch 2014-09-17T03:28:51.121241+00:00 heroku[web.1]: Stopping
process with SIGKILL
seems like my Procfile is not being read??? this is really strange!
Just make a config.ru in your project root and add
require './myapp'
Making sure that the myapp.rb file is a script that will run by just requiring it, which it looks like since it works by calling ruby myapp.rb.
OK. I figured out the issue
I had to run the following to start the worker job
heroku ps:scale worker=1
reference: https://devcenter.heroku.com/articles/run-non-web-java-processes-on-heroku

heroku web crashes

So I'm following the tutorial in this link: https://devcenter.heroku.com/articles/django#deploy-to-heroku
once i do "heroku ps" i get:
=== web: `python manage.py runserver 0.0.0.0:$PORT --noreload`
web.1: crashed 2013/02/18 20:22:37 (~ 8m ago)
I don't exactly understand what is the problem here, can someone help? am i suppose to have my Procfile where manage.py is? I tried to move it over to there, but the same error still shows up.
btw my logs are:
2013-02-19T04:36:22+00:00 heroku[api]: Scale to web=1 by deathlordx87#yahoo.com
2013-02-19T04:41:14+00:00 heroku[api]: Scale to web=1 by deathlordx87#yahoo.com
2013-02-19T04:43:10+00:00 heroku[web.1]: State changed from crashed to starting
2013-02-19T04:43:17+00:00 heroku[web.1]: Starting process with command `python manage.py runserver 0.0.0.0:31831 --noreload`
2013-02-19T04:43:18+00:00 app[web.1]: python: can't open file 'manage.py': [Errno 2] No such file or directory
2013-02-19T04:43:19+00:00 heroku[web.1]: Process exited with status 2
2013-02-19T04:43:19+00:00 heroku[web.1]: State changed from starting to crashed
2013-02-19T04:44:05+00:00 heroku[api]: Scale to web=1 by deathlordx87#yahoo.com
I faced the same problem once. You need to configure your settings.py file properly. Since Heroku doesn't support sqlite3 databases so you should check that the database portion of the settings.py file is configured correctly.
Check my minimal sample app successfully deployed to Heroku https://github.com/shinigamiryuk/Django-Heroku-Sample-Application
The log line can't open file 'manage.py' suggests that the file is missing or can't be found. Did you add manage.py to your git depo before deploying to heroku? Is manage.py stored in a different directory from your Procfile/where the program runs?
I suspect your project (if it follows the Two Scoops layout) has manage.py inside a project directory and not in your repository root.
To keep this layout, create a Procfile and within it script a directory change before running gunicorn.
See this answer for an example.

Running Dart App on Heroku

I am following this blog to upload a Dart app to Heroku and run it. I have gotten to the point where the app is successfully deployed to Heroku, but the app is not running. The following is from the Heroku logs:
2012-12-20T18:04:57+00:00 heroku[web.1]: Starting process with command `dart TestApp.dart`
2012-12-20T18:04:57+00:00 app[web.1]: bash: dart: command not found
2012-12-20T18:04:58+00:00 heroku[web.1]: Process exited with status 127
2012-12-20T18:04:58+00:00 heroku[web.1]: State changed from starting to crashed
The following is the contents of my Procfile
web: dart TestApp.dart
Can anyone point me towards a solution to this error?
You should have forgotten to add the buildpack to the config. See the getting started of Heroku Buildpack for Dart.
Basically, you have to use the following commands :
$> heroku create myapp_name -s cedar
$> heroku config:add BUILDPACK_URL=https://github.com/igrigorik/heroku-buildpack-dart.git
WARNING : With the last version of buildpack it seems dart command is no more in the PATH. A workaround is to use the full path in Procfile:
web: ./dart-sdk/bin/dart TestApp.dart

Resources