Updating and staying in master branch

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. :slight_smile:
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

Hi Trentmu,

Thank you for coming back to me so soon. That is axactly what I thouhgt. But I did as follows:

su - bench (to get to my bench install)
cd erpnext (where my erpnext installs are)
bench update

Everything went smoothly, but when I logged back into ERPNext and clicked on Help->about, it showed v12 develop.

Prior to bench update it showed v10.

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 version

My shell history of the install here. Pretty sure its my fault :grinning::

    bench@WORKSHOP:~/erpnext$ bench update
/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)
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up to date.
/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)
remote: Enumerating objects: 222, done.
remote: Counting objects: 100% (222/222), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 295 (delta 214), reused 214 (delta 212), pack-reused 73
Receiving objects: 100% (295/295), 61.38 KiB | 194.00 KiB/s, done.
Resolving deltas: 100% (229/229), completed with 123 local objects.
From https://github.com/frappe/frappe
   63d7d776c..63c5613f9  develop        -> upstream/develop
   968791195..b40a67969  hotfix         -> upstream/hotfix
   9d74acfe3..123a192a3  master         -> upstream/master
   c4f1cdd50..4eac46438  staging        -> upstream/staging
   301fcdefd..dc9b37711  staging-fixes  -> upstream/staging-fixes
 * [new branch]          surajshetty3416-patch-1 -> upstream/surajshetty3416-patch-1
 * [new tag]             v10.1.51       -> v10.1.51
 * [new tag]             v11.0.3-beta.9 -> v11.0.3-beta.9
 * [new tag]             v11.0.3-beta.7 -> v11.0.3-beta.7
 * [new tag]             v11.0.3-beta.8 -> v11.0.3-beta.8
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages (5.3.0)
INFO:bench.app:pulling frappe
INFO:bench.utils:git pull  upstream develop
From https://github.com/frappe/frappe
 * branch                develop    -> FETCH_HEAD
Updating 63d7d776c..63c5613f9
Fast-forward
 frappe/__init__.py                                 |    2 +-
 frappe/contacts/doctype/address/address.json       |    4 +-
 frappe/core/doctype/communication/email.py         |    3 +-
 frappe/core/doctype/docfield/docfield.json         | 2586 ++++++++++----------
 frappe/core/doctype/file/file.py                   |    4 +-
 .../doctype/prepared_report/prepared_report.py     |   22 +-
 frappe/core/doctype/sms_settings/sms_settings.py   |    3 +
 frappe/core/doctype/user/user.py                   |   13 +-
 .../doctype/customize_form/customize_form.py       |    2 +-
 .../customize_form_field/customize_form_field.json |    6 +-
 frappe/desk/query_report.py                        |    2 +-
 frappe/hooks.py                                    |    2 +-
 frappe/model/db_schema.py                          |  657 +++++
 frappe/patches.txt                                 |    1 +
 .../v11_0/replicate_old_user_permissions.py        |   91 +-
 .../v11_0/set_allow_self_approval_in_workflow.py   |    5 +
 frappe/permissions.py                              |   21 +-
 frappe/public/build.json                           |    1 +
 .../public/js/frappe/form/controls/html_editor.js  |   32 +
 frappe/public/js/frappe/form/footer/timeline.js    |    7 +-
 frappe/public/js/frappe/model/perm.js              |    4 +
 .../public/js/frappe/views/reports/query_report.js |    3 +-
 .../public/js/frappe/views/reports/report_view.js  |    1 +
 frappe/public/less/controls.less                   |   12 +
 frappe/public/less/frappe-datatable.less           |    2 +-
 frappe/utils/csvutils.py                           |    2 +-
 frappe/utils/user.py                               |   12 +
 .../doctype/web_form/templates/web_form.html       |    1 +
 frappe/website/doctype/web_form/web_form.json      |   36 +-
 frappe/website/js/web_form.js                      |    4 +-
 .../workflow_transition/workflow_transition.json   |    4 +-
 package.json                                       |    2 +-
 requirements.txt                                   |    2 +-
 yarn.lock                                          |   20 +-
 34 files changed, 2181 insertions(+), 1388 deletions(-)
 create mode 100644 frappe/model/db_schema.py
 create mode 100644 frappe/patches/v11_0/set_allow_self_approval_in_workflow.py
 create mode 100644 frappe/public/js/frappe/form/controls/html_editor.js
INFO:bench.utils:find . -name "*.pyc" -delete
INFO:bench.app:pulling frappe_io
INFO:bench.utils:git pull  upstream master
From https://github.com/frappe/frappe_io
 * branch            master     -> FETCH_HEAD
Already up to date.
INFO:bench.utils:find . -name "*.pyc" -delete
INFO:bench.app:pulling erpnext
INFO:bench.utils:git pull  upstream develop
remote: Enumerating objects: 260570, done.
remote: Counting objects: 100% (260566/260566), done.
remote: Compressing objects: 100% (58789/58789), done.
remote: Total 257889 (delta 200552), reused 254471 (delta 197213), pack-reused 0
Receiving objects: 100% (257889/257889), 611.35 MiB | 935.00 KiB/s, done.
Resolving deltas: 100% (200552/200552), completed with 2051 local objects.
From https://github.com/frappe/erpnext
 * branch            develop    -> FETCH_HEAD
   098d88ee0a..66922b9c8e develop    -> upstream/develop
Updating 098d88ee0a..66922b9c8e
Fast-forward
 erpnext/__init__.py                                |    2 +-
 erpnext/accounts/party.py                          |    7 +-
 .../accounts_receivable/accounts_receivable.html   |   10 +-
 .../accounts_receivable/accounts_receivable.py     |    8 +-
 erpnext/buying/doctype/supplier/supplier.json      | 2988 +++----
 erpnext/config/desktop.py                          |   40 +
 erpnext/controllers/accounts_controller.py         |    6 +-
 erpnext/controllers/buying_controller.py           |    2 +-
 erpnext/controllers/selling_controller.py          |    2 +-
 erpnext/domains/healthcare.py                      |    3 +
 .../student_leave_application.py                   |   24 +-
 .../healthcare_settings/healthcare_settings.json   | 2557 +++---
 erpnext/healthcare/doctype/patient/patient.json    | 2747 +++----
 erpnext/healthcare/utils.py                        |    2 +
 erpnext/hooks.py                                   |    2 +-
 erpnext/hr/doctype/driver/driver.js                |    9 +
 erpnext/hr/doctype/driver/driver.json              | 1062 +--
 erpnext/manufacturing/doctype/bom/bom.json         |   35 +-
 erpnext/manufacturing/doctype/bom/bom.py           |   17 +-
 erpnext/patches.txt                                |    4 +-
 .../v10_0/remove_and_copy_fields_in_physician.py   |   13 -
 .../v11_0/change_healthcare_desktop_icons.py       |   68 +
 .../patches/v11_0/drop_column_max_days_allowed.py  |    6 +
 erpnext/patches/v11_0/ewaybill_fields_gst_india.py |    9 +
 .../v11_0/rename_healthcare_doctype_and_fields.py  |   10 +
 erpnext/projects/doctype/project/project.py        |    1 +
 erpnext/regional/india/setup.py                    |   48 +-
 erpnext/regional/india/utils.py                    |    2 +-
 erpnext/regional/report/eway_bill/eway_bill.py     |   17 +-
 .../customer_credit_balance.py                     |    1 -
 .../setup/setup_wizard/operations/taxes_setup.py   |    2 +-
 erpnext/stock/__init__.py                          |   10 +-
 .../stock/doctype/delivery_note/delivery_note.js   |   14 +-
 .../stock/doctype/delivery_note/delivery_note.json | 8327 ++++++++++----------
 .../stock/doctype/delivery_trip/delivery_trip.py   |    7 +-
 .../__init__.py                                    |    0
 erpnext/translations/af.csv                        |  581 +-
 erpnext/translations/am.csv                        |  592 +-
 erpnext/translations/ar.csv                        |  594 +-
 erpnext/translations/bg.csv                        |  594 +-
 erpnext/translations/bn.csv                        |  594 +-
 erpnext/translations/bs.csv                        |  594 +-
 erpnext/translations/ca.csv                        |  592 +-
 erpnext/translations/cs.csv                        |  594 +-
 erpnext/translations/da-DK.csv                     |    1 -
 erpnext/translations/da.csv                        |  594 +-
 erpnext/translations/de.csv                        |  594 +-
 erpnext/translations/el.csv                        |  594 +-
 erpnext/translations/en-US.csv                     |   10 +-
 erpnext/translations/es-GT.csv                     |    2 +-
 erpnext/translations/es-MX.csv                     |    4 +-
 erpnext/translations/es-PE.csv                     |   86 +-
 erpnext/translations/es.csv                        |  594 +-
 erpnext/translations/et.csv                        |  636 +-
 erpnext/translations/fa.csv                        |  594 +-
 erpnext/translations/fi.csv                        |  594 +-
 erpnext/translations/fr.csv                        |  595 +-
 erpnext/translations/gu.csv                        |  594 +-
 erpnext/translations/he.csv                        |  311 +-
 erpnext/translations/hi.csv                        |  594 +-
 erpnext/translations/hr.csv                        |  592 +-
 erpnext/translations/hu.csv                        |  594 +-
 erpnext/translations/id.csv                        |  594 +-
 erpnext/translations/is.csv                        |  592 +-
 erpnext/translations/it.csv                        |  594 +-
 erpnext/translations/ja.csv                        |  592 +-
 erpnext/translations/km.csv                        |  596 +-
 erpnext/translations/kn.csv                        |  594 +-
 erpnext/translations/ko.csv                        |  596 +-
 erpnext/translations/ku.csv                        |  585 +-
 erpnext/translations/lo.csv                        |  596 +-
 erpnext/translations/lt.csv                        |  596 +-
 erpnext/translations/lv.csv                        |  594 +-
 erpnext/translations/mk.csv                        |  596 +-
 erpnext/translations/ml.csv                        |  579 +-
 erpnext/translations/mr.csv                        |  594 +-
 erpnext/translations/ms.csv                        |  596 +-
 erpnext/translations/my.csv                        |  596 +-
 erpnext/translations/nl.csv                        |  596 +-
 erpnext/translations/no.csv                        |  594 +-
 erpnext/translations/pl.csv                        |  596 +-
 erpnext/translations/ps.csv                        |  587 +-
 erpnext/translations/pt-BR.csv                     |  281 +-
 erpnext/translations/pt.csv                        |  596 +-
 erpnext/translations/ro.csv                        |  598 +-
 erpnext/translations/ru.csv                        |  596 +-
 erpnext/translations/si.csv                        |  592 +-
 erpnext/translations/sk.csv                        |  596 +-
 erpnext/translations/sl.csv                        |  596 +-
 erpnext/translations/sq.csv                        |  594 +-
 erpnext/translations/sr-SP.csv                     |   88 +-
 erpnext/translations/sr.csv                        |  596 +-
 erpnext/translations/sv.csv                        |  596 +-
 erpnext/translations/sw.csv                        |  590 +-
 erpnext/translations/ta.csv                        |  578 +-
 erpnext/translations/te.csv                        |  588 +-
 erpnext/translations/th.csv                        |  596 +-
 erpnext/translations/tr.csv                        |  637 +-
 erpnext/translations/uk.csv                        |  596 +-
 erpnext/translations/ur.csv                        |  589 +-
 erpnext/translations/uz.csv                        |  580 +-
 erpnext/translations/vi.csv                        |  602 +-
 erpnext/translations/zh-TW.csv                     |  573 +-
 erpnext/translations/zh.csv                        |  596 +-
 104 files changed, 28473 insertions(+), 26024 deletions(-)
 delete mode 100644 erpnext/patches/v10_0/remove_and_copy_fields_in_physician.py
 create mode 100644 erpnext/patches/v11_0/change_healthcare_desktop_icons.py
 create mode 100644 erpnext/patches/v11_0/drop_column_max_days_allowed.py
 create mode 100644 erpnext/patches/v11_0/ewaybill_fields_gst_india.py
 create mode 100644 erpnext/stock/report/warehouse_wise_item_balance_age_and_value/__init__.py
INFO:bench.utils:find . -name "*.pyc" -delete
INFO:bench.app:pulling foundation
INFO:bench.utils:git pull  upstream master
remote: Enumerating objects: 169, done.
remote: Counting objects: 100% (169/169), done.
remote: Compressing objects: 100% (75/75), done.
remote: Total 149 (delta 111), reused 110 (delta 73), pack-reused 0
Receiving objects: 100% (149/149), 314.61 KiB | 124.00 KiB/s, done.
Resolving deltas: 100% (111/111), completed with 19 local objects.
From https://github.com/erpnext/foundation
 * branch            master     -> FETCH_HEAD
   ca3dcbe..fb9b76f  master     -> upstream/master
Updating ca3dcbe..fb9b76f
Fast-forward
 .vscode/settings.json                              |   3 +
 .../conference_participant.py                      |   3 +-
 .../conference_talk_proposal.py                    |   3 +-
 .../doctype/developer_sprint/__init__.py           |   0
 .../doctype/developer_sprint/developer_sprint.js   |   8 +
 .../doctype/developer_sprint/developer_sprint.json | 256 +++++++++++++++++++++
 .../doctype/developer_sprint/developer_sprint.py   |  18 ++
 .../developer_sprint/test_developer_sprint.js      |  23 ++
 .../developer_sprint/test_developer_sprint.py      |  10 +
 .../conference_talk_proposal.json                  |  60 ++++-
 .../web_form/developer_sprint/__init__.py          |   0
 .../web_form/developer_sprint/developer_sprint.js  |   3 +
 .../developer_sprint/developer_sprint.json         | 100 ++++++++
 .../web_form/developer_sprint/developer_sprint.py  |   7 +
 .../assets/img/erpnext_integrations/app_menu.png   | Bin 0 -> 190701 bytes
 .../en/erpnext_integration/amazon_integration.md   |   2 +-
 .../erpnext_integration/woocommerce_integration.md |  12 +-
 17 files changed, 486 insertions(+), 22 deletions(-)
 create mode 100644 .vscode/settings.json
 create mode 100644 foundation/erpnext_foundation/doctype/developer_sprint/__init__.py
 create mode 100644 foundation/erpnext_foundation/doctype/developer_sprint/developer_sprint.js
 create mode 100644 foundation/erpnext_foundation/doctype/developer_sprint/developer_sprint.json
 create mode 100644 foundation/erpnext_foundation/doctype/developer_sprint/developer_sprint.py
 create mode 100644 foundation/erpnext_foundation/doctype/developer_sprint/test_developer_sprint.js
 create mode 100644 foundation/erpnext_foundation/doctype/developer_sprint/test_developer_sprint.py
 create mode 100644 foundation/erpnext_foundation/web_form/developer_sprint/__init__.py
 create mode 100644 foundation/erpnext_foundation/web_form/developer_sprint/developer_sprint.js
 create mode 100644 foundation/erpnext_foundation/web_form/developer_sprint/developer_sprint.json
 create mode 100644 foundation/erpnext_foundation/web_form/developer_sprint/developer_sprint.py
 create mode 100644 foundation/www/docs/assets/img/erpnext_integrations/app_menu.png
INFO:bench.utils:find . -name "*.pyc" -delete
Updating Python libraries...
INFO:bench.utils:./env/bin/pip install --upgrade pip
Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages (18.1)
INFO:bench.utils:./env/bin/pip install -q -r /opt/bench/bench-repo/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/foundation/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe_io/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
frappe 10.1.50 has requirement dropbox==7.3.1, but you'll have dropbox 9.1.0 which is incompatible.
Updating node packages...
INFO:bench.utils:yarn install
yarn install v1.10.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "rollup-plugin-vue > @vue/component-compiler@3.4.4" has unmet peer dependency "postcss@>=6.0".
[4/4] Building fresh packages...
Done in 4.12s.
Backing up sites...
Patching sites...
Migrating ledger.ubertech.co.za
Executing frappe.patches.v11_0.set_allow_self_approval_in_workflow in ledger.ubertech.co.za (_451917dad2825c91)
Success: Done in 0.595s
Executing erpnext.patches.v11_0.ewaybill_fields_gst_india in ledger.ubertech.co.za (_451917dad2825c91)
Success: Done in 0.134s
Executing erpnext.patches.v11_0.drop_column_max_days_allowed in ledger.ubertech.co.za (_451917dad2825c91)
Success: Done in 0.117s
Executing erpnext.patches.v11_0.change_healthcare_desktop_icons in ledger.ubertech.co.za (_451917dad2825c91)
Success: Done in 0.067s
Updating DocTypes for frappe        : [========================================]
Updating DocTypes for erpnext       : [========================================]
Syncing help database...
yarn run v1.10.1
$ FRAPPE_ENV=production node rollup/build.js
Production mode
✔ Built js/moment-bundle.min.js
✔ Built js/libs.min.js

Building frappe assets...

✔ Built js/print_format_v3.min.js
✔ Built js/dialog.min.js
✔ Built js/form.min.js
✔ Built js/list.min.js
✔ Built js/web_form.min.js
✔ Built js/chat.js
✔ Built js/desk.min.js
✔ Built css/frappe-rtl.css
✔ Built css/form.min.css
✔ Built css/report.min.css
✔ Built css/module.min.css
✔ Built css/list.min.css
✔ Built frappe/css/email.css
✔ Built css/frappe-web.css
✔ Built css/web_form.css
✔ Built css/desk.min.css
✔ Built js/frappe-web.min.js
✔ Built js/report.min.js
✔ Built js/control.min.js
✨  Done in 26.157s

Building erpnext assets...

✔ Built js/erpnext-web.min.js
✔ Built js/item-dashboard.min.js
✔ Built js/erpnext.min.js
✔ Built css/erpnext-web.css
✔ Built css/erpnext.css
✔ Built css/marketplace.css
✔ Built js/marketplace.min.js
✨  Done in 8.094s
Done in 36.96s.
[sudo] password for bench: 
INFO:bench.utils:sudo supervisorctl restart erpnext-workers: erpnext-web:
erpnext-workers:erpnext-frappe-schedule: stopped
erpnext-workers:erpnext-frappe-default-worker-0: stopped
erpnext-workers:erpnext-frappe-long-worker-0: stopped
erpnext-workers:erpnext-frappe-short-worker-0: stopped
erpnext-web:erpnext-node-socketio: stopped
erpnext-web:erpnext-frappe-web: stopped
erpnext-workers:erpnext-frappe-schedule: started
erpnext-workers:erpnext-frappe-default-worker-0: started
erpnext-workers:erpnext-frappe-long-worker-0: started
erpnext-workers:erpnext-frappe-short-worker-0: started
erpnext-web:erpnext-node-socketio: started
erpnext-web:erpnext-frappe-web: started
________________________________________________________________________________
Bench: Deployment tool for Frappe and ERPNext (https://erpnext.org).
Open source depends on your contributions, so please contribute bug reports, patches, fixes or cash and be a part of the community
()

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

I would just do a cache clear/reload, and it’ll probably show the right versions

Somewhere between where I got v12 and where I posted this post I seemed to have broken the site entirely when trying to fix it myself :sunglasses:

So I’ve decided to do bench init again and then restore. After that I will try to update again and also do cache clear and let you know if its fixed.

Thanks for your help

Just for info…
I ran bench update on my v10.1.56/10.1.50 system. It went to 10.1.58/10.1.51 without error/problem.

Did you use any git pull commands on any particular subdir between when you installed and updated?

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.

backups rule! :sunglasses:

Hi @mlategan,

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.

Good luck!

Hi, thank you for your reply. I will document everything I do as I go and post back here.

$ git clone GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps bench-repo
$ sudo pip install -e bench-repo/

lots of output, ending:

Installing collected packages: bench
  Found existing installation: bench 4.1.0
    Uninstalling bench-4.1.0:
      Successfully uninstalled bench-4.1.0
  Running setup.py develop for bench
Successfully installed bench

$ bench --version

4.1.0

$ bench init erpnext

lots of output, ending:

INFO:bench.utils:setting up backups
INFO:bench.utils:setting up auto update
Bench erpnext initialized

$ cd erpnext
$ bench version

frappe 12.x.x-develop

$ bench switch-to-master
$ bench version

frappe 10.1.51

$ bench get-app erpnext --branch master

Error: Cannot find module 'babel-core'

According to:

$ npm install babel-core less chokidar babel-preset-es2015 babel-preset-es2016 babel-preset-es2017 babel-preset-babili

Lots of output…

$ rm -rf apps/foundation apps/erpnext
$ bench get-app erpnext --branch master

Pages and pages of error:

ReferenceError: Unknown plugin “transform-object-rest-spread”

According to:

$ sudo npm install babel-plugin-transform-object-rest-spread
$ sudo npm install babel-preset-env

(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).

$ rm -rf apps/foundation apps/erpnext
$ bench get-app erpnext --branch master

/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'

Any pointers on where I went wrong?

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.

2 Likes