18

I'm getting an error when deploying to Heroku after assets are compiled and the app is launched:

-----> Compiled slug size: 172.8MB
-----> Launching... done, v274
-----> Deploy hooks scheduled, check output in your logs
       http://mysite.com deployed to Heroku

Auto packing the repository for optimum performance.
error: Could not read ddb3b2358b3ea331cea15b03a8657f929364ec8c
fatal: Failed to traverse parents of commit c30cd906cd578d9618a4605cefa6e55ac535b42e
error: failed to run repack

The deploys appear to be finishing and the newest Ruby code is deployed, but my latest JS changes are not being served. Any thoughts on what might be happening?

Peter Brown
  • 50,956
  • 18
  • 113
  • 146
  • looks like a file size issue (have seen this with git gc before). – rb512 Nov 08 '13 at 19:14
  • How big is your repo? Sounds like the deploy on Heroku might be running out of memory. – CDub Nov 08 '13 at 21:10
  • tried `git push --force`? – Mike Szyndel Dec 29 '13 at 11:41
  • My Git repo is 45.4MB, currently I don't have problems with deploying to Heroku. Up to my kowledge, the build is conducted by a worker dyno on Heroku. So if Heroku might run out of memory as @CDub assumes, one approach I could think of is to configure the worker dynos from 1X to 2X. 2X dynos have 1GB of RAM while 1X dynos have 512MB (as of 01/2014). – Patrick Frey Jan 11 '14 at 05:59
  • Something is amiss then, since your repo is ~45MB but the compiled slug size is almost 4x that size... My experience with Heroku is the most their dynos can support is a slug size of ~90MB, *maybe* 100MB. – CDub Jan 11 '14 at 16:59
  • Maybe you give this a look -> http://stackoverflow.com/a/18687206/1609496 – Mini John Jan 22 '14 at 15:09

1 Answers1

19

This is likely an issue caused by shallow clones. When you don't have a full history, the tree cannot be fully traversed resulting in dangling commits. This often occurs with CI systems where CI does a shallow clone to save on bandwidth and/or latency.

The best course of action to take is to avoid shallow clones.

If a full clone and force push doesn't do the trick, you may need to reset your repo. Resetting your repo re-initializes your app's repo to a bare repo. Your running application will not be affected. There is a utility plugin for resetting your repo on Heroku here:

https://github.com/heroku/heroku-repo

Once installed, run heroku repo:reset and then push again.

If the above techniques don't work, please log a support ticket.

Naaman Newbold
  • 3,324
  • 1
  • 21
  • 12