After run your suggested command.
frappe@VBox:~/frappe-bench$ bench version
erpnext 12.x.x-develop
foundation 0.0.1
frappe 11.0.3
Did i miss sth?
Edit:
I downgrade from frappe/erpnext V12
After run your suggested command.
frappe@VBox:~/frappe-bench$ bench version
erpnext 12.x.x-develop
foundation 0.0.1
frappe 11.0.3
Did i miss sth?
Edit:
I downgrade from frappe/erpnext V12
What are you trying to achieve and where are you stuck?
I installed erpnext development which is v12. Then I downgrade to v11 but erpnext still v12. It’s working fine anyways. Just wondering why frappe v11 and erpnext v12
That is quite messy also when you’re caught up migrating to a new environment and your packup is on 10.x
Geez…
Maybe confirm the two repos are on the same expected branch - v11 and v12 refer I think to staging and develop so you have a mismatch?
I think erpnext staging and development was the same when I switched Branch from development v12 to staging v11 by command below.
bench switch-to-branch staging frappe erpnext
bench update --requirements
bench update --patch
Ok but if I’m not mistaken, for example this suggests the branches mismatch
frappe@VBox:~/frappe-bench$ bench version
erpnext 12.x.x-develop
foundation 0.0.1
frappe 11.0.3
Here below both repos are on staging and so V11
(env) frappe@ubuntu:~/frappe-bench$ cd apps/erpnext/
(env) frappe@ubuntu:~/frappe-bench/apps/erpnext$ git status
On branch staging
Your branch is up-to-date with 'upstream/staging'.
nothing to commit, working directory clean
(env) frappe@ubuntu:~/frappe-bench/apps/erpnext$ cd ../frappe/
(env) frappe@ubuntu:~/frappe-bench/apps/frappe$ git status
On branch staging
Your branch is up-to-date with 'upstream/staging'.
(env) frappe@ubuntu:~/frappe-bench/apps/frappe$ cd ../..
(env) frappe@ubuntu:~/frappe-bench$ bench version
erpnext 11.0.3-beta.2
frappe 11.0.0-beta
Hi,
Im also getting an error on a fresh install of Ubuntu 16 virtual machine
TASK [bench : install bench] *********************************************************************************************
changed: [localhost]
TASK [bench : Overwrite bench if required] *******************************************************************************
skipping: [localhost]
TASK [bench : Check whether bench exists] ********************************************************************************
ok: [localhost]
TASK [bench : python3 bench init for develop] ****************************************************************************
skipping: [localhost]
TASK [bench : python2 bench init for production] *************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "init", "/home/hemant/frappe-bench", "--frappe-path", "https://github.com/frappe/frappe", "--frappe-branch", "master"], "delta": "0:14:13.765212", "end": "2019-02-01 12:39:17.378529", "msg": "non-zero return code", "rc": 1, "start": "2019-02-01 12:25:03.613317", "stderr": "INFO:bench.utils:virtualenv -q env -p /usr/bin/python\nINFO:bench.utils:env/bin/pip -q install --upgrade pip\nDEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.\nINFO:bench.utils:env/bin/pip -q install wheel\nDEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.\nINFO:bench.utils:env/bin/pip -q install six\nDEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.\nINFO:bench.utils:env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit\nDEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.\nINFO:bench.app:getting app frappe\nINFO:bench.utils:git clone https://github.com/frappe/frappe --branch master --origin upstream\nCloning into 'frappe'...\nwarning: unable to access '/home/hemant/.config/git/attributes': Permission denied\nINFO:bench.app:installing frappe\nINFO:bench.utils:/home/hemant/frappe-bench/env/bin/pip install -q -e /home/hemant/frappe-bench/apps/frappe \nDEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.\nINFO:bench.utils:yarn install\nerror An unexpected error occurred: \"EACCES: permission denied, scandir '/home/hemant/.config/yarn/link'\".\nTraceback (most recent call last):\n File \"/usr/local/bin/bench\", line 11, in <module>\n load_entry_point('bench', 'console_scripts', 'bench')()\n File \"/home/hemant/.bench/bench/cli.py\", line 40, in cli\n bench_command()\n File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 764, in __call__\n return self.main(*args, **kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 717, in main\n rv = self.invoke(ctx)\n File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 1137, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 956, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 555, in invoke\n return callback(*args, **kwargs)\n File \"/home/hemant/.bench/bench/commands/make.py\", line 30, in init\n python \t\t = python)\n File \"/home/hemant/.bench/bench/utils.py\", line 83, in init\n update_node_packages(bench_path=path)\n File \"/home/hemant/.bench/bench/utils.py\", line 449, in update_node_packages\n update_yarn_packages(bench_path)\n File \"/home/hemant/.bench/bench/utils.py\", line 462, in update_yarn_packages\n exec_cmd('yarn install', cwd=app_path)\n File \"/home/hemant/.bench/bench/utils.py\", line 159, in exec_cmd\n raise CommandFailedError(cmd)\nbench.utils.CommandFailedError: yarn install", "stderr_lines": ["INFO:bench.utils:virtualenv -q env -p /usr/bin/python", "INFO:bench.utils:env/bin/pip -q install --upgrade pip", "DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.", "INFO:bench.utils:env/bin/pip -q install wheel", "DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.", "INFO:bench.utils:env/bin/pip -q install six", "DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.", "INFO:bench.utils:env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit", "DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.", "INFO:bench.app:getting app frappe", "INFO:bench.utils:git clone https://github.com/frappe/frappe --branch master --origin upstream", "Cloning into 'frappe'...", "warning: unable to access '/home/hemant/.config/git/attributes': Permission denied", "INFO:bench.app:installing frappe", "INFO:bench.utils:/home/hemant/frappe-bench/env/bin/pip install -q -e /home/hemant/frappe-bench/apps/frappe ", "DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.", "INFO:bench.utils:yarn install", "error An unexpected error occurred: \"EACCES: permission denied, scandir '/home/hemant/.config/yarn/link'\".", "Traceback (most recent call last):", " File \"/usr/local/bin/bench\", line 11, in <module>", " load_entry_point('bench', 'console_scripts', 'bench')()", " File \"/home/hemant/.bench/bench/cli.py\", line 40, in cli", " bench_command()", " File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 764, in __call__", " return self.main(*args, **kwargs)", " File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 717, in main", " rv = self.invoke(ctx)", " File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 1137, in invoke", " return _process_result(sub_ctx.command.invoke(sub_ctx))", " File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 956, in invoke", " return ctx.invoke(self.callback, **ctx.params)", " File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 555, in invoke", " return callback(*args, **kwargs)", " File \"/home/hemant/.bench/bench/commands/make.py\", line 30, in init", " python \t\t = python)", " File \"/home/hemant/.bench/bench/utils.py\", line 83, in init", " update_node_packages(bench_path=path)", " File \"/home/hemant/.bench/bench/utils.py\", line 449, in update_node_packages", " update_yarn_packages(bench_path)", " File \"/home/hemant/.bench/bench/utils.py\", line 462, in update_yarn_packages", " exec_cmd('yarn install', cwd=app_path)", " File \"/home/hemant/.bench/bench/utils.py\", line 159, in exec_cmd", " raise CommandFailedError(cmd)", "bench.utils.CommandFailedError: yarn install"], "stdout": "Already using interpreter /usr/bin/python\nwarning: unable to access '/home/hemant/.config/git/attributes': Permission denied\nyarn install v1.13.0\ninfo If you think this is a bug, please open a bug report with the information provided in \"/home/hemant/frappe-bench/apps/frappe/yarn-error.log\".\ninfo Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.\n('installing', u'frappe')\nUpdating node packages...", "stdout_lines": ["Already using interpreter /usr/bin/python", "warning: unable to access '/home/hemant/.config/git/attributes': Permission denied", "yarn install v1.13.0", "info If you think this is a bug, please open a bug report with the information provided in \"/home/hemant/frappe-bench/apps/frappe/yarn-error.log\".", "info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.", "('installing', u'frappe')", "Updating node packages..."]}
to retry, use: --limit @/tmp/.bench/playbooks/site.retry
PLAY RECAP ***************************************************************************************************************
localhost : ok=68 changed=42 unreachable=0 failed=1
Traceback (most recent call last):
File "install.py", line 425, in <module>
install_bench(args)
File "install.py", line 122, in install_bench
run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
File "install.py", line 338, in run_playbook
success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'))
File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=hemant']' returned non-zero exit status 2
hemant@erpnextdev:~$
Any ideas on how to get v11 fresh install. Unless I get install v10 and upgrade?
Kind regards
Hemant
Are you installing on local machine, VM or VPS? either way this simple unattended has worked for me countless times. I setup and delete test vps instances almost on a daily basis and i have set up 2 already today.
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
sudo python install.py --production --bench-branch master --frappe-branch master --erpnext-branch master --mysql-root-password “password” --admin-password “password”
Note: This is for fresh installs only.
Remember to change the “password” to your password and remove the “” from each side.
Im using vmare workstation and created a fresh install on ubuntu on my local windows 10 machine.
Never had issues in the past, just today tried to install v11. Usually I upgrade from the vm I created many moons ago.
Will try again.
kind regards
Hemant
Looks like the easy install script works when leaving out the USER option to the default frappe user, but if I want to install as a specific user that fails. Worked in v10 so not sure if something was missed when trying to install with USER option other then frappe
Hi.
I did clean V11 install on Debian via the install scripts and it worked perfectly… If could be the user.
So for Debian:
Create new user (example user123):
sudo adduser user123
Give sudo permission for user:
sudo usermod -aG sudo user123
Login as user123
Run a quick system update:
sudo apt-get update -y && sudo apt-get upgrade -y
Install python:
sudo apt-get install python-minimal build-essential python-setuptools python-dev build-essential python-setuptools -y
Get the install script:
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
sudo python install.py --production --site site.domain.com --user user123 --mysql-root-password mySQLROOTPAssword --admin-password ADMINPassword --bench-name NewBENCHName
Copy and paste exactly and replace the user123, mySQLROOTPAssword, ADMINPassword and NewBenchName with your respective details.
Thanks.
Given that ERPNext 11 is now the official master release. Is the script updated to install ERPNext using Python 3??
No. The install script still installs python 2.7. My best guess is because python 3 still has a few issues or it could just be deliberate as 2.7 still works.
I suppose that yarn is also the cause of the style error on an upgrade to v11. Tried to fix by checking permission problems with .yarn & .npm & also tried to clean cache, and followed the general advice in forum. Unable to track problem down. No particular error in logs. Intermittent error, more particularly if any project is opened then style issue start. On restart fine, until Project form is opened. The default font also is not loaded but replaced by a font appearing to be Roman. Issue appeared on update to 11.1.3.
Any further ideas to troubleshoot?
Best practices for fresh install with bench auto installer:
frappe-bench
to be installed with custom user, make sure that user does not exists on system as bench does it for you.like sudo python install.py --production
? I always thought this should not be run with sudo
and also the user running frappe/erpnext should be removed from the sudo users after the installation (where sudo is required for some of the installation steps, even thought the install script is not run with sudo
)
I confirm this works great. Redone the server and all worked with out error. Made sure the user i wanted to run installer as was not created.
Thanks
kind regards
Hemant
The issue more likely than not, has to do with the OS implementation - see node.js - NPM modules won't install globally without sudo - Stack Overflow.
On Debian and Ubuntu the package manager appears to cause problems if yarn installed from standard repository.
See the install instructions - Guide: Manual Install ERPNext on Ubuntu 17.xx & 18.xx
The package must be installed globally and a non-sudo user must be able to run scripts.
I.e. see Resolving EACCES permissions errors when installing packages globally | npm Docs
npm config set prefix '~/.npm'
export PATH=~/.npm/bin:$PATH
source ~/.profile
to test without sudo …
npm install -g jshint
Assuming path at
/opt/bench/erpnext
Also do
npm install -g yarn
bench update --requirements
bench setup socketio
bench build
Without using sudo
Then do
bench update --reset