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: sync_jobs fails #27739

Merged
merged 1 commit into from
Oct 4, 2021
Merged

Conversation

nextchamp-saqib
Copy link
Member

Fixes:

  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/commands/site.py", line 306, in migrate
    migrate(
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/migrate.py", line 70, in migrate
    sync_jobs()
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py", line 134, in sync_jobs
    all_events = insert_events(scheduler_events)
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py", line 146, in insert_events
    event_jobs += insert_event_jobs(events, event_type)
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py", line 164, in insert_event_jobs
    insert_single_event(frequency, event)
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py", line 183, in insert_single_event
    doc.insert()
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/model/document.py", line 235, in insert
    self.run_before_save_methods()
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/model/document.py", line 965, in run_before_save_methods
    self.run_method("validate")
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/model/document.py", line 859, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/model/document.py", line 1155, in composer
    return composed(self, method, *args, **kwargs)
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/model/document.py", line 1140, in runner
    add_to_return_value(self, f(self, method, *args, **kwargs))
  File "/Users/saqibansari/frappe/bench-v13/apps/erpnext/erpnext/support/doctype/service_level_agreement/service_level_agreement.py", line 343, in apply
    doc.doctype not in get_documents_with_active_service_level_agreement():
  File "/Users/saqibansari/frappe/bench-v13/apps/erpnext/erpnext/support/doctype/service_level_agreement/service_level_agreement.py", line 329, in get_documents_with_active_service_level_agreement
    return set_documents_with_active_service_level_agreement()
  File "/Users/saqibansari/frappe/bench-v13/apps/erpnext/erpnext/support/doctype/service_level_agreement/service_level_agreement.py", line 335, in set_documents_with_active_service_level_agreement
    active = [sla.document_type for sla in frappe.get_all("Service Level Agreement", fields=["document_type"])]
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/__init__.py", line 1464, in get_all
    return get_list(doctype, *args, **kwargs)
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/__init__.py", line 1437, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/model/db_query.py", line 105, in execute
    result = self.build_and_run()
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/model/db_query.py", line 142, in build_and_run
    return frappe.db.sql(query, as_dict=not self.as_list, debug=self.debug,
  File "/Users/saqibansari/frappe/bench-v13/apps/frappe/frappe/database/database.py", line 144, in sql
    self._cursor.execute(query)
  File "/Users/saqibansari/frappe/frappe-env/lib/python3.8/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/Users/saqibansari/frappe/frappe-env/lib/python3.8/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/Users/saqibansari/frappe/frappe-env/lib/python3.8/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/Users/saqibansari/frappe/frappe-env/lib/python3.8/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "/Users/saqibansari/frappe/frappe-env/lib/python3.8/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/Users/saqibansari/frappe/frappe-env/lib/python3.8/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "/Users/saqibansari/frappe/frappe-env/lib/python3.8/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/Users/saqibansari/frappe/frappe-env/lib/python3.8/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 'document_type' in 'field list'")

@codecov
Copy link

codecov bot commented Oct 2, 2021

Codecov Report

Merging #27739 (7ac02de) into develop (f8c1c73) will increase coverage by 0.17%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop   #27739      +/-   ##
===========================================
+ Coverage    54.49%   54.66%   +0.17%     
===========================================
  Files         1333     1343      +10     
  Lines        70736    71040     +304     
===========================================
+ Hits         38545    38832     +287     
- Misses       32191    32208      +17     
Impacted Files Coverage Δ
...service_level_agreement/service_level_agreement.py 81.94% <100.00%> (ø)
erpnext/hr/doctype/job_applicant/job_applicant.py 48.21% <0.00%> (-32.35%) ⬇️
...e/asset_value_adjustment/asset_value_adjustment.py 87.80% <0.00%> (-3.66%) ⬇️
...xt/accounts/doctype/journal_entry/journal_entry.py 68.22% <0.00%> (-2.56%) ⬇️
erpnext/stock/reorder_item.py 75.22% <0.00%> (-0.89%) ⬇️
...next/accounts/doctype/subscription/subscription.py 81.55% <0.00%> (-0.58%) ⬇️
erpnext/stock/get_item_details.py 79.38% <0.00%> (-0.47%) ⬇️
erpnext/hr/utils.py 72.80% <0.00%> (-0.44%) ⬇️
erpnext/payroll/doctype/salary_slip/salary_slip.py 83.28% <0.00%> (-0.41%) ⬇️
erpnext/accounts/utils.py 59.51% <0.00%> (-0.19%) ⬇️
... and 50 more

@deepeshgarg007
Copy link
Member

@Mergifyio backport version-13-hotfix

@deepeshgarg007 deepeshgarg007 merged commit a1c4c62 into frappe:develop Oct 4, 2021
@mergify
Copy link
Contributor

mergify bot commented Oct 4, 2021

Command backport version-13-hotfix: success

Backports have been created

asoral pushed a commit to asoral/erpnext that referenced this pull request Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants