Hi, I am evaluationg ERPNext on my local Ubuntu machine. Managed to get it installed and working on the master branch. Today it notified me on logon that there is a new minor release.
I then did bench update expecting it to update to the minor update. Instead it upgraded the whole thing to v12 development. I have backups.
What is the fastest way to get back to master branch v10 and how do I update just the minor v10 updates, not switch to development?
The notification won’t change anything - it is just a notification.
If you want to go to v11, you would switch to staging branch
If you go to v12, you would switch to develop.
If you do the bench update on a v10 install, it will update your system to the most recent v10.x.x files. You have to tell the system to switch to staging/develop to change to v11/v12
As far as I know, you can switch UP to v11 or v12 from production, but you cannot switch down from a dev/staging release to a master/production release.
What does it show if you run
bench@WORKSHOP:~/erpnext$ bench version
/usr/lib/python2.7/dist-packages/requests/init.py:80: RequestsDependencyWarning: urllib3 (1.23) or chardet (3.0.4) doesn’t match a supported version!
RequestsDependencyWarning)
erpnext 10.1.58
foundation 0.0.1
frappe 10.1.51
No, I battled installing it a few times, deleting everytime and starting over. Then I finally got it working and then did some import from our current system database using the data import tool. Was about to continue the process when the update pop-up came up and figured that I have backup, so why not update.
Somewhere after being on v12, I did a switch-to-master command and then after that everything was unusable. Every command I tried to run after that gave an error. Which is why I am now redoing it.
The log of you first install shows that you were on the develop branch (v12). INFO:bench.utils:git pull upstream develop
Switching back to master (v10) made it unusable because you can only update to a newer version, not a former one (the database cannot be migrated back).
When you make a clean install, make sure it installs your site on the master branch, not the develop branch to avoid future issues like this one.
(getting fed up with having to wait 25 minutes each time to re-download the same large apps over and over just to get to the next error, but here goes take 3).
/opt/bench/erpnext/apps/frappe/frappe/build.py:106: UserWarning: Source /opt/bench/erpnext/apps/frappe_io/frappe_io/docs does not exists.
warnings.warn('Source {source} does not exists.'.format(source = source))
/opt/bench/erpnext/apps/frappe/frappe/build.py:106: UserWarning: Source /opt/bench/erpnext/apps/foundation/foundation/docs does not exists.
warnings.warn('Source {source} does not exists.'.format(source = source))
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at make_build_map (/opt/bench/erpnext/apps/frappe/frappe/build.js:193:22)
at Object.<anonymous> (/opt/bench/erpnext/apps/frappe/frappe/build.js:22:17)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at make_build_map (/opt/bench/erpnext/apps/frappe/frappe/build.js:193:22)
at Object.<anonymous> (/opt/bench/erpnext/apps/frappe/frappe/build.js:22:17)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
Wrote css/frappe-web.css - 65.11 KB
Wrote js/frappe-web.min.js - 132.77 KB
Wrote js/control.min.js - 77.04 KB
Wrote js/dialog.min.js - 116.9 KB
Wrote css/desk.min.css - 309.04 KB
Wrote css/frappe-rtl.css - 32.49 KB
Wrote js/libs.min.js - 1.13 MB
Wrote js/desk.min.js - 462.73 KB
Wrote css/module.min.css - 2.08 KB
Wrote css/form.min.css - 4.47 KB
Wrote js/form.min.js - 196.65 KB
Wrote css/list.min.css - 13.35 KB
Wrote js/list.min.js - 154.76 KB
Wrote css/report.min.css - 7.89 KB
Wrote js/report.min.js - 260.58 KB
Wrote js/web_form.min.js - 247.55 KB
Wrote css/web_form.css - 24.42 KB
Wrote js/print_format_v3.min.js - 23.39 KB
Wrote css/erpnext.css - 8 KB
Wrote js/erpnext-web.min.js - 3.8 KB
Wrote js/erpnext.min.js - 166.06 KB
Wrote js/item-dashboard.min.js - 8.13 KB
Not sure if the errors are good or bad, but it looks like it is installed
$ bench version
erpnext 10.1.58
foundation 0.0.1
frappe 10.1.51
$ bench new-site removed_name
MySQL root password:
Entered Password
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/opt/bench/erpnext/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
main()
File "/opt/bench/erpnext/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
click.Group(commands=commands)(prog_name='bench')
File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/opt/bench/erpnext/apps/frappe/frappe/commands/site.py", line 34, in new_site
verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
File "/opt/bench/erpnext/apps/frappe/frappe/commands/site.py", line 65, in _new_site
admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
File "/opt/bench/erpnext/apps/frappe/frappe/installer.py", line 34, in install_db
frappe.local.db = get_root_connection(root_login, root_password)
File "/opt/bench/erpnext/apps/frappe/frappe/installer.py", line 103, in get_root_connection
frappe.local.flags.root_connection = frappe.database.Database(user=root_login, password=root_password)
AttributeError: 'module' object has no attribute 'Database'
Managed to get it working:
git clone the bench repo
pip install it
init a new bench folder and cd into it
bench update --requirements
bench get-app erpnext
bench switch-to-master
cd to app/frappe and delete all the .pyc files
create new site.
restore data.