`heroku run rake db:migrate` fails with error `R99` from yesterday - ruby-on-rails

I've tried heroku run rake db:migrate and get Connection timed out error.
Adn heroku logs shows this error.
2013-10-18T10:07:20.765963+00:00 heroku[run.5173]: Awaiting client
2013-10-18T10:07:30.324619+00:00 heroku[run.5173]: Error R99 (Platform
error) -> Failed to launch the dyno within 10 seconds
2013-10-18T10:07:30.324809+00:00 heroku[run.5173]: Stopping process
with SIGKILL 2013-10-18T10:07:50.767590+00:00 heroku[run.5173]: Error
R13 (Attach error) -> Failed to attach to process
2013-10-18T10:07:51.840739+00:00 heroku[run.5173]: Process exited with
status 128 2013-10-18T10:07:30.363887+00:00 heroku[run.5173]: State
changed from starting to complete
According to the document, there is nothing that I can do with R99 error, except for waiting.
But I've been trying the command from yesterday, and still getting errors.
What should I do to solve this problem?

Related

An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=3):

Trying to run this project on a MacBook but this error keeps showing. Looked for some solutions but they all failed.
I am working on Flutter project.
The code was built on a different MacBook.
That's the whole error:
Exception: Unable to launch com.projectname.client on 9CE7CA53-67B5-442B-AA2C-35A19A42CEEF:
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=3):
The request to open "com.bringitback.client" failed.
The process did launch, but has since exited or crashed.
Command: xcrun simctl launch 9CE7CA53-67B5-442B-AA2C-35A19A42CEEF com.bringitback.client --enable-dart-profiling --enable-checked-mode --verify-entry-points --start-paused --observatory-port=0
Error launching application on iPhone 14 Pro Max.

When running bin/delayed_job start, postgres has no connection

When I run bin/delayed_job start, I get the following errors:
Job ActiveJob::QueueAdapters::DelayedJobAdapter::JobWrapper (id=30) FAILED (0 prior attempts) with ActiveRecord::StatementInvalid: PG::ConnectionBad: PQconsumeInput() server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
PG::UnableToSend: no connection to the server
Solved by adding the following to config/initializers/delayed_job.rb
ActiveRecord::Base.connection.reconnect!

503 Service Unavailable but heroku logs show 200

I'm making an expensive call to my Heroku Rails server. After 13-15 seconds the console in my browser reports a Service Unavailable 503 error. However when I check my heroku logs, it reports:
Completed 200 OK in 45592ms (Views: 220.3ms | ActiveRecord: 33457.5ms)
Other times the heroku logs report a memory exceeded quota. Here is an example of that below.
2015-06-11T15:17:20.238285+00:00 app[web.1]: Completed 200 OK in 81881ms (Views: 201.6ms | ActiveRecord: 18021.2ms)
2015-06-11T15:17:33.482930+00:00 heroku[web.1]: Process running mem=841M(164.4%)
2015-06-11T15:17:33.482930+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2015-06-11T15:17:53.147570+00:00 heroku[web.1]: Process running mem=841M(164.4%)
2015-06-11T15:17:53.147679+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2015-06-11T15:17:59.751540+00:00 app[web.1]: E, [2015-06-11T15:17:59.695813 #3] ERROR -- : worker=2 PID:13 timeout (121s > 120s), killing
2015-06-11T15:17:59.916750+00:00 app[web.1]: E, [2015-06-11T15:17:59.906435 #3] ERROR -- : reaped #<Process::Status: pid 13 SIGKILL (signal 9)> worker=2
2015-06-11T15:18:02.487428+00:00 app[web.1]: I, [2015-06-11T15:18:02.427293 #16] INFO -- : worker=2 ready
Why is it reporting a Completed 200 when the console is reporting a 503?
there are 2 different things here:
your app
the heroku load balancer
In this case the load balancer see that the request is taking too long and sends you the 503. In the back the service processes the request and returns completes with a 200.
See:
https://devcenter.heroku.com/articles/limits
https://devcenter.heroku.com/articles/request-timeout
Heroku does not gives us much information for error-code = H10. Simple put, something is going wrong with your application code / configuration. To see what's going wrong, run heroku run rails console and you will be able to see error details which will be help you in resolving the error. No need to use logs. heroku run rails console is a big help
This happened with me when I used Node. I put a timeout for 30 seconds and I used to get HTTP:503. I then came to know that it's the timeout that caused the issue. I changed the timeout to <30 seconds and it is working fine. Maybe it's because of the loadbalancer that Heroku uses.
Thanks.

Deploying Rails app to heroku error (sqlite3->Postgresql)? [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I'm suddenly getting an "Application Error" when I deploy some changes to my rails app on heroku. And not really sure why and I can't find a proper solution.
Here are the logs:
2012-10-22T20:05:26+00:00 heroku[slugc]: Slug compilation started
2012-10-22T20:06:54+00:00 heroku[web.1]: State changed from up to starting
2012-10-22T20:06:54+00:00 heroku[slugc]: Slug compilation finished
2012-10-22T20:06:56+00:00 heroku[web.1]: Starting process with command `bundle e
xec rails server -p 28612`
2012-10-22T20:06:56+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2012-10-22T20:06:57+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server
.rb:90:in `select'
2012-10-22T20:06:57+00:00 app[web.1]: [2012-10-22 20:06:57] ERROR SignalExceptio
n: SIGTERM
2012-10-22T20:07:06+00:00 heroku[web.1]: Stopping remaining processes with SIGKI
LL
2012-10-22T20:07:06+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least on
e process failed to exit within 10 seconds of SIGTERM
2012-10-22T20:07:08+00:00 heroku[web.1]: Process exited with status 137
2012-10-22T20:07:57+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process
failed to bind to $PORT within 60 seconds of launch
2012-10-22T20:07:57+00:00 heroku[web.1]: Stopping process with SIGKILL
2012-10-22T20:07:58+00:00 heroku[web.1]: State changed from starting to crashed
2012-10-22T20:07:58+00:00 heroku[web.1]: State changed from crashed to starting
2012-10-22T20:07:58+00:00 heroku[web.1]: Process exited with status 137
2012-10-22T20:08:01+00:00 heroku[web.1]: Starting process with command `bundle e
xec rails server -p 26859`
2012-10-22T20:09:01+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process
failed to bind to $PORT within 60 seconds of launch
2012-10-22T20:09:01+00:00 heroku[web.1]: Stopping process with SIGKILL
2012-10-22T20:09:02+00:00 heroku[web.1]: Process exited with status 137
2012-10-22T20:09:02+00:00 heroku[web.1]: State changed from starting to crashed
2012-10-22T20:09:27+00:00 heroku[router]: Error H10 (App crashed) -> GET www.thr
illengine.com/ dyno= queue= wait= service= status=503 bytes=`
In development it works fine.
Update:
40 min later everything is back to normal and working. Strange, considering that I didn't really do nothing.
Anyone else experiencing something similar?
Does the gem file has pg gem?
did u migrate your db on production DB?
does the deploy give any errors?

Rails app hosted on heroku: Error R12 (Exit timeout)

I have a Rails 3.1.4 app hosted on heroku. I have added the logentries add-on.
I didn't touch the default configuration for alerts, and I now receive every few hours an alert: 'Exit timeout':
Exit timeout: Heroku/myappname
2012-03-23 11:01:41.723
168 <40>1 2012-03-23T11:01:41+00:00 d. heroku web.1 - - Error R12 (Exit timeout) -> Process failed to exit within 10 seconds of SIGTERM
You are receiving this email because your Logentries alarm "Exit timeout"
has been triggered.
In context:
2012-03-23 11:01:28.878 95 <40>1 2012-03-23T11:01:28+00:00 d. heroku web.1 - - Idling
2012-03-23 11:01:31.740 118 <40>1 2012-03-23T11:01:31+00:00 d. heroku web.1 - - Stopping process with SIGTERM
2012-03-23 11:01:41.723 168 <40>1 2012-03-23T11:01:41+00:00 d. heroku web.1 - - Error R12 (Exit timeout) -> Process failed to exit within 10 seconds of SIGTERM
The logs nor this email alert do not give me anything useful to start looking for this issue.
I have a very low traffic (application still in private beta). I suspect it's heroku shutting down the application, and my application does not respond as expected to the SIGTERM signal.
I do not have anything fancy in the application (such as a rake task launched with Heroku Scheduler).
The only thing slightly out of the ordinary is the use of the gem apn_on_rails, which open a connection to Apple's APN servers.
Do you have any idea what is causing this? Should I just ignore this and turn the alert off?
If you're using webrick to run your application on Heroku, you should switch to using 'thin': See https://devcenter.heroku.com/articles/rails3#webserver
This removed all occurrences of the R12 error from my logs.

Resources