Forum: Ruby Rails server issue in production environment

F3a6619f5077b3ea54c603efe4d70ae5?d=identicon&s=25 Jiajia Wang (Guest)
on 2014-07-18 13:17
(Received via mailing list)
Hi guys,

I'm having troubles to run rails server in production environment.

It's working fine in development environment.

However if i run it as 'rails server -e production',
Static page like public/index.html is fine.
But any controller (maybe it's DB) involved requests will fail and cause
the server died, can't stop it by CTRL+C, have to kill the process. The
page loading never end. No error page returned.

I'm assuming it could be some db connection issue.
Because production db is using AWS RDS.
However, both 'rails c production' and 'rails dbconsole production' can
successfully connect to RDS.

I couldn't figured out why.
820e01609a9f8f0fc0d5167680625b93?d=identicon&s=25 Harisankar P S (coderhs)
on 2014-07-18 13:21
(Received via mailing list)
Can you share your production log? Since it dies after the request is
made
the answer should definitely be in that log file.
F3a6619f5077b3ea54c603efe4d70ae5?d=identicon&s=25 Jiajia Wang (Guest)
on 2014-07-18 13:26
(Received via mailing list)
Unfortunately no errors in server log.

=> Booting Thin
=> Rails 4.0.2 application starting in production on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Thin web server (v1.6.2 codename Doc Brown)
Maximum connections set to 1024
Listening on 0.0.0.0:3000, CTRL+C to stop
I, [2014-07-18T07:23:38.894423 #10672]  INFO -- : Started GET "/" for
121.24.167.143 at 2014-07-18 07:23:38 -0400
I, [2014-07-18T07:23:39.012780 #10672]  INFO -- : Processing by
HomeController#index as HTML
I, [2014-07-18T07:23:39.277530 #10672]  INFO -- :   Rendered
shared/_cms.html.slim (94.6ms)
I, [2014-07-18T07:23:39.279371 #10672]  INFO -- :   Rendered
shared/_cms.html.slim (1.6ms)
I, [2014-07-18T07:23:39.288551 #10672]  INFO -- :   Rendered
shared/_cms.html.slim (9.0ms)
I, [2014-07-18T07:23:39.289601 #10672]  INFO -- :   Rendered
shared/_cms.html.slim (0.9ms)
I, [2014-07-18T07:23:39.290637 #10672]  INFO -- :   Rendered
shared/_cms.html.slim (0.9ms)
I, [2014-07-18T07:23:39.294696 #10672]  INFO -- :   Rendered
home/partials/_video_modal.html.slim (3.4ms)
I, [2014-07-18T07:23:39.296234 #10672]  INFO -- :   Rendered
shared/_cms.html.slim (1.3ms)
I, [2014-07-18T07:23:39.307137 #10672]  INFO -- :   Rendered
shared/_cms.html.slim (0.9ms)
I, [2014-07-18T07:23:39.308554 #10672]  INFO -- :   Rendered
shared/_cms.html.slim (0.9ms)
I, [2014-07-18T07:23:39.326743 #10672]  INFO -- :   Rendered
shared/_cms.html.slim (1.5ms)
I, [2014-07-18T07:23:39.331372 #10672]  INFO -- :   Rendered
sidebar/_free_ebook.html.slim (22.1ms)
I, [2014-07-18T07:23:39.343282 #10672]  INFO -- :   Rendered
shared/_cms.html.slim (1.3ms)
I, [2014-07-18T07:23:39.343573 #10672]  INFO -- :   Rendered
sidebar/_property_calculator.html.slim (11.6ms)
I, [2014-07-18T07:23:39.347515 #10672]  INFO -- :   Rendered
shared/_cms.html.slim (1.2ms)
I, [2014-07-18T07:23:39.348342 #10672]  INFO -- :   Rendered
shared/_newsletter.html.slim (4.2ms)
I, [2014-07-18T07:23:39.361531 #10672]  INFO -- :   Rendered
shared/_reviewers.html.slim (12.6ms)
I, [2014-07-18T07:23:39.361693 #10672]  INFO -- :   Rendered
home/index.html.slim within layouts/application (305.2ms)
Killed
F6a8f6a0c94010f7b6ab011d59e9a906?d=identicon&s=25 Eric MSP Veith (Guest)
on 2014-07-18 13:27
(Received via mailing list)
On Friday 18 July 2014, 16:50:08, Harisankar P S wrote:
> Can you share your production log? Since it dies after the request is made
> the answer should definitely be in that log file.

Could you (i.e., the OP) please also share some details about the
environment,
like O/S, softwares in use, etc.?

      --- Eric
F3a6619f5077b3ea54c603efe4d70ae5?d=identicon&s=25 Jiajia Wang (Guest)
on 2014-07-18 13:31
(Received via mailing list)
AWS Redhat 6.5
RDS mysql
ruby 2.0.0
rails 4.0.2


On Fri, Jul 18, 2014 at 9:25 PM, Eric MSP Veith
<eveith@wwweb-library.net>
F3a6619f5077b3ea54c603efe4d70ae5?d=identicon&s=25 Jiajia Wang (Guest)
on 2014-07-18 16:03
(Received via mailing list)
It's been solved.
However I don't know why.

The problem is assets.
'rake assets:precompile' fixed it.

Thanks guys
A7fca2db6ff3f4583df98043bd5166f9?d=identicon&s=25 Panagiotis Atmatzidis (Guest)
on 2014-07-19 15:22
(Received via mailing list)
Attachment: signature.asc (832 Bytes)
On Jul 18, 2014, at 5:02 PM, Jiajia Wang <jjwang0506@gmail.com> wrote:

> It's been solved.
> However I don't know why.
>
> The problem is assets.
> 'rake assets:precompile' fixed it.

In production ENV the assets (e.g. static assets) are served by the web
server not by rack-servers. So you have to run rake assets:precompile
and configure the web-server to actually serve them.
820e01609a9f8f0fc0d5167680625b93?d=identicon&s=25 Harisankar P S (coderhs)
on 2014-07-19 17:15
(Received via mailing list)
It is a bit strange that the log didn't say anything about the assets
precompile not being done. Usually in the log it would mention that you
are
requred to run assets:precompile. Anyway happy to know that the issue
has
been resolved.

regards,

Harisankar P S


On Sat, Jul 19, 2014 at 6:50 PM, Panagiotis Atmatzidis
<atma@convalesco.org>
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.