Permission denied on remote server when trying to upgrade production

I get a permission denied error when I run mix edeliver upgrade production --verbose the error reads as follows

warning: failed to remove _build/prod/rel/duka/var/WARNING_README: Permission denied
warning: failed to remove _build/prod/rel/duka/var/sys.config: Permission denied
warning: failed to remove _build/prod/rel/duka/var/vm.args: Permission denied
warning: failed to remove _build/prod/rel/duka/var/log: Permission denied

Never used edeliver before, so this is just a guess. I suspect the user that created those directories is different than the one that is trying to delete them. For example, you may have used root to create them and then some more restricted user is trying to delete. You could theoretically fix this a couple ways:

  • Use the same user (ideally not root)
  • Put the two users in the same group
  • Change the owner of the files to the new user before removing them
3 Likes