openspace42 / raptor

The definitive EasyEngine installer with fully functional backup-restore and SFTP functionalities included
Other
25 stars 10 forks source link

install_dependencies: line 35: packages: unbound variable #6

Closed xiano8494 closed 6 years ago

xiano8494 commented 6 years ago

First attempt to install the software, I get the error "/root/openspace42/bash-functions/functions/install_dependencies: line 35: packages: unbound variable"

This happened the first time I tried to install (following the issue with EasyEngine failing to update being resolved), but I had answered No to the question to install the full stack of EE. I assumed that the error was due to something being required from the EE stack, so I retried and answered Y to install the stack and everything was fine. Therefore I assumed I must answer Y to avoid the error in future. However, on this fresh install, I answered Y to install the stack and still got this error. SImply restarting the installation seems to fix the problem and the install continues.

Slightly larger dump of the script output. Now installing dependencies...

Hit:1 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu xenial InRelease Hit:2 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:3 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease
Ign:7 http://apt.newrelic.com/debian newrelic InRelease
Hit:8 http://apt.newrelic.com/debian newrelic Release
Ign:9 http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/xUbuntu_16.04 InRelease
Hit:10 http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/xUbuntu_16.04 Release
Hit:4 http://lon1.mirrors.digitalocean.com/ubuntu xenial InRelease
Hit:5 http://lon1.mirrors.digitalocean.com/ubuntu xenial-updates InRelease
Hit:6 http://lon1.mirrors.digitalocean.com/ubuntu xenial-backports InRelease
Hit:11 http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.1/ubuntu xenial InRelease
Hit:12 https://repos.sonar.digitalocean.com/apt main InRelease
Hit:14 https://packages.amplify.nginx.com/ubuntu xenial InRelease Reading package lists... Done /root/openspace42/bash-functions/functions/install_dependencies: line 35: packages: unbound variable

nordurljosahvida commented 6 years ago

Good catch. Actually the error was introduced in my last update from the other day [in response to your issue] when I introduced the install functions in bash-functions: instead of writing os-install_dependencies -p composer I was using the old syntax where no -p was needed and the specified argument was intented as the package to be installed.

However I wasn't having this issue when testing this the other day and thanks to your post I went back and tested it again and it still worked. This highlighted a missed error catch in the script, or better a missing unset at the end of the os-install_dependencies function, that caused it to always install the packages from the previous invocation. Adding:

unset allow_errors
unset packages

to the function fixed the issue, and now the missing arguments errors are caught. I've also fixed all instances introduced the other day of os-install-dependencies and now the installs are performed correctly. I'll post back when I publish the next commit that introduces all fixes.

nordurljosahvida commented 6 years ago

Fixed in the latest commit. I'll post back here: https://github.com/openspace42/raptor/issues/4 when it's safe to try out. Stay tuned.