unknown heroku error - heroku

i am experiencing following error while trying to run application on heroku
2011-06-03T11:24:25-07:00 heroku[nginx]: GET / HTTP/1.1
2011-06-03T18:24:37+00:00 heroku[router]: Error H14 (No web processes runnig)
that's the only message i am getting, and it's not even mentioned in heroku error codes at http://devcenter.heroku.com/articles/error-codes
what could be the reason of this?

heroku restart
made it work properly again

As given on http://devcenter.heroku.com/articles/error-codes
H14 - No web processes running
This is most likely the result of scaling your web processes down to zero through the client.
$ heroku scale web=0
Use the heroku ps command to determine the state of your web processes.

If problems persists after heroku restart;
Destroy the heroku app and re-create.

Heroku restart
didn't fix the issue. I added a new line in my Gemfile (just a new line, no text) to force heroku to reinstall gems and this fixed the issue.

Related

certificate has expired error whilst running heroku commands

I'm trying to do the following with my hosted app on Heroku-
create a database backup
download the database backup
Restore the backup in a local postgres database
However, I get stuck in the first step itself. Running the below command throws the following error -
heroku pg:backups:capture -a app-name
CERT_HAS_EXPIRED: certificate has expired
I even tried running the following command, however, that did not help either -
heroku run:detached pg:backups capture –a app-name
Running pg:backups:capture on ⬢ app-name... done, run.1879 (Free)
Run heroku logs --app app-name --dyno run.1879 to view the output.
(env) E:\new_website\>heroku logs --app app-name --dyno run.1879
2021-10-29T05:18:36.001962+00:00 heroku[run.1879]: Starting process with command pg:backups:capture
2021-10-29T05:18:36.564987+00:00 heroku[run.1879]: State changed from starting to up
2021-10-29T05:18:36.953570+00:00 app[run.1879]: bash: pg:backups:capture: command not found
2021-10-29T05:18:37.068925+00:00 heroku[run.1879]: Process exited with status 127
2021-10-29T05:18:37.103435+00:00 heroku[run.1879]: State changed from up to complete
Finally, I also tried using the HEROKU_DEBUG environment variable to see what the real error was -
(env) E:\new_website\>SET HEROKU_DEBUG=1
(env) E:\new_website\>heroku pg:backups:capture --app app-name
Adding the following trusted certificate authorities
E:\ap01\Ruby\cacert.pem
--> POST /actions/addon-attachments/resolve
--> {"app":"neevista-web","addon_attachment":"DATABASE_URL","addon_service":"heroku-postgresql"}
<-- 200 OK
<-- [{"addon":{"id":"9ccc7a6d-8001-473a-8ef1-e24614ad26c0","name":"postgresql-curly-92807","app":{"id":"587ec79f-3989-40eb-bceb-17220824a275","name":"app-name"},"plan":{"id":"062a1cc7-f79f-404c-9f91-135f70175577","name":"heroku-postgresql:hobby-dev"}},"app":{"id":"587ec79f-3989-40eb-bceb-17220824a275","name":"app-name"},"id":"5a2ba589-22e6-4c42-a3bd-d634b4581eb5","name":"DATABASE","namespace":null,"created_at":"2021-06-21T15:05:48Z","updated_at":"2021-06-21T15:05:48Z","web_url":"https://addons-sso.heroku.com/apps/587ec79f-3989-40eb-bceb-17220824a275/addons/9ccc7a6d-8001-473a-8ef1-e24614ad26c0","log_input_url":null,"config_vars":["DATABASE_URL"]}]
Adding the following trusted certificate authorities
E:\ap01\Ruby\cacert.pem
--> GET /client/v11/databases/9ccc7a6d-8001-473a-8ef1-e24614ad26c0
! CERT_HAS_EXPIRED: certificate has expired
Error: certificate has expired
at TLSSocket.onConnectSecure (_tls_wrap.js:1502:34)
at TLSSocket.emit (events.js:314:20)
at TLSSocket._finishInit (_tls_wrap.js:937:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:711:12)
I've tried updating Heroku CLI, restarting the Heroku app but nothing has helped. Not sure if this helps but I've two versions (9 and 13) of Postgresql running on this windows machine and my app is trying the use the version 13.
Could you please advise what I'm doing wrong here or if there is an ongoing issue at your end?
I finally figured it out myself after Heroku support failed to assist as they classified the issue as a local problem.
For some reason, I'd setup SSL_CERT_FILE environment variable previously. This environment variable was pointing to a certificate pem file -> E:\ap01\Ruby\cacert.pem
After deleting this environment variable heroku commands started to work again.

Heroku ps:exec won't connect

I'm quite a newbie on heroku. So, sorry for the silly question.
My problem is, I don't know what is the error, but one thing for sure I couldn't connect through ssh to my heroku server. If possible I would like to know how to get more detailed error log or something like that. I've tried adding -v or --verbose switch to heroku command but no luck.
Bellow is the complete action I did, well, Basically I followed what is written in the heroku's site.
Here's how to connect through ssh according to heroku's tutorial site.
xxx#yyy:~/xwprog/heroku-sample-gradle1
$ heroku ps:exec
Establishing credentials... done
Connecting to web.1 on ⬢ guarded-fjord-42322...
▸ There was an error connecting to the dyno!
process currently running
xxx#yyy:~/xwprog/heroku-sample-gradle1
$ heroku ps
Free dyno hours quota remaining this month: 550h 0m (100%)
For more information on dyno sleeping and how to upgrade, see:
https://devcenter.heroku.com/articles/dyno-sleeping
=== web (Free): build/install/gradle-getting-started/bin/gradle-getting-started (1)
web.1: up 2018/03/10 16:56:04 +0700 (~ 16m ago)
Tried to run bash, but it's actually work. The downside was each time I disconnected from it, the state also got reset, and prone to get disconnected, with error message ECONNRESET: read ECONNRESET
xxx#yyy:~/xwprog/heroku-sample-gradle1
$ heroku run bash
Running bash on ⬢ guarded-fjord-42322... up, run.3587 (Free)
~ $
Thank you.

Node app in heroku runs locally but I cannot scale dynos

I'm trying to run a node app in heroku. Foreman works to run it locally, and it pushes to git without any errors. However, when I run heroku ps:scale web=1, it says there is no such type as web. My Procfile is just this line: web: node server.js, which I think should work to set the web type.
Does anyone know why this could be going wrong? Your help would be appreciated!
Here's a copy of the terminal...
jmm-2:supportEmail jamesmatheson$ foreman start
14:35:07 web.1 | started with pid 36298
14:35:08 web.1 | app is running on /removed port/
14:35:08 web.1 | database open
^CSIGINT received
14:35:09 system | sending SIGTERM to all processes
SIGTERM received
14:35:09 web.1 | exited with code 1
jmm-2:supportEmail jamesmatheson$ heroku ps:scale web=1
Scaling web dynos... failed
! No such type as web.
Specity --app APP_NAME (As given in My Apps in Heroku). Just answered same questions here:
Heroku Web Dyno failing

Heroku Boot Timeout (Error R10)

Every time I launch my app it cannot get past the 60 second point without:
2012-05-06T22:41:11+00:00 heroku[web.1]: Stopping process with SIGKILL
2012-05-06T22:41:11+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2012-05-06T22:41:11+00:00 heroku[web.1]: Process exited with status 137
2012-05-06T22:41:12+00:00 heroku[web.1]: State changed from starting to crashed
Here is my Procfile:
web: bundle exec thin start -p $PORT
Any responses will be thoroughly appreciated.
If your app does take longer than 60 seconds for "good" reasons, you can work around the 60s boot time limit with https://github.com/dblock/heroku-forward.
The solution was that I had forgotten to include the -p $PORT in my Procfile line.
in Procfile change:
web: bundle exec thin start
to
web: bundle exec thin start -p $PORT
That fixed it for me.
Heroku's boot timeout bit me too. I read several blog posts about how to get around it and ended up automating some of the solutions into a gem.
To reduce the startup time on deploy, you can trim the gems loaded at boot time (this doesn't mean you have to trim them from the app, just boot time).
gem_bench evaluates which gems are likely to not be needed at boot time.
I have an app with about 250 gems and was able to add :require => false to about 60 of them, with dramatic effects.
https://github.com/acquaintable/gem_bench
Disclaimer: I am the author of this open source ruby gem. I wrote the gem to aid myself in solving this exact problem: the 60 second timeout on Heroku.
Hi i was facing the same issue.I have resolved this issue by increase the timeout in /config/unicorn.rb
change timeout 15 to timeout 20 in /config/unicorn.rb
In my case using nodejs I solved this adding a Procfile file with content:
worker: node index.js and push it to heroku.
After that make sure to disable the check "web npm start" and turn on the check "worker node index.js" just like the image attached below
herokuResourcesConfig
I was having the same error when deploying my Node app on Heroku.
I got it solved by adding a Procfile.
web: node app.js
It tells Heroku how to start the application.
The error is because of Heroku is not able to configure on which PORT to run the application.
It can be solved by specifying the PORT for Heroku, ie: in app.js
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`App is running on port ${ PORT }`);
});
Error R10 (Boot timeout)
is this hidden section of heroku allows you to increase the deployment time.
https://tools.heroku.support/limits/boot_timeout
I got this error because Heroku didn't have access to the Mongo Atlas database. You need to change this in the database settings
have the same issue, solved by creating file with proxy server
https://www.npmjs.com/package/http-proxy#setup-a-basic-stand-alone-proxy-server
proxy.js:
httpProxy.createProxyServer({
target, // target that can't cant be exposed, e.g. localhost:4000
changeOrigin: true,
}).listen(process.env.PORT); // port from heroku runtime
then
node server/proxy.js

Running Heroku Console does not start

I am trying to run Heroku console, but in the console, I get the message "Running console attached to terminal" but the console doesn't start.
In the Heroku logs, I get the error:
Error: no child processes attached.
Any help?
I just had a thread with Heroku support about my similar issue, here was their response, which worked for me.
So this is a bamboo app. You can either do
$ heroku console
which will tap into a running web dyno, or you can run a new console
as a one-off process with:
$ heroku run bundle exec rails console
On cedar apps you'd also be able to do
$ heroku run console
which also starts a one-off process, because the console process type
would be implied by the rails buildpack or declared in your Procfile.
It amounts to the same as the previous line.
I was experiencing same issues.
Try
heroku run rails console
in Rails >=3
Happy coding :)
Try
$ telnet rendezvous.heroku.com 5000
to test the net enabled access to that port. They mention that filtered-port issue on their guide
I think this is the same problem you're describing and it has an accepted answer which seemed to fix the issue for the guy that posted the question :-)
heroku run console returns 'Error connecting to process'
I had this problem before I'd actually pushed my code to heroku.
Once I successfully pushed and started everything (bundle, rake etc.) the console actually worked.
Do this and then try
In Procfile
web: bundle exec unicorn_rails -p $PORT -c config/unicorn.rb
In unicorn.rb
worker_processes 2
preload_app true
timeout 30
#resque_pid = nil
before_fork do |server, worker|
#resque_pid ||= spawn("bundle exec rake environment resque:work QUEUE=*")
end
after_fork do |server, worker|
ActiveRecord::Base.establish_connection
end

Resources