Command "expect" was not find
Thatoo opened this issue · 5 comments
Something went wrong during the install. I couldn't type my password when requested to install expect.
Why not installing it in the requirement?
Preparing for Production installation. This could take a minute... or two so please be patient.
Enter the site name (If you wish to install SSL later, please enter a FQDN): erpnext.local
Enter the Administrator password:
Confirm password:
Password confirmed
[sudo] Mot de passe de thatoo : moDésolé, essayez de nouveau.
[sudo] Mot de passe de thatoo :
sudo: no password was provided
sudo: 1 saisie de mot de passe incorrecte
Now setting up your site. This might take a few minutes. Please wait...
xxxx[sudo] Mot de passe de thatoo :
La commande « expect » n'a pas été trouvée, mais peut être installée avec :
sudo snap install expect # version 5.45-7snap0, or
sudo apt install expect # version 5.45.4-2build1
Voir « snap info expect » pour des versions additionelles.
Would you like to continue with production install? (yes/no)
If you modified the script using sudo chmod command at the beginning then the script retains elevated privileges for 15 minutes. Unless you left the script idle for too long and the elevated privileges expired, in which case you would be asked to provide a sudo password when the expect package needs to be installed.
As for installing it as a requirement, this is a good suggestion and I would consider adding it to the original requirement installation.
I guess that because my download speed is slow, then it took more than 15 minutes before it reaches to the line
sudo apt install expect
So adding it at the beginning of the script in the requirement would solve this kind of issue.
With "expect" in the requirement line, it has worked like a charme.
Awesome
Actually, it would be possible to remove expect package installation and modify all this line
# Create new site using expect
export SITE_NAME=$site_name
export SQL_PASSWD=$sqlpasswrd
export ADMIN_PASSWD=$adminpasswrd
#Set Administrator password.
SITE_SETUP=$(expect -c "
set timeout 300
set sitename \$env(SITE_NAME)
set sqlpwd \$env(SQL_PASSWD)
set adminpwd \$env(ADMIN_PASSWD)
spawn bench new-site \$sitename --install-app erpnext
expect \"MySQL root password:\"
send \"\$sqlpwd\r\"
expect \"Set Administrator password:\"
sleep 20
send \"\$adminpwd\r\"
expect \"Re-enter Administrator password:\"
sleep 20
send \"\$adminpwd\r\"
expect eof
")
echo "$SITE_SETUP"
by this line
bench new-site $site_name --db-root-password $sqlpasswrd --admin-password $adminpasswrd --install-app erpnext