9

I've been experiencing this very odd problem lately in Heroku.

I develop and test locally, then I push the changes to Heroku. Even though the files pushed have been changed (and Heroku does recognize it and push the new files), when I look at the exact webpage on Heroku, it behaves as though it was still using the old version of the file that I just pushed.

When I see the HTML source in firebug, I can actually confirm that the old file is being used. I've tried using git push -f to "force" the git push, but no luck

any ideas??

3 Answers 3

13

Try heroku restart to force a restart of all the dynos. I'm not positive but I've seen indications like this that they tend to "lazy restart" the dynos and workers after a push. If you want to guarantee all workers and dynos are working off the latest pushed code, do a restart after your push.

4
  • 1
    tried it..its still referencing the old files. Is there possible that heroku is pulling off of some sort of cache?
    – Varun
    Nov 22, 2010 at 8:10
  • just got back from heroku support..seems like I had two files with the same class name and so the code was just using the old class even though I uploaded a new one..my bad, Heroku's referencing the correct files.
    – Varun
    Dec 2, 2010 at 10:08
  • I was having the same issue of Heroku reading stale files. (I didn't have duplicate files like @Varun). The heroku restart command fixed the issue.
    – Kyle Fox
    Apr 20, 2011 at 20:54
  • This answer works but I had to wait a couple of minutes for the old data to clear out. I kept running $ heroku restart then $ heroku logs and the old data would still show. After about 2 minutes the old data disappeared. May 24, 2018 at 19:52
3

I know this is old, but I just recently had this problem, turned out it was just my cache. If you hit ctrl + F5 it hard refreshes the page and the cache. Worked in my case after searching everywhere.

0
0

Experienced same problem too, so checked the repo files by running heroku git:clone -a my-app cloned the files currently in heroku master, and confirmed that the files in repo are the updated version. Hence, the newer files are uploaded correctly but is not being reflected by heroku. Hence I ran heroku restart and waited a long time, like 3 or 4 hours, and problem solved, heroku started running the new files.

Not exactly sure if heroku restart or simply waiting for 4 hours solved the problem, and I doubt I needed to wait 4 hours for heroku to reflect newer repo.

However, I think, after deploying to the same master branch git push heroku master, heroku needs some time to reflect the newer files, hence the switch to newer files will not be instant, it takes time.

Hope this helps anyone else experiencing the same problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.