[v11] Global Search - showing old entry of Supplier with adjusted Name

I have a little problem with the Global Search in v11

There is a custom field in the Supplier named Supplier Code which is a unique value.
Now One of my suppliers had a type in the name

wrong name: MySuperSuplier
right name: My Super Supplier

the supplier Code for this is: 12345x

after having corrected the typo the Global Search

  1. still shows hits for the Search term MySuperSuplier
  2. shows 2 records for the Search Term 12345x (the supplier code). An entry with the old wrong spelling & a second for the new spelling of the Name

There is only one entry (as it should be)

I tried to solve this by

  1. refreshing the browser cache in any form I could think of
  2. cd ~/frappe-bench/ && bench clear-cache
  3. bench restart
  4. restarting the server

Try the solution in this thread.

bench rebuild-global-search

thanks. Even though I got a large error message upon that commend it solved my issue.

If you can maybe share that message, screenshot or traceback, that could be good feedback for troubleshooting!?

there is no trouble any longer really. The instance seems to run as it should and the problem is gone despite the error message below.

~/frappe-bench$ bench rebuild-global-search
Rebuilding Global Search            : [===============                         ]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/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
    main()
  File "/opt/bench/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/opt/bench/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/opt/bench/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/opt/bench/frappe-bench/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/frappe-bench/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/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/bench/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/opt/bench/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 "/opt/bench/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 25, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/opt/bench/frappe-bench/apps/frappe/frappe/commands/utils.py", line 608, in rebuild_global_search
    rebuild_for_doctype(doctype)
  File "/opt/bench/frappe-bench/apps/frappe/frappe/utils/global_search.py", line 110, in rebuild_for_doctype
    all_records = frappe.get_all(doctype, fields=fieldnames, filters=_get_filters())
  File "/opt/bench/frappe-bench/apps/frappe/frappe/__init__.py", line 1281, in get_all
    return get_list(doctype, *args, **kwargs)
  File "/opt/bench/frappe-bench/apps/frappe/frappe/__init__.py", line 1254, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
  File "/opt/bench/frappe-bench/apps/frappe/frappe/model/db_query.py", line 93, in execute
    result = self.build_and_run()
  File "/opt/bench/frappe-bench/apps/frappe/frappe/model/db_query.py", line 105, in build_and_run
    args = self.prepare_args()
  File "/opt/bench/frappe-bench/apps/frappe/frappe/model/db_query.py", line 123, in prepare_args
    self.set_optional_columns()
  File "/opt/bench/frappe-bench/apps/frappe/frappe/model/db_query.py", line 272, in set_optional_columns
    columns = frappe.db.get_table_columns(self.doctype)
  File "/opt/bench/frappe-bench/apps/frappe/frappe/database.py", line 903, in get_table_columns
    return self.get_db_table_columns('tab' + doctype)
  File "/opt/bench/frappe-bench/apps/frappe/frappe/database.py", line 899, in get_db_table_columns
    return [r[0] for r in self.sql("DESC `%s`" % table)]
  File "/opt/bench/frappe-bench/apps/frappe/frappe/database.py", line 210, in sql
    self._cursor.execute(query)
  File "/opt/bench/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 170, in execute
    result = self._query(query)
  File "/opt/bench/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 328, in _query
    conn.query(q)
  File "/opt/bench/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 516, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/opt/bench/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 727, in _read_query_result
    result.read()
  File "/opt/bench/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1066, in read
    first_packet = self.connection._read_packet()
  File "/opt/bench/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 683, in _read_packet
    packet.check_error()
  File "/opt/bench/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/protocol.py", line 220, in check_error
    err.raise_mysql_exception(self._data)
  File "/opt/bench/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, u"Table 'e37bd404cdaf3e05.tabQuickBooks Migrator' doesn't exist")

there is no trouble any longer though. The instance seems to run as it should and the problem is gone.

1 Like