WebFaction
Community site: login faq

Followed the directions here: http://docs.webfaction.com/software/rails.html

And I have a new app called lab95.

In my nginx/conf/nginx.conf file I have:

server {
    listen             19855;
    passenger_enabled  on;
    root               /home/vegan/webapps/lab95ror/lab95/public;

However, I get a "passenger" error when I try to access the page.

http://vegan.webfactional.com/

asked 11 Jun '13, 17:27

vegan
31411
accept rate: 50%


I don't know why I'm posting this but here is the solution:

Hello,

There appears to be something wrong with my setup where my production environment, using mysql will not work (website says "We're sorry, but something went wrong.") but using development (sqlite3) works just fine.

I found the true cause of your error by setting the following value in your environments/production.rb file:

config.consider_all_requests_local = true

Here was the result (shown on the error page instead of the default worthless "something went wrong" message):

Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError in Home#index Showing /home/vegan/webapps/lab95ror/lab95/app/views/layouts/application.html.erb where line #5 raised: kickstrap.css isn't precompiled

..So your problem was being caused by non-pre-compiled assets. I told Rails to auto-compile your assets by setting this in production.rb:

config.assets.compile = true

Now your site works: http://vegan.webfactional.com/

(I also disabled the "consider_all_requests_local" setting for your security.)

Please do me a favor: summarize and post this solution onto the Community page so other people can also benefit from this solution.

Let me know if you have any questions.

Regards,

Christopher S. WebFaction Support

permanent link

answered 13 Jun '13, 13:25

vegan
31411
accept rate: 50%

You're posting it so that other users who run into the same problem can benefit from the solution. :)

(13 Jun '13, 13:41) seanf

Obviously, seanf. The emphasis was on the letter "I", not on the act of posting it at all.

(13 Jun '13, 14:04) vegan

The nginx log should provide more verbosity if you change the error log level to debug,

# edit ./nginx/conf/nginx.conf
error_log /path/to/file debug;

With this data you should be able to figure out why passenger is failing.

permanent link

answered 11 Jun '13, 21:57

johns
5.3k312
accept rate: 23%

Thanks, @johns

However, last night the problem got worse, as I cannot start or stop the server itself:

[vegan@web349 lab95]$ ../bin/start
nginx: [emerg] bind() to 0.0.0.0:19855 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:19855 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:19855 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:19855 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:19855 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[vegan@web349 lab95]$ rails server
-bash: rails: command not found
[vegan@web349 lab95]$ ../bin/stop
../bin/stop: line 7: kill: (25709) - No such process
[vegan@web349 lab95]$
(12 Jun '13, 06:36) vegan

The pid in your ~/webapps/<application>/nginx/logs/nginx.pid does not match your current running nginx process. You will need to manually kill the process by first getting a list of your processes:

ps -u username -o pid,command

Then kill the nginx processes with:

kill <PID>

After that you should be able to start with the standard bin/start and stop with bin/stop since the pid in nginx.pid should match now.

(12 Jun '13, 07:51) timg ♦♦

Thanks. I killed those processes, the server is back up, I finally got it to write to the mysql database, now it just says "We're sorry, but something went wrong." on the page.

The error log has been changed to verbose and now says:

[ 2013-06-12 13:37:34.0315 1490/7f748cb3a720 agents/HelperAgent/Main.cpp:554 ]: PassengerHelperAgent online, listening at unix:/home/vegan/webapps/lab95ror/tmp/passenger.1.0.1486/generation-0/request.socket
[ 2013-06-12 13:37:34.0359 1495/7f6e3c9747e0 agents/LoggingAgent/Main.cpp:272 ]: PassengerLoggingAgent online, listening at unix:/home/vegan/webapps/lab95ror/tmp/passenger.1.0.1486/generation-0/logging.socket
[ 2013-06-12 13:37:38.5494 1490/7f748ca43700 Pool2/Spawner.h:739 ]: [App 1586 stdout]
[ 2013-06-12 13:37:39.7785 1490/7f748ca02700 Pool2/Spawner.h:159 ]: [App 1586 stderr]         SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
[ 2013-06-12 13:37:39.7786 1490/7f748ca02700 Pool2/Spawner.h:159 ]: [App 1586 stderr]         This poses a security threat. It is strongly recommended that you
[ 2013-06-12 13:37:39.7786 1490/7f748ca02700 Pool2/Spawner.h:159 ]: [App 1586 stderr]         provide a secret to prevent exploits that may be possible from crafted
[ 2013-06-12 13:37:39.7786 1490/7f748ca02700 Pool2/Spawner.h:159 ]: [App 1586 stderr]         cookies. This will not be supported in future versions of Rack, and
[ 2013-06-12 13:37:39.7786 1490/7f748ca02700 Pool2/Spawner.h:159 ]: [App 1586 stderr]         future versions will even invalidate your existing user cookies.
[ 2013-06-12 13:37:39.7786 1490/7f748ca02700 Pool2/Spawner.h:159 ]: [App 1586 stderr]
[ 2013-06-12 13:37:39.7786 1490/7f748ca02700 Pool2/Spawner.h:159 ]: [App 1586 stderr]         Called from: /home/vegan/webapps/lab95ror/gems/gems/actionpack-3.2.3/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.
(12 Jun '13, 08:41) vegan

I followed the instructions here: http://docs.webfaction.com/software/rails.html#installing-multiple-gems-with-bundler

When I switched the env to development, it worked fine, switching back to production, it gave me the same error.

So I assume it has something to do with mysql. However, looking at the phpmyadmin of my mysql db, everything migrated and installed correctly (it appears).

(12 Jun '13, 09:08) vegan

Please open a ticket at our support site so that we can look at your setup, and we'll help you find the cause of the issue.

(12 Jun '13, 09:31) timg ♦♦

Thank you. I've submitted a ticket.

(12 Jun '13, 09:45) vegan
showing 5 of 6 show 1 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×108
×81
×25

question asked: 11 Jun '13, 17:27

question was seen: 3,313 times

last updated: 13 Jun '13, 14:04

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM