How do I know if images are being cached properly? - ruby-on-rails

I'm hosting a Rails app on Heroku and not sure if my static images are being cached or not. Below are my logs from loading the same image three times. Are the last two requests being served from the cache? What does "stale, invalid, store" mean?
These are just static assets and I'm not using the asset pipeline in Rails 3.1
2012-01-24T03:37:27+00:00 app[web.1]: cache: [GET /images/offer-new-reward-button.png?1327376077] miss, store
2012-01-24T03:37:27+00:00 heroku[nginx]: (ip) - - [24/Jan/2012:03:37:27 +0000] "GET /images/offer-new-reward-button.png?1327376077 HTTP/1.1" 200 3692 "-" "curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5" myapp.heroku.com
2012-01-24T03:37:27+00:00 heroku[router]: GET myapp.heroku.com/images/offer-new-reward-button.png dyno=web.1 queue=0 wait=0ms service=8ms status=200 bytes=3692
2012-01-24T03:37:52+00:00 app[web.1]: cache: [GET /images/offer-new-reward-button.png?1327376077] stale, invalid, store
2012-01-24T03:37:52+00:00 heroku[nginx]: (ip) - - [24/Jan/2012:03:37:52 +0000] "GET /images/offer-new-reward-button.png?1327376077 HTTP/1.1" 200 3692 "-" "curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5" myapp.heroku.com
2012-01-24T03:37:52+00:00 heroku[router]: GET myapp.heroku.com/images/offer-new-reward-button.png dyno=web.1 queue=0 wait=0ms service=6ms status=200 bytes=3692
2012-01-24T03:38:25+00:00 app[web.1]: cache: [GET /images/offer-new-reward-button.png?1327376077] stale, invalid, store
2012-01-24T03:38:25+00:00 heroku[router]: GET myapp.heroku.com/images/offer-new-reward-button.png dyno=web.1 queue=0 wait=0ms service=7ms status=200 bytes=3692
2012-01-24T03:38:25+00:00 heroku[nginx]: (ip) - - [24/Jan/2012:03:38:25 +0000] "GET /images/offer-new-reward-button.png?1327376077 HTTP/1.1" 200 3692 "-" "curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5" myapp.heroku.com

As you appear to NOT be running on the Cedar stack, your static files should automatically be cached with Varnish.
More info here: http://devcenter.heroku.com/articles/http-caching
To test your caching, simply get one of the images and look at the response headers. You should see the caching headers set here along with a via header from Varnish.

Related

Heroku H18 error in a Rails app on an unhandled route

I'm getting mysterious H18 errors on Heroku. Theses requests seems to be made by bots or crawlers sending POST requests on the root URL of my application. What concerns me is that these requests all take more than 30 seconds to process before they get terminated, most likely by a timeout. Here is a sample of my log file and Metric graph:
Dec 14 03:52:26 poll-en heroku/router sock=backend at=error code=H18 desc="Server Request Interrupted" method=POST path="/" host=app.do request_id=72252a6a-d4b5-4ecc-ae3c-bc69c273eb16 fwd="138.201.76.138" dyno=web.1 connect=1ms service=30034ms status=503 bytes=71 protocol=http
Dec 14 04:05:11 poll-en heroku/router sock=backend at=error code=H18 desc="Server Request Interrupted" method=POST path="/" host=app.do request_id=78ea5ae4-9e8a-4c90-b26e-c2eae40116b4 fwd="148.251.231.105" dyno=web.1 connect=0ms service=31392ms status=503 bytes=71 protocol=http
Dec 14 04:19:07 poll-en heroku/router sock=backend at=error code=H18 desc="Server Request Interrupted" method=POST path="/" host=app.do request_id=bcc76545-24e0-4fc7-8e63-a08bb463bb31 fwd="148.251.231.105" dyno=web.1 connect=0ms service=30195ms status=503 bytes=71 protocol=http
Dec 14 04:45:35 poll-en heroku/router sock=backend at=error code=H18 desc="Server Request Interrupted" method=POST path="/" host=app.do request_id=87efe086-9879-4506-a7ac-52504219126d fwd="144.76.141.230" dyno=web.1 connect=0ms service=31733ms status=503 bytes=71 protocol=http
My application doesn't handle POST requests on the root URL and I can't replicate the error using cURL. Just to be sure, I also added a Rack Middleware that runs first and terminates all POST requests on the root URL. So the request shouldn't even reach the Rails router but I still get these H18 errors in my log file.
How can this happen? What kind of request could hang for 30 seconds when it is not even reaching my app?
What version of Puma are you using and what does your Puma config look like?
Heroku documents that the request do reach your app when H18 happens:
An H18 signifies that the socket connected, some data was sent as part of a response by the app, but then the socket was destroyed without completing the response.
Perhaps you are experiencing this bug in Puma, where is sounds like the request can be stuck in Puma (never reaching your app): https://github.com/puma/puma/issues/2282 (solved in Puma 5.0.3 and above)
You could try setting first_data_timeout in your Puma config to something that's lower than 30 seconds. Then Puma should respond with 408 Request Timeout before Heroku gives you the H18 error.

How to handle someone trying to hack my website?

I'm going through my 404 logs and I noticed this:
302 <158>1 2018-10-20T19:12:36.942085+00:00 heroku router - - at=info method=GET path="/wp-login.php" host=www.makerspro.io request_id=f5929aab-8671-433e-92d0-1e779f997d0a fwd="194.99.106.147" dyno=web.1 connect=0ms service=1923ms status=404 bytes=6042 protocol=http
307 <158>1 2018-10-20T19:12:39.076998+00:00 heroku router - - at=info method=GET path="/blog/wp-login.php" host=www.makerspro.io request_id=ce175bfd-6411-48c2-9328-1b6fccb6ae30 fwd="194.99.106.147" dyno=web.1 connect=0ms service=1629ms status=404 bytes=6042 protocol=http
305 <158>1 2018-10-20T19:12:40.699840+00:00 heroku router - - at=info method=GET path="/wp/wp-login.php" host=www.makerspro.io request_id=17bd87b1-3d8f-48bb-8748-ff9d47250dba fwd="194.99.106.147" dyno=web.1 connect=0ms service=1420ms status=404 bytes=6042 protocol=http
312 <158>1 2018-10-20T19:12:42.599811+00:00 heroku router - - at=info method=GET path="/wordpress/wp-login.php"
My website is built on rails, I'm the only developer and it seems like someone is trying to hack my website.
Of course, I don't have wordpress installed or anything like that.
What can I do about this and how can I prevent future attacks?
These are generic attacks that happen constantly, and is done by scripts.
The best course is to make sure you are not vulnerable, then ignore them. If you do not have Wordpress, then you have nothing to worry about regarding requests to /wp-login.php.
If you want to harden your application, make sure you have security measures like described in the RoR documentation (https://guides.rubyonrails.org/security.html).

heroku[router] gets old and wrong url

I have a rails app deployed on heroku, and there is an annoying issue: my router heroku gets an url that doesn't exist anymore (I have deleted everything on my WebApp regarding the notifications).
Do you have any idea where it could come from?
Here are what my logs :
2015-06-25T12:22:30.357205+00:00 heroku[router]: at=info method=GET path="/notifications" host=www.krawd.com request_id=6b03fbec-88ee-48bd-8afd-aa6d59a9bf53 fwd="82.237.217.103" dyno=web.1 connect=1ms service=12ms status=500 bytes=377
2015-06-25T12:22:30.334224+00:00 app[web.3]: source=rack-timeout id=8b3b9046-8613-44fb-8274-c0dc976d3472 wait=16ms timeout=25000ms state=ready
2015-06-25T12:22:30.362821+00:00 app[web.3]: source=rack-timeout id=8b3b9046-8613-44fb-8274-c0dc976d3472 wait=16ms timeout=25000ms service=29ms state=active
2015-06-25T12:22:30.406680+00:00 app[web.3]: Completed 500 Internal Server Error in 25ms
2015-06-25T12:22:30.341720+00:00 app[web.1]: source=rack-timeout id=6b03fbec-88ee-48bd-8afd-aa6d59a9bf53 wait=0ms timeout=25000ms service=0ms state=active
2015-06-25T12:22:30.344956+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/notifications"):
Make sure you search your web app folder for "/notifications" and see if you forgot some reference somewhere. Does the request happen when you run on localhost? You could trace it more easily that way.

Rails 3.1 + Heroku: Can someone help me decipher this Heroku log?

I'm experiencing this intermittent issue where my client is receiving multiple JSON responses from (I think) a single HTTP request to my Rails server on Heroku. Here's the Heroku log showing the issue...
2012-04-20T00:22:27+00:00 app[web.1]: Started POST "/games/2/call" for 76.171.181.11 at 2012-04-19 17:22:27 -0700
2012-04-20T00:22:27+00:00 app[web.1]: Processing by GamesController#call as */*
2012-04-20T00:22:27+00:00 app[web.1]: Parameters: {"fb_id"=>"0", "id"=>"2"}
2012-04-20T00:22:27+00:00 app[web.1]: Completed 200 OK in 163ms (Views: 0.3ms | ActiveRecord: 93.3ms)
2012-04-20T00:22:27+00:00 heroku[router]: POST myapp.heroku.com/games/2/call dyno=web.1 queue=0 wait=0ms service=4594ms status=200 bytes=2013
2012-04-20T00:22:27+00:00 app[web.1]: cache: [POST /games/2/call] invalidate, pass
2012-04-20T00:22:27+00:00 heroku[router]: POST myapp.heroku.com/games/2/call dyno=web.1 queue=0 wait=0ms service=4546ms status=200 bytes=2013
2012-04-20T00:22:27+00:00 heroku[router]: POST myapp.heroku.com/games/2/call dyno=web.1 queue=0 wait=0ms service=4594ms status=200 bytes=2012
2012-04-20T00:22:27+00:00 heroku[router]: POST myapp.heroku.com/games/2/call dyno=web.1 queue=0 wait=0ms service=4570ms status=200 bytes=2013
2012-04-20T00:22:27+00:00 heroku[router]: POST myapp.heroku.com/games/2/call dyno=web.1 queue=0 wait=0ms service=4560ms status=200 bytes=2013
2012-04-20T00:22:27+00:00 heroku[router]: POST myapp.heroku.com/games/2/call dyno=web.1 queue=0 wait=0ms service=4534ms status=200 bytes=2013
2012-04-20T00:22:27+00:00 heroku[nginx]: 76.171.181.11 - - [20/Apr/2012:00:22:27 +0000] "POST /games/2/call HTTP/1.1" 200 560 "http://myapp.heroku.com/pages/fb/webplayer_64.unity3d" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19" myapp.heroku.com
2012-04-20T00:22:27+00:00 heroku[nginx]: 76.171.181.11 - - [20/Apr/2012:00:22:27 +0000] "POST /games/2/call HTTP/1.1" 200 560 "http://myapp.heroku.com/pages/fb/webplayer_64.unity3d" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19" myapp.heroku.com
2012-04-20T00:22:27+00:00 heroku[nginx]: 76.171.181.11 - - [20/Apr/2012:00:22:27 +0000] "POST /games/2/call HTTP/1.1" 200 539 "http://myapp.heroku.com/pages/fb/webplayer_64.unity3d" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19" myapp.heroku.com
2012-04-20T00:22:27+00:00 heroku[nginx]: 207.151.231.155 - - [20/Apr/2012:00:22:27 +0000] "POST /games/2/call HTTP/1.1" 200 540 "http://myapp.heroku.com/pages/fb/webplayer_64.unity3d" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19" myapp.heroku.com
2012-04-20T00:22:27+00:00 heroku[nginx]: 207.151.231.155 - - [20/Apr/2012:00:22:27 +0000] "POST /games/2/call HTTP/1.1" 200 540 "http://myapp.heroku.com/pages/fb/webplayer_64.unity3d" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19" myapp.heroku.com
2012-04-20T00:22:27+00:00 heroku[nginx]: 207.151.32.38 - - [20/Apr/2012:00:22:27 +0000] "POST /games/2/call HTTP/1.1" 200 540 "http://myapp.heroku.com/pages/fb/webplayer_64.unity3d" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19" myapp.heroku.com
2012-04-20T00:22:27+00:00 heroku[nginx]: 108.70.74.121 - - [20/Apr/2012:00:22:27 +0000] "POST /games/2/call HTTP/1.1" 200 540 "http://myapp.heroku.com/pages/fb/webplayer_64.unity3d" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19"
I'm new to Rails and Heroku, so I can't quite understand this log enough to figure out what's happening. Is my Rails app on Heroku receiving multiple HTTP requests from my client, or is it only receiving one HTTP request and returning multiple JSON responses?
Thanks so much in advance for your wisdom!
It's getting 7 POST requests at the same time:
# First Request, heroku starts to process it normally
2012-04-20T00:22:27+00:00 app[web.1]: Started POST "/games/2/call" for 76.171.181.11 at 2012-04-19 17:22:27 -0700
2012-04-20T00:22:27+00:00 app[web.1]: Processing by GamesController#call as */*
2012-04-20T00:22:27+00:00 app[web.1]: Parameters: {"fb_id"=>"0", "id"=>"2"}
# First request returns OK
2012-04-20T00:22:27+00:00 app[web.1]: Completed 200 OK in 163ms (Views: 0.3ms | ActiveRecord: 93.3ms)
# Second request starts
2012-04-20T00:22:27+00:00 heroku[router]: POST myapp.heroku.com/games/2/call dyno=web.1 queue=0 wait=0ms service=4594ms status=200 bytes=2013
# It looks like the second request fails
2012-04-20T00:22:27+00:00 app[web.1]: cache: [POST /games/2/call] invalidate, pass
# Request 3-7 come in
2012-04-20T00:22:27+00:00 heroku[router]: POST myapp.heroku.com/games/2/call dyno=web.1 queue=0 wait=0ms service=4546ms status=200 bytes=2013
2012-04-20T00:22:27+00:00 heroku[router]: POST myapp.heroku.com/games/2/call dyno=web.1 queue=0 wait=0ms service=4594ms status=200 bytes=2012
2012-04-20T00:22:27+00:00 heroku[router]: POST myapp.heroku.com/games/2/call dyno=web.1 queue=0 wait=0ms service=4570ms status=200 bytes=2013
2012-04-20T00:22:27+00:00 heroku[router]: POST myapp.heroku.com/games/2/call dyno=web.1 queue=0 wait=0ms service=4560ms status=200 bytes=2013
2012-04-20T00:22:27+00:00 heroku[router]: POST myapp.heroku.com/games/2/call dyno=web.1 queue=0 wait=0ms service=4534ms status=200 bytes=2013
# Heroku responds to the requests... though I'm not sure what it's serving up.
2012-04-20T00:22:27+00:00 heroku[nginx]: 76.171.181.11 - - [20/Apr/2012:00:22:27 +0000] "POST /games/2/call HTTP/1.1" 200 560 "http://myapp.heroku.com/pages/fb/webplayer_64.unity3d" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19" myapp.heroku.com
2012-04-20T00:22:27+00:00 heroku[nginx]: 76.171.181.11 - - [20/Apr/2012:00:22:27 +0000] "POST /games/2/call HTTP/1.1" 200 560 "http://myapp.heroku.com/pages/fb/webplayer_64.unity3d" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19" myapp.heroku.com
2012-04-20T00:22:27+00:00 heroku[nginx]: 76.171.181.11 - - [20/Apr/2012:00:22:27 +0000] "POST /games/2/call HTTP/1.1" 200 539 "http://myapp.heroku.com/pages/fb/webplayer_64.unity3d" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19" myapp.heroku.com
2012-04-20T00:22:27+00:00 heroku[nginx]: 207.151.231.155 - - [20/Apr/2012:00:22:27 +0000] "POST /games/2/call HTTP/1.1" 200 540 "http://myapp.heroku.com/pages/fb/webplayer_64.unity3d" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19" myapp.heroku.com
2012-04-20T00:22:27+00:00 heroku[nginx]: 207.151.231.155 - - [20/Apr/2012:00:22:27 +0000] "POST /games/2/call HTTP/1.1" 200 540 "http://myapp.heroku.com/pages/fb/webplayer_64.unity3d" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19" myapp.heroku.com
2012-04-20T00:22:27+00:00 heroku[nginx]: 207.151.32.38 - - [20/Apr/2012:00:22:27 +0000] "POST /games/2/call HTTP/1.1" 200 540 "http://myapp.heroku.com/pages/fb/webplayer_64.unity3d" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19" myapp.heroku.com
2012-04-20T00:22:27+00:00 heroku[nginx]: 108.70.74.121 - - [20/Apr/2012:00:22:27 +0000] "POST /games/2/call HTTP/1.1" 200 540 "http://myapp.heroku.com/pages/fb/webplayer_64.unity3d" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19"
I've had issues like this occasionally -- Javascript requests that bubble up the DOM and fire multiple times when I only meant them to fire once. This can crash a server pretty fast, so you should definitely look at your app and make sure you're not rapid-fire triggering AJAX calls.
A really easy way to catch this is to put an alert() immediately before or after any ajax call and see how many times it fires vs. how many you expect it to.
I don't know if that's your problem, but I've had that kind of thing happen to me before.

sign-in-with-twitter is not working on Heroku - Rails 3.1

I am using the oa-auth and twitter gem, via this example: https://github.com/sferik/sign-in-with-twitter
When I try to sign in with the button, this is what I see in my logs on Heroku, even though this works perfectly in development:
Started GET "/assets/sign-in-with-twitter-56f86819ac755692904d912373db060b.png" for XX.XX.XXX.XX3 at 2011-10-06 10:27:32 -0700
2011-10-06T17:27:32+00:00 app[web.1]: cache: [GET /assets/sign-in-with-twitter-56f86819ac755692904d912373db060b.png] miss, store
2011-10-06T17:27:32+00:00 heroku[router]: GET domain.heroku.com/assets/sign-in-with-twitter-56f86819ac755692904d912373db060b.png dyno=web.1 queue=0 wait=0ms service=21ms status=200 bytes=2490
2011-10-06T17:27:32+00:00 heroku[nginx]: xx.xx.xxx.xx - - [06/Oct/2011:10:27:32 -0700] "GET /assets/sign-in-with-twitter-56f86819ac755692904d912373db060b.png HTTP/1.1" 200 2490 "http://domain.heroku.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1" mydomain.heroku.com
2011-10-06T17:27:56+00:00 app[web.1]:
2011-10-06T17:27:56+00:00 app[web.1]:
2011-10-06T17:27:56+00:00 app[web.1]: Started GET "/auth/twitter?utf8=%E2%9C%93&commit.x=171&commit.y=8&commit=Sign+in" for xx.xxx.xxx.xx at 2011-10-06 10:27:56 -0700
2011-10-06T17:27:56+00:00 app[web.1]: cache: [GET /auth/twitter?utf8=%E2%9C%93&commit.x=171&commit.y=8&commit=Sign+in] miss
2011-10-06T17:27:56+00:00 heroku[router]: GET mydomain.heroku.com/auth/twitter dyno=web.1 queue=0 wait=0ms service=370ms status=302 bytes=113
2011-10-06T17:27:56+00:00 heroku[nginx]: xx.xxx.xxx.xx - - [06/Oct/2011:10:27:56 -0700] "GET /auth/twitter?utf8=%E2%9C%93&commit.x=171&commit.y=8&commit=Sign+in HTTP/1.1" 302 113 "http://mydomain.heroku.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1" mydomain.heroku.com
2011-10-06T17:27:57+00:00 app[web.1]:
2011-10-06T17:27:57+00:00 app[web.1]:
2011-10-06T17:27:57+00:00 app[web.1]: Started GET "/auth/twitter/callback?utf8=%E2%9C%93&commit.x=171&commit.y=8&commit=Sign+in&oauth_token=eiJ1oauth_verifier=JfqNp7P7lw5g" for xx.xxx.xxx.xx at 2011-10-06 10:27:57 -0700
2011-10-06T17:27:57+00:00 app[web.1]: Processing by SessionsController#create as HTML
2011-10-06T17:27:57+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "commit.x"=>"171", "commit.y"=>"8", "commit"=>"Sign in", "oauth_token"=>"eiVMHybiNjtGOM13ytYTbgkI", "oauth_verifier"=>"JzX1BHjZVA4Z5EiFhq4mw5g"}
2011-10-06T17:27:59+00:00 app[web.1]: Completed 500 Internal Server Error in 1212ms
2011-10-06T17:27:59+00:00 app[web.1]: cache: [GET /auth/twitter/callback?utf8=%E2%9C%93&commit.x=171&commit.y=8&commit=Sign+in&oauth_token=VMHybiNjtGOM13ytYTbgkI&oauth_verifier=JfqNp7adsasdaf3245453462462462dmw5g] miss
2011-10-06T17:27:59+00:00 heroku[router]: GET mydomain.heroku.com/auth/twitter/callback dyno=web.1 queue=0 wait=0ms service=1992ms status=302 bytes=0
2011-10-06T17:27:59+00:00 heroku[nginx]: xx.xxx.xxx.xx - - [06/Oct/2011:10:27:59 -0700] "GET /auth/twitter/callback?utf8=%E2%9C%93&commit.x=171&commit.y=8&commit=Sign+in&oauth_token=eiJ1KQbgkI&oauth_verifier=Jq4mw5g HTTP/1.1" 302 0 "http://mydomain.heroku.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1" mydomain.heroku.com
2011-10-06T17:27:59+00:00 app[web.1]:
2011-10-06T17:27:59+00:00 app[web.1]:
2011-10-06T17:27:59+00:00 app[web.1]: Started GET "/auth/failure?message=invalid_response" for xx.xxxx.xxx.x at 2011-10-06 10:27:59 -0700
2011-10-06T17:27:59+00:00 app[web.1]: Processing by SessionsController#error as HTML
2011-10-06T17:27:59+00:00 app[web.1]: Parameters: {"message"=>"invalid_response"}
2011-10-06T17:27:59+00:00 app[web.1]: Redirected to http://mydomain.heroku.com/
2011-10-06T17:27:59+00:00 app[web.1]: Completed 302 Found in 1ms
2011-10-06T17:27:59+00:00 app[web.1]: cache: [GET /auth/failure?message=invalid_response] miss
2011-10-06T17:27:59+00:00 heroku[router]: GET mydomain.com/auth/failure dyno=web.1 queue=0 wait=0ms service=31ms status=302 bytes=99
2011-10-06T17:27:59+00:00 heroku[nginx]: xx.xx.xxx.xx - - [06/Oct/2011:10:27:59 -0700] "GET /auth/failure?message=invalid_response HTTP/1.1" 302 99 "http://mydomain.heroku.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1" mydomain.heroku.com
I already have everything configured and working in development, but the first time I pushed it to Heroku it doesn't work.
I also added my config vars to Heroku and that seems to be fine.
What should I do?
Thanks.
mydomain.heroku.com is not a valid application. Twitter needs a valid URL to callback to.
So it seems that there was something wrong in my code - specifically the create action of my sessions controller. It wasn't finding the user credentials once the auth credentials were returned.

Resources