"Incomplete response received from the application" from nginx / passenger

I tried to deploy my rails application on nginx and ubuntu using capistrano, for example at https://gorails.com/deploy/ubuntu/14.04 . but in the end I get an error:

Incomplete response received from application 

in my browser. this is probably a passenger mistake, but how can I figure out what to do?

+66
ruby-on-rails nginx passenger
Mar 24 '15 at 19:18
source share
8 answers

Your rails_env project does not have the necessary settings, maybe secret_key_base is missing.

Open /etc/nginx/sites-available/default and change rails_env to development:

 rails_env production; to rails_env development; 

If the application downloads it, this is not a problem with the passenger.

Production Solution:

  • Enter the root of the application
  • run: rake secret
  • copy output
  • go to /yourapp/config/secrets.yml
  • set secret_key_base

Restart the passenger app:

 touch /yourapp/tmp/restart.txt 
+124
Mar 25 '15 at 15:15
source share

This error occurs because you did not set secret_key_base. Follow these steps to fix this:

Go to rails application directory

 cd /path/rails-app 

Creating a secret key database

 rake secret RAILS_ENV=production 

Set environment variable

 SECRET_KEY_BASE=<the-secret-key-base> 

Restart the Rails Application

 touch /path/rails-app/tmp/restart.txt 
+25
Apr 05 '15 at 10:13
source share

For those using Passenger:

• Go to the root of your project.

• run bundle exec rake secret RAILS_ENV=production

• Copy the output and then run sudo nano config/secrets.yml

• In the production process, replace the value of secret_key_base with the newly copied secret rake.

• press CNTRL+X , then press y , then press enter .

passenger-config restart-app and select the application you want to restart.

https://www.phusionpassenger.com/library/admin/apache/restart_app.html

+5
Jun 23 '17 at 17:16
source share

I had this problem on the weekend (it turned out that there was incompatibility between my versions of the passenger and the ruby).

However, no one seems to mention: the actual error may appear in /var/log/apache2/errors.log , and not in any custom log.

As soon as you find out, I hope your search will be easier!




Update, since I needed to return to this again - this is also true for nginx - /var/log/nginx/error.log - your friend in this case!

+5
Dec 11 '17 at 11:26
source share

In my case, this was due to the fact that there was not enough RAM on my server (during PDF generation). After the PDF was generated, some RAM was restored and the error disappeared.

I had a Ubuntu server with 500M of RAM.

I added swap space and this error went away.

+4
Feb 28 '18 at 9:10
source share

This means that your rails application is rebooted before it really gets into rails. This may be an exception in the middleware, the ENV key is missing, something at the OS level.

Try to download the application locally first and do what you did to get a working error. If all is well, check all your magazines. Check the nginx logs, the logs of your passengers, and finally, any other OS-specific logs related to loading and running your application.

+1
Jul 18 '18 at 15:52
source share

My answer may be disabled, but when my mysql database server is not running, I got this error too. Just in case, someone has the same error.

so start/restart your database might be a different answer.

0
Mar 15 '17 at 9:22
source share

Is there anyone like me who got this error after uploading a file?

My solution is to check the name of the file, which may contain some special characters, such as ' [(~ .

Just delete it and upload the file again.

Good luck ~

0
Apr 12 '19 at 5:33
source share



All Articles