Friday, May 11, 2018

Dokku app deployment fails with a “main: command not found. access denied”. Its most likely a storage space issue...

If your Dokku app deployment failed with an error similar to this:

/home/dokku/.basher/bash: main: command not found
Access Denied

And you have confirmed that its not some typo in your command or if your remote server is down or repo has been deleted etc... then you most likely have hit this issue due to your remote server going out of space.

You can confirm this by SSH'ing into your remote server and hitting the "df -h" command. Once you confirm it then there are a few things you can do to release some space so you can redeploy.

The following is highly risky as you have to deal with docker directly but if you know what you are doing then it should be OK. (but do these at your own RISK!)

Run:
sudo docker ps

To see the docker containers that are running and check for ones that have exited andtherefore are not needed

Run:
sudo docker ps -a -q -f status=exited

To see the containers that are exited. You can delete the images behind this to free space. You will see a list. Remove containers using the container IDs. e.g.

sudo docker rm [0fb0724ae3a7] --> this is the containerID

Now check if you have some free space and try to redeploy.

If you still have no space you can try and delete the docker images as well. This is again very risky in case you are not sure what is happening so please do this at your own risk

Run:
docker images

or Run:
sudo docker images | grep '<none>'

This should show you orphaned images.

Start deleting some images using this command:
sudo docker rmi [afa892371d46]  --> this is the IMAGE ID

Now you should have some space for a deployment.

Hopefully this helps someone. You can read more in these issues raised on Github.
https://github.com/dokku/dokku-mariadb/issues/38
https://github.com/dokku/dokku/issues/120

No comments:

Post a Comment

Fork me on GitHub