0

I recently updated my gemfile, and noticed the server logging the following in my dev environment - ActionController::RoutingError (No route matches [GET] "/generic.png")

On production (Heroku) - I get the following -

Started GET "/users/generic.png"
ActiveRecord::RecordNotFound (Couldn't find User with 'id'=generic):

Has anybody else encountered this? It's not breaking the app, but it is a mystery to me.

I'm using devise and cancancan. I've run a search on my code, and the only place generic.png is mentioned that I can see is in the log, which makes me think it's buried somewhere in a gem.

dan
  • 1,030
  • 1
  • 9
  • 24
  • Devise checks for /users/:id as its default path. In case any image is being stored on same path or being referenced, error may be coming up – Bijendra Oct 16 '14 at 12:58
  • generic is just an image , why is it getting called from user ? –  Oct 16 '14 at 12:59
  • Also check places in view files from where generic.png is being called – Bijendra Oct 16 '14 at 13:01
  • Where is the image located in your application structure ? Is it under assets/images or under /public ? –  Oct 16 '14 at 13:18

1 Answers1

0

It seems that you have image generic.png on page /users/ and it is tried to be fetched under /users/ instead of assets? Now it tries to look for user with id generic and with response type png (like json or html) which doesn't probably either exist.

Roope Hakulinen
  • 7,326
  • 4
  • 43
  • 66
  • Using Devise, a lot of the user pages are, I believe, buried in the gem - I've searched my code and cannot find any mention of the file. I've updated the q accordingly. – dan Oct 16 '14 at 13:07
  • Well, in that case it can be caused by just some accident. For example if you try to access _http:///users/generic.png_ you should get same error message in there? – Roope Hakulinen Oct 16 '14 at 13:09
  • When I put in the url as you suggested the app crashes, and the dev log has `ActiveRecord::RecordNotFound (Couldn't find User with 'id'=generic):` – dan Oct 16 '14 at 13:14
  • Which in turn is what you got earlier. This was just to show that it can happen by trying to accidentally access that URL by anyone, so maybe you should just let it go for this time and if it keeps happening, take an another look into it. – Roope Hakulinen Oct 16 '14 at 13:18
  • Thanks Sanfor - probably very good advice. Working on a different bit of the app, I've just discovered - `Started GET "/chapters/generic.png" for 127.0.0.1 at 2014-10-16 14:30:19 +0100 Processing by ChaptersController#show as PNG` - it's something odd, but it ain't killing anything at the mo. Cheers, Dan – dan Oct 16 '14 at 13:49
  • Hey, RADan I'm glad my answer helped you to find out more about this, how about accepting my answer? – Roope Hakulinen Dec 17 '14 at 21:58