Bench Update error version 8.3.6

Hi all,

Just updated ERPNext and got this error. My site is now stuck on status 503. here is the error in my terminal:

erpnext-v8:/home/frappe/frappe-bench$ sudo bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
remote: Counting objects: 113, done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 113 (delta 93), reused 90 (delta 70), pack-reused 0
Receiving objects: 100% (113/113), 10.70 KiB | 0 bytes/s, done.
Resolving deltas: 100% (93/93), completed with 40 local objects.
From https://github.com/frappe/frappe
   fc52f20..dd5121d  master     -> upstream/master
 * [new tag]         v8.3.10    -> v8.3.10
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
INFO:bench.utils:git pull  upstream master
From https://github.com/frappe/frappe
 * branch            master     -> FETCH_HEAD
Updating fc52f20..dd5121d
Fast-forward
 .travis.yml                                                        |  4 +---
 frappe/__init__.py                                                 |  2 +-
 frappe/desk/page/setup_wizard/setup_wizard.css                     | 21 +++++++++------------
 frappe/desk/page/setup_wizard/setup_wizard.js                      | 24 ++++++++++++++++++------
 frappe/desk/query_report.py                                        |  2 +-
 frappe/email/doctype/email_account/email_account.py                |  3 ++-
 frappe/email/queue.py                                              |  9 ++++-----
 frappe/model/delete_doc.py                                         |  1 +
 frappe/patches.txt                                                 |  1 +
 frappe/patches/v8_1/delete_custom_docperm_if_doctype_not_exists.py |  6 ++++++
 frappe/public/js/frappe/ui/page.js                                 | 14 +++++++++++---
 frappe/public/js/frappe/views/communication.js                     | 19 +++++++++++++++++++
 frappe/public/js/frappe/views/reports/query_report.js              |  3 +--
 frappe/public/js/legacy/form.js                                    |  6 +++---
 frappe/templates/pages/integrations/payment-cancel.html            | 21 +++++++++++++++------
 frappe/templates/pages/integrations/payment-failed.html            | 21 +++++++++++++++------
 frappe/templates/pages/integrations/payment-success.html           | 21 ++++++++++++++-------
 frappe/tests/ui/test_lib.js                                        |  8 ++++++++
 frappe/website/doctype/blog_post/blog_post.py                      | 20 +++++++++++++-------
 19 files changed, 143 insertions(+), 63 deletions(-)
 create mode 100644 frappe/patches/v8_1/delete_custom_docperm_if_doctype_not_exists.py
INFO:bench.utils:find . -name "*.pyc" -delete
INFO:bench.app:pulling erpnext
INFO:bench.utils:git pull  upstream master
remote: Counting objects: 270, done.
remote: Compressing objects: 100% (85/85), done.
remote: Total 270 (delta 224), reused 231 (delta 185), pack-reused 0
Receiving objects: 100% (270/270), 32.94 KiB | 0 bytes/s, done.
Resolving deltas: 100% (224/224), completed with 92 local objects.
From https://github.com/frappe/erpnext
 * branch            master     -> FETCH_HEAD
   35ecab6..a8406e1  master     -> upstream/master
Updating 35ecab6..a8406e1
Fast-forward
 .travis.yml                                                                    |  50 +++++++++++----------
 erpnext/__init__.py                                                            |   2 +-
 erpnext/accounts/doctype/budget/budget.py                                      |  10 ++---
 erpnext/accounts/doctype/budget/test_budget.py                                 |  30 ++++++++++++-
 erpnext/accounts/doctype/payment_entry/payment_entry.js                        |  58 +++++++++++++------------
 erpnext/accounts/doctype/payment_entry/payment_entry.py                        |   8 +++-
 erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py              |   3 +-
 erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py                   |  14 +++++-
 erpnext/controllers/taxes_and_totals.py                                        |  17 +++++---
 erpnext/crm/doctype/opportunity/opportunity.json                               |  12 +++---
 erpnext/docs/assets/img/setup/{sms-setting2.jpg => sms-settings2.jpg}          | Bin
 erpnext/hooks.py                                                               |   8 ++++
 erpnext/hr/doctype/daily_work_summary/test_daily_work_summary.py               |  57 ++++++++++++------------
 erpnext/manufacturing/doctype/bom/bom.py                                       |   3 --
 erpnext/manufacturing/doctype/production_order/production_order.json           |   2 +-
 erpnext/manufacturing/doctype/production_order_item/production_order_item.json |   2 +-
 erpnext/patches.txt                                                            |   1 +
 erpnext/patches/v8_0/create_address_doc_from_address_field_in_company.py       |  33 ++++++++++++++
 erpnext/patches/v8_0/merge_student_batch_and_student_group.py                  |   4 +-
 erpnext/patches/v8_1/setup_gst_india.py                                        |   1 +
 erpnext/public/js/controllers/taxes_and_totals.js                              |  15 +++++--
 erpnext/public/js/setup_wizard.js                                              |  72 +++++++++++++++++++++++--------
 erpnext/schools/doctype/program_enrollment/program_enrollment.json             |  47 +++++++++++++++++---
 erpnext/schools/doctype/student/student.json                                   |  50 ++++++++++-----------
 erpnext/schools/doctype/student/student_dashboard.py                           |  18 +++++++-
 erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.js     |  34 ++++++++-------
 erpnext/schools/doctype/student_log/student_log.json                           | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 erpnext/selling/doctype/quotation/quotation.py                                 |  11 +++++
 erpnext/setup/doctype/item_group/item_group.py                                 |  11 ++---
 erpnext/stock/doctype/item/item.py                                             |   9 +---
 erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json         |   4 +-
 erpnext/stock/doctype/serial_no/serial_no.py                                   |   4 ++
 erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json               |   6 +--
 erpnext/tests/ui/test_fixtures.js                                              | 216 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
 erpnext/tests/ui/test_sellling.js                                              | 121 ++++++++++++++++++++++++++++++++++++++++++++-------
 35 files changed, 837 insertions(+), 250 deletions(-)
 rename erpnext/docs/assets/img/setup/{sms-setting2.jpg => sms-settings2.jpg} (100%)
 create mode 100644 erpnext/patches/v8_0/create_address_doc_from_address_field_in_company.py
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
INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/.bench/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
Updating node libraries...
INFO:bench.utils:npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN frappe@ No description
Backing up sites...
Patching sites...
Migrating site1.local
Executing frappe.patches.v8_1.delete_custom_docperm_if_doctype_not_exists in site1.local (1bd3e0294da19198)
Success
Executing erpnext.patches.v8_0.create_address_doc_from_address_field_in_company #10-05-2017 in site1.local (1bd3e0294da19198)
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, 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 "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 91, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 17, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 216, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 31, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v8_0/create_address_doc_from_address_field_in_company.py", line 33, in execute
    doc.save()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 230, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 253, in _save
    self.insert()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 193, in insert
    self._validate()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 399, in _validate
    self._validate_mandatory()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 619, in _validate_mandatory
    name=self.name))
frappe.exceptions.MandatoryError: [Address, COMPANY NAME-Billing]: city

It seem in the company billing you not filled out the city.

If you have the develop updated then don’t update the production until you fill out the city.

Hope this helps.

Yeah I agree seems to be an issue with that. Unfortunately on master branch. Hopefully a fix can be pushed soon

@DrTrills

Push will not fix.

You should find the patches.txt in the apps/erpnext/erpnext directory.

Open it with an editor /nano in ubuntu/.

Then find the misslead
erpnext.patch
erpnext.patches.v8_0.create_address_doc_from_address_field_in_company
and comment out /# /

Then run bench migrate.

It should run smoothly then go to you site and add the necessary city.

Then clear the out commented row.

Run bench update --upgrade again.

Hope this helps.

1 Like

Thank you @krnkris!!

I was able to go in and comment that out and make the changes. For some reason it is still not working. I deleted all associated addresses with this company and re- added fresh but now it is added -1 in the system and still giving the error. Not sure what to do. Any further advice will be great appreciated.

One thing I notices is the Postal Code shows as PIN in the company area, and the State doesn’t show at all. Weird bugs

I updated the billing address to that company and now I get:

Executing erpnext.patches.v8_0.create_address_doc_from_address_field_in_company #10-05-2017 in site1.local (1bd3e0294da19198)
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, 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 "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 91, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 17, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 216, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 31, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v8_0/create_address_doc_from_address_field_in_company.py", line 33, in execute
    doc.save()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 230, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 253, in _save
    self.insert()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 193, in insert
    self._validate()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 399, in _validate
    self._validate_mandatory()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 619, in _validate_mandatory
    name=self.name))
frappe.exceptions.MandatoryError: [Company-Billing-1]: city

Now In company billing the
Mandatory field “city” is missing.

Do the same way as before.

Hope this helps now.

@krnkris,

removed the patch please update and try to migrate

1 Like

@makarand_b

Thank you , I have no problem with the update :slight_smile:

@DrTrills, it is your turn, please try to migrate

Hi @krnkris Thank you for your support. Was able to get ERPNext to work with the comment of that patch. It got us through the week. :smiley:

@makarand_b Thank you for providing the patch. I had to git stash in apps/erpnext before the update but now everything is working as expected :slightly_smiling_face:

Much appreciated