I had similar problem yet it was caused by '~' in the path not being expanded correctly. I needed to use $HOME instead within the bash script. Then all good.