Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(patch): move desk prop patch to post model sync #20361

Merged
merged 2 commits into from
Mar 16, 2023

Conversation

surajshetty3416
Copy link
Member

@surajshetty3416 surajshetty3416 commented Mar 16, 2023

Reload "User Email" document type to avoid following failure while migrating.

Executing frappe.core.doctype.role.patches.v13_set_default_desk_properties in <site>.erpnext.com (_2d447848bb75b35f)
Building search index for <site>
Retrieving Routes		    : [=				       ] 2%

Traceback with variables (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
      mod_name = 'frappe.utils.bench_helper'
      alter_argv = True
      mod_spec = ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7efc0b9ff250>, origin='/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py')
      code = <code object <module> at 0x7efc09422810, file "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 1>
      main_globals = {'__name__': '__main__', '__doc__': None, '__package__': 'frappe.utils', '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7efc0b9ff250>, '__spec__': ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7efc0b9ff250>, origin='/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'), '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, '__file__': '/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py', '__cached__': '/home/frappe/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc', 'importlib': <module 'importlib' from '/usr/lib/python3.10/importlib/__init__.py'>, 'json': <module 'json' from '/usr/lib/python3.10/json/__init__.py'>, 'os': <module 'os' from '/usr/lib/python3.10/os.py'>, 'traceback': <module 'traceback' from '/usr/lib/python3.10/traceback.py'>, 'warnings': <module 'warnings' from '/usr/lib/python3.10/warnings.py'>, 'click': <m...
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
      code = <code object <module> at 0x7efc09422810, file "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 1>
      run_globals = {'__name__': '__main__', '__doc__': None, '__package__': 'frappe.utils', '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7efc0b9ff250>, '__spec__': ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7efc0b9ff250>, origin='/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'), '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, '__file__': '/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py', '__cached__': '/home/frappe/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc', 'importlib': <module 'importlib' from '/usr/lib/python3.10/importlib/__init__.py'>, 'json': <module 'json' from '/usr/lib/python3.10/json/__init__.py'>, 'os': <module 'os' from '/usr/lib/python3.10/os.py'>, 'traceback': <module 'traceback' from '/usr/lib/python3.10/traceback.py'>, 'warnings': <module 'warnings' from '/usr/lib/python3.10/warnings.py'>, 'click': <m...
      init_globals = None
      mod_name = '__main__'
      mod_spec = ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7efc0b9ff250>, origin='/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py')
      pkg_name = 'frappe.utils'
      script_name = None
      loader = <_frozen_importlib_external.SourceFileLoader object at 0x7efc0b9ff250>
      fname = '/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'
      cached = '/home/frappe/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, in <module>
    main()
      ...skipped... 25 vars
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name="bench")
      commands = {'frappe': <Group frappe>, 'get-frappe-commands': <Command get-frappe-commands>, 'get-frappe-help': <Command get-frappe-help>}
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
      self = <Group None>
      args = ()
      kwargs = {'prog_name': 'bench'}
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
      self = <Group None>
      args = ['frappe', '--site', 'zapfler.erpnext.com', 'migrate']
      prog_name = 'bench'
      complete_var = None
      standalone_mode = True
      extra = {}
      ctx = <click.core.Context object at 0x7efc09403fd0>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
      _process_result = <function MultiCommand.invoke.<locals>._process_result at 0x7efc0941eb00>
      args = ['migrate']
      cmd_name = 'frappe'
      cmd = <Group frappe>
      sub_ctx = <click.core.Context object at 0x7efc09434040>
      ctx = <click.core.Context object at 0x7efc09403fd0>
      self = <Group None>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
      _process_result = <function MultiCommand.invoke.<locals>._process_result at 0x7efc08f74940>
      args = []
      cmd_name = 'migrate'
      cmd = <Command migrate>
      sub_ctx = <click.core.Context object at 0x7efc09153850>
      ctx = <click.core.Context object at 0x7efc09434040>
      self = <Group frappe>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
      self = <Command migrate>
      ctx = <click.core.Context object at 0x7efc09153850>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      self = <click.core.Context object at 0x7efc09153850>
      callback = <function migrate at 0x7efc092995a0>
      ctx = <click.core.Context object at 0x7efc09153850>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      f = <function migrate at 0x7efc09299360>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
      ctx = <click.core.Context object at 0x7efc09153850>
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      profile = False
      f = <function migrate at 0x7efc092992d0>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 557, in migrate
    SiteMigration(
      context = {'sites': ['zapfler.erpnext.com'], 'force': False, 'verbose': False, 'profile': False}
      skip_failing = False
      skip_search_index = False
      activate_by_import = <module 'traceback_with_variables.activate_by_import' from '/home/frappe/frappe-bench/env/lib/python3.10/site-packages/traceback_with_variables/activate_by_import.py'>
      SiteMigration = <class 'frappe.migrate.SiteMigration'>
      site = 'zapfler.erpnext.com'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 175, in run
    self.run_schema_updates()
      self = <frappe.migrate.SiteMigration object at 0x7efc09153b50>
      site = 'zapfler.erpnext.com'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 41, in wrapper
    ret = method(*args, **kwargs)
      args = (<frappe.migrate.SiteMigration object at 0x7efc09153b50>,)
      kwargs = {}
      method = <function SiteMigration.run_schema_updates at 0x7efc03c5cb80>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 110, in run_schema_updates
    frappe.modules.patch_handler.run_all(
      self = <frappe.migrate.SiteMigration object at 0x7efc09153b50>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 75, in run_all
    run_patch(patch)
      patch_type = <PatchType.pre_model_sync: 'pre_model_sync'>
      executed = {"execute:frappe.reload_doc('desk', 'doctype', 'dashboard')", 'erpnext.patches.v10_0.add_agriculture_domain', 'execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool") # 29-07-2014', 'erpnext.patches.v11_1.delete_scheduling_tool', 'execute:frappe.db.sql("delete from `tabWeb Page` where ifnull(template_path, \'\')!=\'\'")', "execute:frappe.delete_doc('Page', 'applications', ignore_missing=True)", 'erpnext.patches.v5_0.update_tax_amount_after_discount_in_purchase_cycle', 'frappe.patches.v12_0.move_email_and_phone_to_child_table', 'frappe.patches.v12_0.email_unsubscribe', 'erpnext.patches.v5_0.execute_on_doctype_update', 'erpnext.patches.v6_4.fix_expense_included_in_valuation', 'erpnext.patches.v6_4.repost_gle_for_journal_entries_where_reference_name_missing', "execute:frappe.reload_doc('core', 'doctype', 'docfield', force=True) #2018-02-20", 'frappe.patches.v5_0.update_shared', 'execute:frappe.db.sql("delete from `tabDocField` where parent=\'0\'")', 'erpnext.patches.v5_8....
      run_patch = <function run_all.<locals>.run_patch at 0x7efc03a0c9d0>
      patches = ['frappe.patches.v12_0.remove_deprecated_fields_from_doctype #3', 'execute:frappe.utils.global_search.setup_global_search_table()', "execute:frappe.reload_doc('core', 'doctype', 'doctype_action', force=True) #2019-09-23", "execute:frappe.reload_doc('core', 'doctype', 'doctype_link', force=True) #2020-10-17", "execute:frappe.reload_doc('core', 'doctype', 'doctype_state', force=True) #2021-12-15", "execute:frappe.reload_doc('core', 'doctype', 'doctype', force=True) #2017-09-22", "execute:frappe.reload_doc('core', 'doctype', 'docfield', force=True) #2018-02-20", 'frappe.patches.v11_0.drop_column_apply_user_permissions', "execute:frappe.reload_doc('core', 'doctype', 'custom_docperm')", "execute:frappe.reload_doc('core', 'doctype', 'docperm') #2018-05-29", "execute:frappe.reload_doc('core', 'doctype', 'comment')", "execute:frappe.reload_doc('core', 'doctype', 'document_naming_rule', force=True)", "execute:frappe.reload_doc('core', 'doctype', 'module_def') #2020-08-28", "execute:frappe.reloa...
      patch = 'frappe.core.doctype.role.patches.v13_set_default_desk_properties'
      skip_failing = False
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 62, in run_patch
    if not run_single(patchmodule=patch):
      patch = 'frappe.core.doctype.role.patches.v13_set_default_desk_properties'
      skip_failing = False
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 150, in run_single
    return execute_patch(patchmodule, method, methodargs)
      patchmodule = 'frappe.core.doctype.role.patches.v13_set_default_desk_properties'
      method = None
      methodargs = None
      force = False
      conf = <LocalProxy unbound>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 186, in execute_patch
    _patch()
      patchmodule = 'frappe.core.doctype.role.patches.v13_set_default_desk_properties'
      method = None
      methodargs = None
      has_patch_file = True
      patch = 'frappe.core.doctype.role.patches.v13_set_default_desk_properties.execute'
      docstring = ''
      _patch = <function execute at 0x7efc031b6c20>
      start_time = 1678302088.954021
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/role/patches/v13_set_default_desk_properties.py", line 13, in execute
    role_doc.save()
      role = {'name': 'Guest', 'desk_access': 1}
      role_doc = <Role: Guest>
      key = 'dashboard'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 305, in save
    return self._save(*args, **kwargs)
      self = <Role: Guest>
      args = ()
      kwargs = {}
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 356, in _save
    self.run_post_save_methods()
      self = <Role: Guest>
      ignore_permissions = None
      ignore_version = None
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1077, in run_post_save_methods
    self.run_method("on_update")
      self = <Role: Guest>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 909, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
      self = <Role: Guest>
      args = ()
      kwargs = {}
      fn = <function Document.run_method.<locals>.fn at 0x7efc031b6e60>
      method = 'on_update'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1259, in composer
    return composed(self, method, *args, **kwargs)
      self = <Role: Guest>
      args = ()
      kwargs = {}
      hooks = [<function clear_doctype_notifications at 0x7efc093d7d00>, <function update_feed at 0x7efc038ed870>, <function process_workflow_actions at 0x7efc038ee950>, <function apply at 0x7efc03700e50>, <function attach_files_to_document at 0x7efc038ec9d0>, <function notify_consumers at 0x7efc038ed000>, <function update_due_date at 0x7efc03700ee0>, <function apply_permissions_for_non_standard_user_type at 0x7efc0386f7f0>]
      method = 'on_update'
      doc_events = {'*': {'after_insert': ['frappe.event_streaming.doctype.event_update_log.event_update_log.notify_consumers'], 'on_update': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.core.doctype.activity_log.feed.update_feed', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply', 'frappe.core.doctype.file.utils.attach_files_to_document', 'frappe.event_streaming.doctype.event_update_log.event_update_log.notify_consumers', 'frappe.automation.doctype.assignment_rule.assignment_rule.update_due_date', 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type'], 'after_rename': ['frappe.desk.notifications.clear_doctype_notifications'], 'on_cancel': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.event_streaming.doctype.event_update_log.event_update_log.notify_co...
      handler = 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type'
      composed = <function Document.hook.<locals>.compose.<locals>.runner at 0x7efc031ed120>
      compose = <function Document.hook.<locals>.compose at 0x7efc031ed6c0>
      f = <function Document.run_method.<locals>.fn at 0x7efc031b6e60>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1241, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
      self = <Role: Guest>
      method = 'on_update'
      args = ()
      kwargs = {}
      add_to_return_value = <function Document.hook.<locals>.add_to_return_value at 0x7efc031b6b90>
      fn = <function Document.run_method.<locals>.fn at 0x7efc031b6e60>
      hooks = (<function clear_doctype_notifications at 0x7efc093d7d00>, <function update_feed at 0x7efc038ed870>, <function process_workflow_actions at 0x7efc038ee950>, <function apply at 0x7efc03700e50>, <function attach_files_to_document at 0x7efc038ec9d0>, <function notify_consumers at 0x7efc038ed000>, <function update_due_date at 0x7efc03700ee0>, <function apply_permissions_for_non_standard_user_type at 0x7efc0386f7f0>)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 906, in fn
    return method_object(*args, **kwargs)
      self = <Role: Guest>
      args = ()
      kwargs = {}
      method_object = <bound method Role.on_update of <Role: Guest>>
      method = 'on_update'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/role/role.py", line 64, in on_update
    user.save()
      self = <Role: Guest>
      user_name = 'Guest'
      user = <User: Guest>
      user_type = 'System User'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 305, in save
    return self._save(*args, **kwargs)
      self = <User: Guest>
      args = ()
      kwargs = {}
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 339, in _save
    self.run_before_save_methods()
      self = <User: Guest>
      ignore_permissions = None
      ignore_version = None
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1040, in run_before_save_methods
    self.run_method("validate")
      self = <User: Guest>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 909, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
      self = <User: Guest>
      args = ()
      kwargs = {}
      fn = <function Document.run_method.<locals>.fn at 0x7efc031b71c0>
      method = 'validate'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1259, in composer
    return composed(self, method, *args, **kwargs)
      self = <User: Guest>
      args = ()
      kwargs = {}
      hooks = [<function validate_employee_role at 0x7efc03060af0>, <function apply at 0x7efc03756ef0>]
      method = 'validate'
      doc_events = {'*': {'after_insert': ['frappe.event_streaming.doctype.event_update_log.event_update_log.notify_consumers'], 'on_update': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.core.doctype.activity_log.feed.update_feed', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply', 'frappe.core.doctype.file.utils.attach_files_to_document', 'frappe.event_streaming.doctype.event_update_log.event_update_log.notify_consumers', 'frappe.automation.doctype.assignment_rule.assignment_rule.update_due_date', 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type'], 'after_rename': ['frappe.desk.notifications.clear_doctype_notifications'], 'on_cancel': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.event_streaming.doctype.event_update_log.event_update_log.notify_co...
      handler = 'erpnext.support.doctype.service_level_agreement.service_level_agreement.apply'
      composed = <function Document.hook.<locals>.compose.<locals>.runner at 0x7efc031ed7e0>
      compose = <function Document.hook.<locals>.compose at 0x7efc031ed1b0>
      f = <function Document.run_method.<locals>.fn at 0x7efc031b71c0>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1241, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
      self = <User: Guest>
      method = 'validate'
      args = ()
      kwargs = {}
      add_to_return_value = <function Document.hook.<locals>.add_to_return_value at 0x7efc03387eb0>
      fn = <function Document.run_method.<locals>.fn at 0x7efc031b71c0>
      hooks = (<function validate_employee_role at 0x7efc03060af0>, <function apply at 0x7efc03756ef0>)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 906, in fn
    return method_object(*args, **kwargs)
      self = <User: Guest>
      args = ()
      kwargs = {}
      method_object = <bound method User.validate of <User: Guest>>
      method = 'validate'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 85, in validate
    ask_pass_update()
      self = <User: Guest>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 786, in ask_pass_update
    password_list = frappe.get_all(
      set_default = <function set_default at 0x7efc0a58bf40>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1924, in get_all
    return get_list(doctype, *args, **kwargs)
      doctype = 'User Email'
      args = ()
      kwargs = {'filters': {'awaiting_password': 1, 'used_oauth': 0}, 'pluck': 'parent', 'distinct': True, 'ignore_permissions': True, 'limit_page_length': 0}
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1896, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
      doctype = 'User Email'
      args = ()
      kwargs = {'filters': {'awaiting_password': 1, 'used_oauth': 0}, 'pluck': 'parent', 'distinct': True, 'ignore_permissions': True, 'limit_page_length': 0}
      frappe = <module 'frappe' from '/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py'>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py", line 188, in execute
    result = self.build_and_run()
      self = <frappe.model.db_query.DatabaseQuery object at 0x7efc0339f310>
      fields = None
      filters = {'awaiting_password': 1, 'used_oauth': 0}
      or_filters = None
      docstatus = None
      group_by = None
      order_by = 'KEEP_DEFAULT_ORDERING'
      limit_start = False
      limit_page_length = 0
      as_list = False
      with_childnames = False
      debug = False
      ignore_permissions = True
      user = None
      with_comment_count = False
      join = 'left join'
      distinct = True
      start = None
      page_length = None
      limit = None
      ignore_ifnull = False
      save_user_settings = False
      save_user_settings_fields = False
      update = None
      add_total_row = None
      user_settings = None
      reference_doctype = None
      run = True
      strict = True
      ignore_ddl = False
      parent_doctype = None
      pluck = 'parent'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py", line 228, in build_and_run
    return frappe.db.sql(
      self = <frappe.model.db_query.DatabaseQuery object at 0x7efc0339f310>
      args = {'tables': '`tabUser Email`', 'conditions': 'where `tabUser Email`.`awaiting_password` = 1.0 and ifnull(`tabUser Email`.`used_oauth`, 0) = 0.0', 'fields': 'distinct `tabUser Email`.`parent`', 'order_by': '', 'group_by': '', 'limit': ''}
      query = 'select distinct `tabUser Email`.`parent`\n\t\t\tfrom `tabUser Email`\n\t\t\twhere `tabUser Email`.`awaiting_password` = 1.0 and ifnull(`tabUser Email`.`used_oauth`, 0) = 0.0\n\t\t\t\n\t\t\t\n\t\t\t'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 219, in sql
    self._cursor.execute(query, values)
      self = <frappe.database.mariadb.database.MariaDBDatabase object at 0x7efc03c74100>
      query = 'select distinct `tabUser Email`.`parent`\n\t\t\tfrom `tabUser Email`\n\t\t\twhere `tabUser Email`.`awaiting_password` = 1.0 and coalesce(`tabUser Email`.`used_oauth`, 0) = 0.0'
      values = None
      as_dict = True
      as_list = 0
      formatted = 0
      debug = False
      ignore_ddl = False
      as_utf8 = 0
      auto_commit = 0
      update = None
      explain = False
      run = True
      pluck = False
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
      self = <pymysql.cursors.Cursor object at 0x7efc03cd1150>
      query = 'select distinct `tabUser Email`.`parent`\n\t\t\tfrom `tabUser Email`\n\t\t\twhere `tabUser Email`.`awaiting_password` = 1.0 and coalesce(`tabUser Email`.`used_oauth`, 0) = 0.0'
      args = None
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
      self = <pymysql.cursors.Cursor object at 0x7efc03cd1150>
      q = 'select distinct `tabUser Email`.`parent`\n\t\t\tfrom `tabUser Email`\n\t\t\twhere `tabUser Email`.`awaiting_password` = 1.0 and coalesce(`tabUser Email`.`used_oauth`, 0) = 0.0'
      conn = <pymysql.connections.Connection object at 0x7efc03cd0fa0>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
      self = <pymysql.connections.Connection object at 0x7efc03cd0fa0>
      sql = b'select distinct `tabUser Email`.`parent`\n\t\t\tfrom `tabUser Email`\n\t\t\twhere `tabUser Email`.`awaiting_password` = 1.0 and coalesce(`tabUser Email`.`used_oauth`, 0) = 0.0'
      unbuffered = False
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
      self = <pymysql.connections.Connection object at 0x7efc03cd0fa0>
      unbuffered = False
      result = <pymysql.connections.MySQLResult object at 0x7efc03313670>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
      self = <pymysql.connections.MySQLResult object at 0x7efc03313670>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
      self = <pymysql.connections.Connection object at 0x7efc03cd0fa0>
      packet_type = <class 'pymysql.protocol.MysqlPacket'>
      buff = bytearray(b"\xff\x1e\x04#42S22Unknown column \'tabUser Email.used_oauth\' in \'where clause\'")
      packet_header = b'D\x00\x00\x01'
      btrl = 68
      btrh = 0
      packet_number = 1
      bytes_to_read = 68
      recv_data = b"\xff\x1e\x04#42S22Unknown column 'tabUser Email.used_oauth' in 'where clause'"
      packet = <pymysql.protocol.MysqlPacket object at 0x7efc0339dfc0>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
      self = <pymysql.protocol.MysqlPacket object at 0x7efc0339dfc0>
      errno = 1054
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
      data = b"\xff\x1e\x04#42S22Unknown column 'tabUser Email.used_oauth' in 'where clause'"
      errno = 1054
      errval = "Unknown column 'tabUser Email.used_oauth' in 'where clause'"
      errorclass = <class 'pymysql.err.OperationalError'>
pymysql.err.OperationalError: (1054, "Unknown column 'tabUser Email.used_oauth' in 'where clause'")

Issue introduced after #16935

@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label Mar 16, 2023
@surajshetty3416 surajshetty3416 removed the add-test-cases Add test case to validate fix or enhancement label Mar 16, 2023
@ankush ankush reopened this Mar 16, 2023
@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label Mar 16, 2023
@ankush ankush requested review from a team and shariquerik and removed request for a team March 16, 2023 10:55
@ankush ankush changed the title fix(patch): Reload user_email to avoid failure fix(patch): move desk prop patch to post model sync Mar 16, 2023
@ankush ankush added backport version-14-hotfix backport to version 14 and removed add-test-cases Add test case to validate fix or enhancement labels Mar 16, 2023
@ankush ankush merged commit 0743225 into develop Mar 16, 2023
@ankush ankush deleted the fix-patch-desk-props branch March 16, 2023 11:08
mergify bot pushed a commit that referenced this pull request Mar 16, 2023
* fix(patch): Reload user_email to avoid failure

* fix: move patch to post sync

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>

[Skip ci]

(cherry picked from commit 0743225)
ankush pushed a commit that referenced this pull request Mar 16, 2023
* fix(patch): Reload user_email to avoid failure

* fix: move patch to post sync

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>

[Skip ci]

(cherry picked from commit 0743225)

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
frappe-pr-bot pushed a commit that referenced this pull request Mar 21, 2023
# [14.29.0](v14.28.2...v14.29.0) (2023-03-21)

### Bug Fixes

* allow 5 column layout in doctype form ([7eb3bb4](7eb3bb4))
* Allow card actions (adding/dragging) if access to reference doctype ([bc5b362](bc5b362))
* Check perms on Kanban Column actions ([efa74bb](efa74bb))
* Check Reference Doctype perms & control indicator change ([c2fe3b0](c2fe3b0))
* clear contacts cache (backport [#20397](#20397)) ([#20406](#20406)) ([1905241](1905241))
* **Database:** clear background jobs and realtime logs on rollback ([#20236](#20236)) ([#20417](#20417)) ([750059b](750059b))
* Dispatch `update_order` always. Handle perm-wise action in backend ([e5c5cdb](e5c5cdb))
* handle image extraction while editing comment ([00c5f32](00c5f32))
* Hide Menu if empty & render columns without state change ([a9b5f04](a9b5f04))
* hide My Workspace sidebar section if empty in edit mode ([b51dd18](b51dd18))
* Hide Sort Selector in Kanban ([13be928](13be928))
* Kanban Board Menu Items Accessibility via perms ([4ffc7a5](4ffc7a5))
* **meta:** get_permitted_fields with no field-columns (backport [#20401](#20401)) ([#20405](#20405)) ([644c6c8](644c6c8))
* **patch:** move desk prop patch to post model sync ([#20361](#20361)) ([#20362](#20362)) ([661820a](661820a))
* **print:** Language set in document should have higher precedence (backport [#20336](#20336)) ([#20338](#20338)) ([a27178d](a27178d))
* server method to return evaluated dict of perms for a document ([d1446b8](d1446b8))
* Set link title in PDF ([716db05](716db05))
* sidebar becomes unhidden while removing skeleton ([71ac099](71ac099))
* skip InReadOnlyMode in error snapshots ([#20358](#20358)) ([#20359](#20359)) ([eb14fe1](eb14fe1))
* treat Phone as Data on list view ([06395dd](06395dd))
* **workspace:** Setup Dynamic Link if value exists ([b393d5b](b393d5b))

### Features

* clear integration log request logs ([#20373](#20373)) ([#20374](#20374)) ([4c48f55](4c48f55))
* configurable rounding methods (v14 port) ([#20330](#20330)) ([0d60385](0d60385)), closes [#20299](#20299)
* **minor:** log datetime in worker log  ([#20414](#20414)) ([#20418](#20418)) ([bfda74d](bfda74d))

### Performance Improvements

* Dont update list view data if list view not active ([#20396](#20396)) ([#20420](#20420)) ([3a6e307](3a6e307))
* rebuild website search index in background (backport [#17974](#17974)) ([#20335](#20335)) ([c1b0210](c1b0210))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants