Heroku Error H10 (App crashed) - ruby-on-rails-3

My Heroku app has crashed, and all i'm getting out of the logs is Error H10 (App crashed)
2012-03-28T14:11:56+00:00 heroku[router]: Error H10 (App crashed) -> GET www.devsite.com/ dyno= queue= wait= service= status=503 bytes=
2012-03-28T14:11:56+00:00 heroku[nginx]: 109.145.58.15 - - [28/Mar/2012:14:11:56 +0000] "GET / HTTP/1.1" 503 607 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.83 Safari/535.11" www.devsite.com
Any idea how to draw more information out of heroku logs - or find out what is wrong?

I had a similar problem, every time I hit the server, I just got these 2 useless lines of output in the logs.
When I ran:
heroku restart
It ended up showing me more output that let me track down my issue (related to migrating to cedar) (the app was crashing on deploy it appears, never fully starting up, but not showing an error during the deploying process, as would usually occur).

According to their Developer documentation:
Check your app’s backtrace in the logs to find out what you need to do to fix the problem.
https://devcenter.heroku.com/articles/errors

I had similar issues and it was related to the dynos. H10 error.
Just run:
heroku restart
Fixed it for me!

Had a similar problem and the error was masked, running a rails c on heroku gave us the reason for the crash

Related

Rabbit MQ backend http authorisation not working

I have configured rabbitmq-auth-backend-http and my rabbitmq.config looks like below
[
{rabbit, [{auth_backends, [rabbit_auth_backend_http, rabbit_auth_backend_internal]}]},
{rabbitmq_auth_backend_http,
[{http_method, get},
{user_path, "http://localhost:8080/auth/user"},
{vhost_path, "http://localhost:8080/auth/vhost"},
{resource_path, "http://localhost:8080/auth/resource"},
{topic_path, "http://localhost:8080/auth/topic"}]}
].
Authorization end points http://localhost:8080/auth are up and running.
But when I am trying to login http://localhost:15672/api/whoami api is getting failed with status code 500.
Authentication with rabbitmq internal database is working fine. only problem is when adding rabbit_auth_backend_http in auth_backends is not working. It's not even hitting the authorization end points. I have checked the logs in var/rabbitmq/rabbit#localhost.log,
but no help. I am posting the logs here
=ERROR REPORT==== 18-Aug-2017::21:55:46 ===
Ranch listener rabbit_web_dispatch_sup_15672 had connection process started with cowboy_protocol:start_link/4 at <0.574.0> exit with reason: {[{reason,undef},{mfa,{rabbit_mgmt_wm_whoami,is_authorized,2}},{stacktrace,[{rabbit_auth_backend_http,user_login_authentication,[<<"test">>,[{password,<<"test">>}]],[]},{rabbit_access_control,try_authenticate,3,[{file,"src/rabbit_access_control.erl"},{line,88}]},{rabbit_access_control,'-check_user_login/2-fun-0-',4,[{file,"src/rabbit_access_control.erl"},{line,74}]},{lists,foldl,3,[{file,"lists.erl"},{line,1263}]},{rabbit_mgmt_util,is_authorized,6,[{file,"src/rabbit_mgmt_util.erl"},{line,149}]},{cowboy_rest,call,3,[{file,"src/cowboy_rest.erl"},{line,976}]},{cowboy_rest,is_authorized,2,[{file,"src/cowboy_rest.erl"},{line,150}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,442}]}]},{req,[{socket,#Port<0.26006>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.574.0>},{method,<<"GET">>},{version,'HTTP/1.1'},{peer,{{127,0,0,1},51220}},{host,<<"localhost">>},{host_info,undefined},{port,15672},{path,<<"/api/whoami">>},{path_info,undefined},{qs,<<>>},{qs_vals,[]},{bindings,[]},{headers,[{<<"host">>,<<"localhost:15672">>},{<<"connection">>,<<"keep-alive">>},{<<"authorization">>,<<"Basic dGVzdDp0ZXN0">>},{<<"user-agent">>,<<"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36">>},{<<"content-type">>,<<"application/json">>},{<<"accept">>,<<"/">>},{<<"referer">>,<<"http://localhost:15672/">>},{<<"accept-encoding">>,<<"gzip, deflate, br">>},{<<"accept-language">>,<<"en-US,en;q=0.8">>},[{<<"connection">>,[<<"keep-alive">>]}]},{cookies,undefined},{meta,[]},{body_state,waiting},{buffer,<<>>},{multipart,undefined},{resp_compress,true},{resp_state,waiting},{resp_headers,[{<<"vary">>,<<"origin">>}]},{resp_body,<<>>},{onresponse,#Fun}]},{state,{context,undefined,none,undefined}}],[{cowboy_rest,error_terminate,5,[{file,"src/cowboy_rest.erl"},{line,1009}]},{cowboy_rest,is_authorized,2,[{file,"src/cowboy_rest.erl"},{line,150}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,442}]}]}
what I am doing wrong?
thanks for any help.
After posting this question rabbitmq-user google group I got the solution. you need to install rabbitmq-auth-backend-http manually.
Adding configuration in rabbitmq.config file will not install it.
here is the link of more detailed answer.
Another important thing about rabbitmq-auth-backend-http plugin is you have to configure all endpoints(user_path, vhost_path, topic_path, resource_path) in rabbitmq.config file. If miss any endpoint rabbitmq will take below default values for authorization.
{user_path, "http://localhost:8000/auth/user"},
{vhost_path, "http://localhost:8000/auth/vhost"},
{resource_path, "http://localhost:8000/auth/resource"},
{topic_path, "http://localhost:8000/auth/topic"}

Apache logs showing strange ^# characters ? What does this mean ?

My apache logs are always interrupted by strange characters :
84.196.205.238, 172.23.20.177, 172.23.20.177 - - [05/May/2015:11:48:15 +0200] 0 www.sudinfo.be "GET /sites/default/files/imagecache/pagallery_450x300/552495393_google_street_view HTTP/1.1" 200 32620 "http://www.sudinfo.be/247263/article/culture/medias/2011-11-23/google-street-view-en%C2%A0belgique-comment-trouver-votre-maison" "Mozilla/5.0 (Linux; U; Android 4.2.2; nl-be; GT-P3110 Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30"
^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#^#efault/files/imagecache/pagallery_450x300/2015/01/13/1554554859_B974505865Z.1_20150113094316_000_GVR3PDRHQ.1-0.jpg HTTP/1.1" 200 26033 "http://www.bing.com/images/search?q=leonardo+dicaprio+Met+gala&id=06B1C7410D6458C6A698AC09F3F8C6B7915BFFDE&FORM=IQFRBA" "Mozilla/5.0 (iPad; CPU OS 7_1_1 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D201 Safari/9537.53"
Do you have any idea what can be the cause of this ?
If your web server is externally accessible then this is probably an artifact from an attempt to hack your server
ISTR ^# is how apache logs a "NULL" zero byte. These are used to pad attacks such as buffer overflow
You may like to look at counter measures such as mod_security
https://github.com/SpiderLabs/ModSecurity/wiki/ModSecurity-Frequently-Asked-Questions-%28FAQ%29
I hope it is obvious that a full patched server and application stack is more likely to be able to withstand random attack attempts like this
Ok finally found out what the problem was. My log files are written on a Network filesystem and my bash client just had problems to read it because of the network.
False alarm, everything still safe. Thanks for the help.

Rails Webrick monitoring functionality in apache2?

Hi I'm wodering if it is possible to get the same webrick monitoring functionality in apache2. Doing a quick reseach on this site an goolge, I found that I can use tail -f to monitor the log realtime. But the info I need is not displayed on the access.log.
On Webrick I can see the complete request that came to the server, this includes all POST parameters that are sent to it. I'm developing a Phonegap aplication that is aiming to a production server with apache, and I need to doublecheck my REST request to the server (exactly as I did in my development environment in Rails with Webrick). That's why tail -f don't fit my needs.
Does anyone has a solution?
Thanks in advance.
I've got the solution. And it's a stupid answer. I was looking to the apache2 other_vhosts_access.log file, and the info I was getting was:
migtrace.com:80 89.131.219.51 - - [16/Sep/2013:12:14:14 +0200] "POST /api/reports.json HTTP/1.1" 200 964 "-" "curl/7.29.0"
But if I tail -f the rails production.log what I get is:
Started POST "/api/reports.json" for 89.131.219.51 at 2013-09-16 12:14:14 +0200
Processing by Api::ReportsController#create as JSON
Parameters: {"report"=>{"geo"=>["41.2058334", "1.697777"], "patient_id"=>"X", "patient_token"=>"XXXXXXXXXX", "lunch"=>"{\"pasta\",\"cheese\",\"chocolate\"}", "sex"=>"true"}}
Completed 200 OK in 522ms (Views: 2.3ms | ActiveRecord: 259.3ms)
That is exactly what I need.

RTMPT connection closes with Red5 after some time

I am using Red5 version 1.0.0(final release) for Java 6 on Windows XP sp3.I am using the installer version downloaded from https://code.google.com/p/red5/. I have a project wherein I am performing live webcam chats between the users. I am using RTMPT (HTTP over RTMP)protocol for that.So I have set up my Red5 server behind the Apache web server.The problem is that everything goes on well for 45-50 seconds and suddenly the RTMPT connection gets closed.I am not using a dedicated rtmpt server,i.e. I have not uncommented the rtmpt bean in the conf files.Rather I have added entries of servlet mappings(for idle,fcs,open etc) in the web.xml of my application. RTMPT is listening on 5080 port.I have tested this with previous versions of Red5 also but the problem is the same.The RTMPT connection closes after some time(within a minute).I had gone through logs but there was found nothing regarding this.Also there was no connection closure due to the inactivity period.Has it something to do with Apache? I am not sure whether server is closing the connection (though I cant find any logs about closing connection) or client closes it.Tried it out with 0.9.0 and 0.9.1 too but nothing to avail.I have heard that there were issues using RTMPT with Red5 on Mac but I am on Windows.Any pointers to this problem? Any help is appreciated.Also here are the error logs that I get on my Apache web server -
[error] (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : proxy: HTTP: attempt to connect to red5serverip:5080 (*) failed.
The same log is repeated for four times.
Here are some access logs from Apache too -
"POST /send/IDTK7NOG2PXGB/803 HTTP/1.1" 200 1
"POST /send/IDTK7NOG2PXGB/804 HTTP/1.1" 503 323
"POST /send/YXF4WTFMN8TCM/1391 HTTP/1.1" 200 8285
"POST /send/YXF4WTFMN8TCM/1392 HTTP/1.1" 200 1
"POST /send/YXF4WTFMN8TCM/1393 HTTP/1.1" 200 54
"POST /send/YXF4WTFMN8TCM/1394 HTTP/1.1" 200 1
"POST /send/YXF4WTFMN8TCM/1395 HTTP/1.1" 503 323
"POST /close/IDTK7NOG2PXGB/805 HTTP/1.1" 503 323
"POST /close/YXF4WTFMN8TCM/1396 HTTP/1.1" 503 323
Thanx!
Probably you are running out of tcp ports. A tcp connection will remain 4 minutes in the TIME_WAIT state by default, even if it is already closed. When your RTMPT stream uses 5 connections each second, your system will need at least 5*60*4=1200 ports for each connected user.
Often the firewall is limiting the amount of ports available. You can also decrease the keep-alive time of a tcp socket. If you google around with your apache error message you will find enough info to sort this out.
Your red5 server may be crashed. This occurs when your RAM usage is getting over. In that case you need to manually start red5 again. If this solved your problem, you need to upgrade your RAM. I am using about 8GB RAM after facing this problem several times. Because red5 was written using JAVA, it lacks memory. FFMPEG is good to use in a low memory. But I don't know how to provide chat using ffmpeg, exactly.
The 503 means that the service did not respond; if you are forwarding to red5 via apache, then this means there is a problem there. I would suggest not using the stand alone rtmpt bean; instead use only the servlet and remove apache from the mix to debug the issue.

Rails 3 Routing Error after Redeploy

I'm hosting a Rails 3 site on Heroku, and I've found that whenever I push a new release, POST requests raise a RoutingError until the user clears his cookies. I don't have any problems while developing locally; just when I push to Heroku. So you can hit the front page, but you get a RoutingError when you submit the Sign Up and Log In forms. Has anyone else seen this behavior? Any ideas how to fix it?
I really don't think the problem here is my config/routes.rb or in my controllers/views, because normally this works, but it breaks when I push a new release, at least until cookies get cleared. Could this be a protect_from_forgery issue?
If it helps, here are my logs:
2011-08-29T16:42:30+00:00 heroku[router]: POST mysite.com/signup dyno=web.1 queue=0 wait=0ms service=354ms status=200 bytes=7518
2011-08-29T16:42:30+00:00 heroku[nginx]: 128.91.71.89 - staging [29/Aug/2011:09:42:30 -0700] "POST /signup HTTP/1.1" 200 2482 "http://mysite.com/" "Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20100101 Firefox/6.0" mysite.com
2011-08-29T16:43:17+00:00 app[web.1]:
2011-08-29T16:43:17+00:00 app[web.1]:
2011-08-29T16:43:17+00:00 app[web.1]: Started POST "/signup" for 128.91.71.74 at Mon Aug 29 09:43:17 -0700 2011
2011-08-29T16:43:17+00:00 app[web.1]:
2011-08-29T16:43:17+00:00 app[web.1]: ActionController::RoutingError (No route matches "/signup"):
Well, it turns out the problem was the login & signup forms were doing a PUT, not a POST, because #user was wrongly getting set under certain weird conditions. Sorry to waste the time of anyone who bothers reading this!