Address not found

hello dears

some of my customers while i`m trying to open it doesn’t open and show the following error message

Traceback (most recent call last):

File “/home/frappe/cilek-bench/apps/frappe/frappe/desk/form/load.py”, line 34, in getdoc
run_onload(doc)
File “/home/frappe/cilek-bench/apps/frappe/frappe/desk/form/load.py”, line 245, in run_onload
doc.run_method(“onload”)
File “/home/frappe/cilek-bench/apps/frappe/frappe/model/document.py”, line 787, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/cilek-bench/apps/frappe/frappe/model/document.py”, line 1058, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/cilek-bench/apps/frappe/frappe/model/document.py”, line 1041, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/cilek-bench/apps/frappe/frappe/model/document.py”, line 781, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/cilek-bench/apps/erpnext/erpnext/selling/doctype/customer/customer.py”, line 22, in onload
load_address_and_contact(self)
File “/home/frappe/cilek-bench/apps/frappe/frappe/contacts/address_and_contact.py”, line 55, in load_address_and_contact
address = frappe.get_doc(“Address”, contact.address)
File “/home/frappe/cilek-bench/apps/frappe/frappe/init.py”, line 736, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “/home/frappe/cilek-bench/apps/frappe/frappe/model/document.py”, line 70, in get_doc
return controller(*args, **kwargs)
File “/home/frappe/cilek-bench/apps/frappe/frappe/model/document.py”, line 105, in init
self.load_from_db()
File “/home/frappe/cilek-bench/apps/frappe/frappe/model/document.py”, line 148, in load_from_db
frappe.throw((“{0} {1} not found”).format((self.doctype), self.name), frappe.DoesNotExistError)
File “/home/frappe/cilek-bench/apps/frappe/frappe/init.py”, line 360, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/cilek-bench/apps/frappe/frappe/init.py”, line 346, in msgprint
_raise_exception()
File “/home/frappe/cilek-bench/apps/frappe/frappe/init.py”, line 315, in _raise_exception
raise raise_exception(msg)
DoesNotExistError: Address الاستلام من الفرع not found

For which version ?
have you done any customisation?

Please provide more details

12.1.8

Which doctype you mean?

Customer or address?

By the way both have cusomizations

It seems you have written Ajax on custom field of customer form so two possible issues might be

  1. Path for your python endpoint(API) is not correct
  2. There is syntax issue in your end point

Please share the script so can tell you more precisely

No script at all

But i mean some custom fields

And also some customers have this issue not all of them

any updates??

Somewhere you have return frappe.get_doc(‘Address’, ‘address_doc_name’)
but there is no such address present with the name you are calling.

does the following related to that issue ??

iam facing this error while updating

Executing erpnext.patches.v10_0.update_translatable_fields in shop.riadco.com (_0c809de2f676ce16)

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 324, in db_insert
), list(d.values()))
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 156, in sql
self._cursor.execute(query, values)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 170, in e xecute
result = self._query(query)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 328, in _ query
conn.query(q)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 732, in _read_query_result
result.read()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 1075, in read
first_packet = self.connection._read_packet()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 684, in _read_packet
packet.check_error()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/err.py”, line 109, in raise _mysql_exception
raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1062, “Duplicate entry ‘Customer-customer_name-translatable’ for key ‘PR IMARY’”)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 764, in __call __
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invok e
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invok e
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py”, line 17, in n ew_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 233, in migrate
migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 48, in migrate
frappe.modules.patch_handler.run_all(skip_failing)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 41, in run_all
run_patch(patch)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 30, in run_patch
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 71, in run_singl e
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 91, in execute_p atch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v10_0/update_translatable_fields.py”, line 40, in execute
‘value’: 1
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 334, in db_insert
raise frappe.DuplicateEntryError(self.doctype, self.name, e)
frappe.exceptions.DuplicateEntryError: (‘Property Setter’, ‘Customer-customer_name-translatable’, Int egrityError(1062, “Duplicate entry ‘Customer-customer_name-translatable’ for key ‘PRIMARY’”))