Dokku Remote Rejected (pre-receive hook declined) MEAN (yo

Posted April 5, 2015 9.3k views

When I attempt to push to my Dokku droplet, I get this error:

git push dokku master
Counting objects: 965, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (945/945), done.
Writing objects: 100% (965/965), 242.54 KiB | 0 bytes/s, done.
Total 965 (delta 668), reused 0 (delta 0)
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to ''

I’m not sure what to do now, since there isn’t a log of problems…

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers

You need to remove .deploy.lock file if exists in your application folder

rm -rf /home/dokku/YOURAPPNAME/.deploy.lock

Check memory usage on the box. I’ve often seen it complain like that when its struggled to build the instance. Or try clearing the git repo on the server.

Check on the stack trace just below the following lines, you’ll be able to see the error;

CHECKS file not found in container: running simple container check...
-----> Waiting for 35 seconds ...
remote: App container failed to start!!
=====> yourAppName container output:

If the error is, Error: MONGO_URL must be set in environment. Then it’s evident that you haven’t created your database for the app.

If the error is, Error: ROOTURL must be set in environment. Then you’ll need to set-up your rooturl in the environment.
This resource might be of help, Dokku on DigitalOcean

Been running into this problem but figured out. Hope this helps. :)