> ## Content Index
> Fetch the complete content index at: https://til.codes/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to fix Incomplete response received from application from nginx / passenger in a rails application
- URL: https://til.codes/how-to-fix-incomplete-response-received-from-application-from-nginx-passenger-in-a-rails-application/
- Published: 2016-05-07T17:08:00.000Z
- Updated: 2016-12-16T06:08:06.000Z
- Author: Manu Ajith
- Tags: rails, passenger, nginx, #Import 2024-07-13 21:01

I was trying to deploy a simple rails application( stack is Ruby 2.2.4, Rails 4.2.5, with passenger/Nginx as application/web server) to AWS EC2 and I was getting a weird error.

```
Incomplete response received from application

```

And looking at the Nginx/passenger logs I wasn't able to figure out the issue first hand. Then == I tried to debug in detail and changed the `passenger_app_env` to development == so that I can see the debug logs in details and voila.!! I figured out how stupid I was.

Checking the logs, I see:

```
app error: Missing `secret_token` and `secret_key_base` for 'production' environment

```

\== Yep, you got it right, I forgot to set the `secret_token` in my env, and it caused the error. ==

After generating the `secret_token` using

```
RAILS_ENV=production rake secret

```

and exporting it to the bash env using:

```
export SECRET_KEY_BASE=secret_token

```

and restarting Nginx using

```
touch tmp/restart.txt

```

I was able to bring my rails app online.

As they say:

> Making mistakes simply mean you are learning faster. \~Weston H. Agor

Hope I save someone's time in future. :)