frappe / bench

CLI to manage Multi-tenant deployments for Frappe apps
https://frappeframework.com/docs/user/en/bench
GNU General Public License v3.0
1.37k stars 1.2k forks source link

bench switch-to-master fails #141

Closed jevonearth closed 9 years ago

jevonearth commented 9 years ago

When attempting bench update on a V4 erpnext install, I get the following useful notice:

erpnext@erp-sandbox:~/frappe-bench$ bench update

This update will cause a major version change in Frappe/ERPNext from 4 to 6.
This would take significant time to migrate and might break custom apps. Please run `bench update --upgrade` to confirm.

You can stay on the latest stable release by running `bench switch-to-master` or pin your bench to 4 by running `bench swtich-to-v4`
erpnext@erp-sandbox:~/frappe-bench$

When i try run bench switch-to-master, I get the following errors:

erpnext@erp-sandbox:~/frappe-bench$ bench switch-to-master
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.92', 'console_scripts', 'bench')()
  File "/home/erpnext/bench-repo/bench/cli.py", line 60, in cli
    bench()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/bench-repo/bench/cli.py", line 319, in _switch_to_master
    switch_to_master(upgrade=upgrade)
  File "/home/erpnext/bench-repo/bench/app.py", line 174, in switch_to_master
    switch_branch('master', apps=apps, bench=bench, upgrade=upgrade)
  File "/home/erpnext/bench-repo/bench/app.py", line 150, in switch_branch
    raise MajorVersionUpgradeException("Switching to {0} will cause upgrade from {1} to {2}. Pass --upgrade to confirm".format(branch, version_upgrade[1], version_upgrade[2]), version_upgrade[1], version_upgrade[2])
bench.app.MajorVersionUpgradeException: Switching to master will cause upgrade from 4 to 6. Pass --upgrade to confirm
erpnext@erp-sandbox:~/frappe-bench$

Tested using: frappe/bench at commit: 27d64b6ea6d0f305697921cd78b070b6e3718feb

ERPNext: v4.20.2 Frappe Framework: v4.10.2 and ERPNext: v4.25.7 Frappe Framework: v4.14.3

pdvyas commented 9 years ago

You've to pass --upgrade to switch to a branch with a different major version. In your case, going from 4 to 6.