I am facing funny installation problems with our beloved ERPNext lately; It appears the clean installs are more error prone than upgrades.
I have failed on 4 occasions to make clean installations, on Ubuntu 18, 16 and 14. They all fail with this:
Traceback (most recent call last): File "install.py", line 432, in <module> install_bench(args) File "install.py", line 128, in install_bench run_playbook('site.yml', sudo=True, extra_vars=extra_vars) File "install.py", line 344, in run_playbook success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks')) File "/usr/lib/python2.7/subprocess.py", line 190, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=kent']' returned non-zero exit status 2
For installation, Python 2.7, python-dev, setup-tools and the other dependencies are installed, user has the right privileges, Also I noticed lately the installation can take well over an hour, and on fast hardware, at the init bench for production stage.
So like some have experienced, nothing has worked. I wouldn’t blame the team much, it’s complicated especially given the amount of packages; but I must be honest, I would expect after so many years I should be a ‘veteran’ installer or at least, things should be way better lol given that I have installed ERPNext over 100 times in my years using it, including over 30 production installs; yet installations and updates still give me a huge belly punch, you never know what to expect. But, I aint complaining , guess I will download the production VM and try to update it. I have better luck with upgrades these days…
I have seen this error many times and (me, mostly installing inside of LXD/LXC containers) most of the times was able to solve this by using the --container option with the easy install script and installing as a root user with for an existing user which I specify with the --user option.
Great vrms, this is one option I haven’t tried, indeed this is a vbox installation; although I opted to get the VM production image and ramp it up to what I need, I prefer the VM due to our unique environment and power challenges, having backups with the Vm installs is a lot easier even for a non technical person… but this is something I will try out today. Thank you. I will post a feedback
I faced this situation for over a week attempting several clean installs on different platforms. Only way i could get my installation to go past that error was to first create the user, run install from root and using install script, i specified the user.
python install.py --production --user [username]
Note that if you run it from the created user, whether you use the --user or not, it will fail.
Thanks, yes indeed I have tried these methods, probably many times before starting the topic. I guess it’s due to the container thing hinted on other threads as I always do this in a VM… I can’t yet understand how and why this should impact the setup but I will give it a shot.
Meanwhile… Well, all good, what I did was get a production VM image, expand the size beyond 40gb, fix potential timestamp and time zone issues, and so it’s good to go, production ready.
But I will try adding the --container flag and update the thread.
Not so sure about doing anything with the VM image. I just install straight up on the VSP server.
The thing is, all this time, we have been told to NEVER install as ‘root’ so every attempt I have tried over the past several months has been as a created user. Every one of them have been failing.
So, to have someone try installing as root, but using the --user switch to place everything into the correct created user account was genius. It may have happened out of desperation, or it may have been inspired by something else, but it proved to be the best path to a successful install on several of my VPS servers in the past few hours.
It even corrected the problems of not being able to get the system configuration script to work on the first login as administrator.
Now the question is… “How long will this fix last?”
I am happy the solution was of help to you. I can also confirm that it works for develop branch too. I believe the playbook is missing critical steps when it comes to checking if a user exists, what it should do if one does not exist and how to ensure that the right directories are created. I figured that eliminating two critical checks by first creating the user and then issuing the right access to a user not requiring sudo authentication (in this case, the root user) in order to create and write into such user, it will skip both checks and continue with the install, and i was right. My assumption is that linux has changed the way read-write permissions are automatically assigned to directories and it has made it more difficult for non-root users to create new directories or root users to assume root permission levels for certain directories except certain conditions are met.
I am not a developer and only stumbled upon ERPNext about 2 years ago and indeed reading your guides made it easier for me to get used to ERPNext and i’ve been in love with it ever since. I will be happy for a developer to take a look at how the script behaves when it comes to assigning permissions when the erpnext directories are created. This is the key to solving the errors in my opinion (but to emphasize, i am not a developer, only theorizing based on usage and limited experience playing with several linux distros).
BKM, thanks again, in fact that’s where it was fascinating, I always enable the root user with a strong password and yes, like you in desperation I have tried, used it and created the frappe user or any other user(as recommended for better brute force security). It fails. But it’s good to know that it works for some, for experimentation and feedback, I will try this on 14,16 and 18 and see if we could come up with something reliable as per installation method.
may be the version of Ubuntu, I must say I haven’t tried the root method in 18LTS, I think only on 16, but I have used root several times over the years, previously in ignorance though, but yes, it is a very seamless method practically…
Let me see if i can troubleshoot with you. are you trying to run it on a VM? if yes what VM? let me see if i can replicate your challenge and try the various options i’ve used so far?
All my deployments have been on VPS as i generally don’t trust VMs and bare metal installations tend to run slower regardless of machine configuration for me (beats me why though). I have some free time today so i can join you to try to crack this nut.
Thanks, I was trying in a VM, I think I have over 25 production installations, all in VM, 4 cloud, 1 Ubuntu desktop install.
I will spin up a VM, and run this again. Only thing I haven’t tried is the --container switch which I will excitedly apply. I always use vbox, and since most of the clients are retail outlets, it’s usually onsite.
I must confess that Erpnext performs better in the cloud, the 4 digitalocean installations are so sweet, although not in use for high volume operations. the VMs are more prone to funny problems, but then for high volume retailers, given the unique connectivity reliability issues we have, cloud is not an option and offline POS is just too risky although that can also be protected from tampering by locking up Chrome… The issue of depending on cashiers to sync still remains a huge issue, except I’m outdated, does the POS now sync periodically on its own?
So I’m running this again, VM running Ubuntu 18 LTS Server. So I will keep updating…
What I’m doing is:
Logged in as root
User created and install.py in user directiory (not root)
cd to user dir
Run production script with --container this time and same --user flag as always
Side…
Did I mention, I always open this page, GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps whenever I install erpnext? so even though I have done this more times than I can count, I still always look at this page and try out different ways, right now I have it open. I havent even bothered to memorize the instructions
I can’t really say if cd into new user directory is necessary as using the --user flag will definitely direct all installs to defined user directory. But let’s see how it goes.
We are in the same boat on this one lol. But you definitely need the playbook download url and that’s pretty long to memorize in my opinion (never bothered to even try). Fingers crossed though that it will run through for you this time.