1
votes

I can not find my error...and how to fix it.

it seem to have 2 errors

cat /var/log/nginx/error.log

    /usr/lib/ruby/vendor_ruby/phusion_passenger/preloader_shared_helpers.rb:69:in `fork'

    Cannot allocate memory - fork(2) (Errno::ENOMEM)
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/preloader_shared_helpers.rb:69:in `accept_and_process_next_client'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/preloader_shared_helpers.rb:139:in `run_main_loop'
    from /usr/share/passenger/helper-scripts/rack-preloader.rb:154:in `<module:App>'
    from /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
    from /usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `<main>'
    : Could not spawn process for application /home/ubuntu/timetable: An error occurred while starting the web application. It exited before signalling successful startup back to Phusion Passenger.
      Error ID: 2d3d1156
      Error details saved to: /tmp/passenger-error-jzMFIA.html
      Message from application: An error occurred while starting the web application. It exited before signalling successful startup back to Phusion Passenger. Please read <a href="https://github.com/phusion/passenger/wiki/Debugging-application-startup-problems">this article</a> for more information about this problem.<br>



    [ 2016-01-26 04:32:31.3265 26971/7f99b78c9700 Spa/SmartSpawner.h:726 ]: 

An error occurred while spawning a process: An error occurred while starting the web application. It exited before signalling successful startup back to Phusion Passenger.
    [ 2016-01-26 04:32:31.3265 26971/7f99b78c9700 Spa/SmartSpawner.h:727 ]: The application preloader seems to have crashed, restarting it and trying again...
    App 29879 stdout:
    App 29879 stderr:  --> Compiling passenger_native_support.so for the current Ruby interpreter...
    App 29879 stderr:
    App 29879 stderr:      (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
    App 29879 stderr:
    App 29879 stderr:      Warning: compilation didn't succeed. To learn why, read this file:
    App 29879 stderr:      /tmp/passenger_native_support-ttojm4.log
    App 29879 stderr:  --> Downloading precompiled passenger_native_support.so for the current Ruby interpreter...
    App 29879 stderr:      (set PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY=0 to disable)
    App 29879 stderr:      Could not download https://oss-binaries.phusionpassenger.com/binaries/passenger/by_release/5.0.18/rubyext-ruby-2.2.2-x86_64-linux.tar.gz: no download tool found (curl or wget required)
    App 29879 stderr:      Trying next mirror...
    App 29879 stderr:      Could not download https://s3.amazonaws.com/phusion-passenger/binaries/passenger/by_release/5.0.18/rubyext-ruby-2.2.2-x86_64-linux.tar.gz: no download tool found (curl or wget required)
    App 29879 stderr:  --> Continuing without passenger_native_support.so.
    App 29879 stderr:
    [ 2016-01-26 04:32:40.3811 26971/7f99dbb3b700 App/Poo/AnalyticsCollection.cpp:60 ]: ERROR: Cannot fork() a new process: Cannot allocate memory (errno=12)
      Backtrace:
         in 'void Passenger::ApplicationPool2::Pool::realCollectAnalytics()' (AnalyticsCollection.cpp:185)
         in 'static void Passenger::ApplicationPool2::Pool::collectAnalytics(Passenger::ApplicationPool2::PoolPtr)' (AnalyticsCollection.cpp:55)



    [ 2016-01-26 04:32:45.4877 26971/7f99dbb3b700 App/Poo/AnalyticsCollection.cpp:60 ]: ERROR: Cannot fork() a new process: Cannot allocate memory (errno=12)
      Backtrace:
         in 'void Passenger::ApplicationPool2::Pool::realCollectAnalytics()' (AnalyticsCollection.cpp:185)
         in 'static void Passenger::ApplicationPool2::Pool::collectAnalytics(Passenger::ApplicationPool2::PoolPtr)' (AnalyticsCollection.cpp:55)




    [ 2016-01-26 04:32:50.5652 26971/7f99dbb3b700 App/Poo/AnalyticsCollection.cpp:60 ]: ERROR: Cannot fork() a new process: Cannot allocate memory (errno=12)
      Backtrace:
         in 'void Passenger::ApplicationPool2::Pool::realCollectAnalytics()' (AnalyticsCollection.cpp:185)
         in 'static void Passenger::ApplicationPool2::Pool::collectAnalytics(Passenger::ApplicationPool2::PoolPtr)' (AnalyticsCollection.cpp:55)

    [ 2016-01-26 04:32:55.8830 26971/7f99dbb3b700 App/Poo/AnalyticsCollection.cpp:60 ]: ERROR: Cannot fork() a new process: Cannot allocate memory (errno=12)
      Backtrace:
         in 'void Passenger::ApplicationPool2::Pool::realCollectAnalytics()' (AnalyticsCollection.cpp:185)
         in 'static void Passenger::ApplicationPool2::Pool::collectAnalytics(Passenger::ApplicationPool2::PoolPtr)' (AnalyticsCollection.cpp:55)

    [ 2016-01-26 04:33:01.1370 26971/7f99dbb3b700 App/Poo/AnalyticsCollection.cpp:104 ]: Process (pid=28934, group=/home/ubuntu/timetable/public (development)) no longer exists! Detaching it from the pool.
    [ 2016-01-26 04:33:01.1509 26971/7f99dbb3b700 age/Cor/CoreMain.cpp:794 ]: Disconnecting long-running connections for process 28934, application /home/ubuntu/timetable/public (development)
    App 29879 stderr: sh: 1:
    App 29879 stderr: env: not found
    App 29906 stdout:

how to solve this problem.. I spent searching this problem in 2 days.

I use aws ec2, nginx + passenger, ruby on rails

1
It seems like you don't have enough RAM. Do you use t2.nano instance?Van Huy

1 Answers

1
votes

I had the same issue.

Try to restart some services to avoid running out of ram, else get a bigger instance.

Restarting sql worked for me on my t1.micro.