Please Help cannot log in due to erased custom doctype

If you do NOT already have your own backup function you can always get the last one from the automatic backups that ERPnext makes by default.

Normally those are found here:

~/frappe-bench/sites/site1.local/private/backups

BKM

Hi bkm,

I don’t have my own backup right now, where are the automatic backups that ERPnext makes by default, and do you have any steps on how to restore them?

Thank you very much for the help.

Thank you for the path, I found a guide online on how to restore the backup and will try to do it, I will be posting after I try it

Grab the latest one from here:

~/frappe-bench/sites/[your.site.name]/private/backups

Replace [your.site.name] with whatever site appears in the frappe-bench/sites directory.

Copy the latest backup to your home directory. It would look something like this:

20220913_060004-site1_local-database.sql.gz

Then go back to your home directory and run:

gunzip 20220913_060004-site1_local-database.sql.gz

This will unzip the compressed sql file to a full sql file. Then run the following commands to do the restore from:

cd ~frappe-bench
bench set-maintenance-mode on
bench --force --site [your.site.name] restore /path_to_sql_file

When the restore finishes, run the following commands:

sudo service mysql restart
bench --site [your.site.name] migrate
bench set-maintenance-mode off

At this point you should be back to at least a workable system.

Hope this helps

As always… Your mileage may vary :sunglasses:

~BKM

On Edit:
Just to help you understand what the commands mean:

bench set-maintenance-mode on
(locks out user logins so your work is not interrupted)

sudo service mysql restart
(forces mariadb to restart and and it clears the buffers in memory. This is important after a restore in order to regain your previous performance level)

bench --site [your.site.name] migrate
(since you were messing with doctypes, this command sort of resets ERPNext to work with whatever database schema was active at the time of the last backup)

bench set-maintenance-mode off
(this restores system logins so you can access the system through the browser again)

The restore command probably doesn’t need an explanation.

BKM

Thank you for the information, I have checked the latest backup and it is from last year, I think I might need to find another way to fix the problem :frowning: Do you have any idea?

Unfortunately, no.

This would require the assistance of a mysql expert to dig into your system and find the offending parts to fix them.

I am not that person, and they are not easy to come by.

When you do recover from this (at some point) please consider setting up something like the link below to take control of your own backups and prevent another problem:

I am wishing you good luck with the recovery effort.

BKM

Yes, I was thinking I might need an expert to help me, thank you for your help though.

I hope someone with this knowledge reads the thread and contacts me, so I can hire him/her.

hi @georgems

If only the Tasks doctype is deleted… Then a simple

bench update --reset

should bring back the standard doctypes.

1 Like

I have tried it, and I am getting this error:

  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 434, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.DoesNotExistError: DocType Amazon SP API Settings not found

What version of Frappe and Erpnext are you on ?

Amazon SP API is from the ecommerce integration app… You would need to reinstall the ecommerce integration app to get that sorted out.

This error has nothing to do with your Tasks error you are getting. The bench update --reset should sort that out.

I have tried to install the ecommerce integration using these commands but I still get the same error:

# Production installation
$ bench get-app ecommerce_integrations --branch main

# install on site
$ bench --site sitename install-app ecommerce_integrations

Can I unisntall the integration? we don’t use it.

our app versions are these.
ecommerce_integrations 1.11.1
erpnext 13.39.0
frappe 13.41.1

yes you can uninstall it…

I have presumed you were running V14 , where all the ecommerce integration like shopify, amazon etc are removed from core and install as a separate app called ecommerce integrations which you just installed.

Once removed… could you run bench migrate and do a bench update --reset and post here the complete error if any

I have uninstalled the app and run bench update --reset and there are many errors

Compiling Python files...
*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/.github/helper/translation.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/.github/helper/translation.py", line 17
    print(f'Checking: {_file}')
                             ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/deferred_revenue.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/deferred_revenue.py", line 67
    conditions += f"AND p.company = {frappe.db.escape(company)}"
                                                               ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliatio                                                                                                             n_tool.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py", l                                                                                                             ine 513
    return f"""
        SELECT
                (CASE WHEN reference_no=%(reference_no)s THEN 1 ELSE 0 END
                + CASE WHEN (party_type = %(party_type)s AND party = %(party)s ) THEN 1 ELSE 0  END
                + 1 ) AS rank,
                'Payment Entry' as doctype,
                name,
                paid_amount,
                reference_no,
                reference_date,
                party,
                party_type,
                posting_date,
                {currency_field}
        FROM
                `tabPayment Entry`
        WHERE
                paid_amount {amount_condition} %(amount)s
                AND docstatus = 1
                AND payment_type IN (%(payment_type)s, 'Internal Transfer')
                AND ifnull(clearance_date, '') = ""
                AND {account_from_to} = %(bank_account)s
        """






















          ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py", line 49
    "year": f"_Test Fiscal Year {year}",
                                      ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py'..                                                                                                             .
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py", line 86
    msg = f"The field {frappe.bold(self.applicable_for)} is required"
                                                                    ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/report/consolidated_financial_statement/consolidate                                                                                                             d_financial_statement.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_s                                                                                                             tatement.py", line 313
    "label": f"{company} ({currency})",
                                     ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/report/sales_register/sales_register.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/report/sales_register/sales_register.py", line 371
    return f""" and exists(select name from `tab{table}`
                                where parent=`tabSales Invoice`.name
                                        and ifnull(`tab{table}`.{field}, '') = %({field})s)"""


                                                                                             ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/test/test_reports.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/test/test_reports.py", line 15
    REPORT_FILTER_TEST_CASES: List[Tuple[ReportName, ReportFilters]] = [
                            ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/buying/report/purchase_order_analysis/purchase_order_analysi                                                                                                             s.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py", line 4                                                                                                             7
    conditions += f" and po.{field} = %({field})s"
                                                 ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/buying_controller.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/buying_controller.py", line 366
    msg = f"Reserved Warehouse is mandatory for the Item {frappe.bold(row.rm_item_code)} in Raw Materials supplied"
                                                                                                                  ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/sales_and_purchase_return.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/sales_and_purchase_return.py", line 535
    rate = frappe.db.get_value(f"{voucher_type} Item", voucher_detail_no, "incoming_rate")
                                                    ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/selling_controller.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/selling_controller.py", line 253
    f"""(item_code = {frappe.db.escape(valuation_rate[0])}
                        and warehouse = {frappe.db.escape(valuation_rate[1])})"""

                                                                                ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py", line 482
    msg = f"Row #{row.idx}: Quality Inspection is required for Item {frappe.bold(row.item_code)}"
                                                                                                ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/subcontracting.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/subcontracting.py", line 180
    fields.append(f"`tabStock Entry Detail`.`{field}` As {alias_dict.get(field, field)}")
                                                                                       ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/crm/doctype/contract/contract.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/crm/doctype/contract/contract.py", line 21
    name = f"{name} - {self.contract_template} Agreement"
                                                        ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/crm/doctype/opportunity/opportunity.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/crm/doctype/opportunity/opportunity.py", line 196
    opts.description = f"Contact {self.contact_person}"
                                                      ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/e_commerce/doctype/e_commerce_settings/e_commerce_settings.p                                                                                                             y'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/e_commerce/doctype/e_commerce_settings/e_commerce_settings.py", line 119
    msg = f"Please specify currency in Company {self.company}"
                                                             ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/e_commerce/doctype/item_review/test_item_review.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/e_commerce/doctype/item_review/test_item_review.py", line 49
    self.fail(f"Error while publishing review for {web_item}")
                                                            ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/e_commerce/doctype/website_item/test_website_item.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/e_commerce/doctype/website_item/test_website_item.py", line 89
    self.fail(f"Expected db index on these columns: {', '.join(expected_columns)}")
                                                                                 ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/e_commerce/doctype/website_item/website_item.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/e_commerce/doctype/website_item/website_item.py", line 348
    tab_values[f"tab_{row.idx + 1}_title"] = _(row.label)
                                        ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/e_commerce/product_data_engine/filters.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/e_commerce/product_data_engine/filters.py", line 162
    label = f"{discount}% and below"
                                   ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/e_commerce/product_data_engine/test_product_data_engine.py'.                                                                                                             ..
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/e_commerce/product_data_engine/test_product_data_engine.py", line 189
    make_web_pricing_rule(title=f"Test Pricing Rule for {item_code}", item_code=item_code, selling=1)
                                                                   ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/e_commerce/redisearch_utils.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/e_commerce/redisearch_utils.py", line 233
    return f"{WEBSITE_ITEM_KEY_PREFIX}{name}"
                                            ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_meth                                                                                                             ods.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py", line                                                                                                              138
    frappe.log_error(message=e, title=f'Method "{mws_method.__name__}" failed')
                                                                             ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/utils.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/utils.py", line 45
    server_url = f"{scheme}://{netloc}/api/method/{endpoint}"
                                                            ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/healthcare/doctype/patient_appointment/patient_appointment.p                                                                                                             y'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py", line 448
    slot_name = f"{schedule_entry.schedule}"
                                           ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/healthcare/doctype/patient_appointment/test_patient_appointm                                                                                                             ent.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/healthcare/doctype/patient_appointment/test_patient_appointment.py", line                                                                                                              372
    if frappe.db.exists("Patient", {"firstname": f"_Test Patient {str(id)}"}):
                                                                          ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/employee/employee_reminders.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/employee/employee_reminders.py", line 173
    "mariadb": f"""
                        SELECT `personal_email`, `company`, `company_email`, `user_id`, `employee_name` AS 'name', `image`, `dat                                                                                                             e_of_joining`
                        FROM `tabEmployee`
                        WHERE
                                DAY({condition_column}) = DAY(%(today)s)
                        AND
                                MONTH({condition_column}) = MONTH(%(today)s)
                        AND
                                YEAR({condition_column}) < YEAR(%(today)s)
                        AND
                                `status` = 'Active'
                """,

                                                                                                                                                                                                                                             









                  ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py", line 1125
    + f" ({cstr(d.leave_type)})"
                               ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py", line 40
    self.child_items: List["BOMTree"] = []  # list of child items
                    ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/bom/test_bom.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/bom/test_bom.py", line 303
    if not frappe.db.exists("BOM", f"BOM-{fg_item_non_whole.item_code}-001"):
                                                                          ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/bom_update_log/bom_update_log.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/bom_update_log/bom_update_log.py", line 154
    batch_size = 20_000
                      ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/production_plan/production_plan.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/production_plan/production_plan.py", line 930
    so_filter += f" and {value[1]} {value[0]} %({field})s"
                                                         ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/production_plan/test_production_plan.p                                                                                                             y'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/production_plan/test_production_plan.py", line 363
    msg=f"Following warehouses were expected {', '.join(missing_warehouse)}",
                                                                           ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/work_order/test_work_order.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/work_order/test_work_order.py", line 827
    bom_no = f"BOM-{fg_item_non_whole.item_code}-001"
                                                    ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/report/process_loss_report/process_loss_report                                                                                                             .py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/report/process_loss_report/process_loss_report.py", line 11                                                                                                             6
    filter_conditions.update({"item_filter": f"AND wo.production_item='{production_item}'"})
                                                                                         ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/report/test_reports.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/report/test_reports.py", line 16
    REPORT_FILTER_TEST_CASES: List[Tuple[ReportName, ReportFilters]] = [
                            ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v11_0/rename_bom_wo_fields.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v11_0/rename_bom_wo_fields.py", line 13
    f"update `tabBOM` set {changed_field} = '0' where trim(coalesce({changed_field}, ''))= ''"
                                                                                             ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v12_0/setup_einvoice_fields.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v12_0/setup_einvoice_fields.py", line 106
    "distance": [{"mandatory_depends_on": f"eval:{einvoice_cond} && doc.transporter"}],
                                                                                   ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v13_0/add_missing_fg_item_for_stock_entry.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v13_0/add_missing_fg_item_for_stock_entry.py", line 98
    print(f"SLE entries not posted for the stock entry {doc.name}")
                                                                 ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v13_0/convert_to_website_item_in_item_card_group_tem                                                                                                             plate.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v13_0/convert_to_website_item_in_item_card_group_template.py", li                                                                                                             ne 48
    fields.append(f"card_{i}_item")  # fields like 'card_1_item', etc.
                                 ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v13_0/create_gst_payment_entry_fields.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v13_0/create_gst_payment_entry_fields.py", line 80
    frappe.delete_doc_if_exists("Custom Field", f"Payment Entry-{field}")
                                                                       ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py", line 62
    print(f"Failed to correct gl entries of {invoice.name}")
                                                          ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/payroll/doctype/employee_tax_exemption_declaration/test_empl                                                                                                             oyee_tax_exemption_declaration.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/payroll/doctype/employee_tax_exemption_declaration/test_employee_tax_exem                                                                                                             ption_declaration.py", line 480
    f"{frequency} Structure for HRA Exemption",
                                             ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/projects/doctype/timesheet/timesheet.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/projects/doctype/timesheet/timesheet.py", line 289
    query = f"""
                SELECT
                        tsd.name as name,
                        tsd.parent as time_sheet,
                        tsd.from_time as from_time,
                        tsd.to_time as to_time,
                        tsd.billing_hours as billing_hours,
                        tsd.billing_amount as billing_amount,
                        tsd.activity_type as activity_type,
                        tsd.description as description,
                        ts.currency as currency,
                        tsd.project_name as project_name
                FROM `tabTimesheet Detail` tsd
                        INNER JOIN `tabTimesheet` ts
                        ON ts.name = tsd.parent
                WHERE
                        tsd.parenttype = 'Timesheet'
                        AND tsd.docstatus = 1
                        AND tsd.is_billable = 1
                        AND tsd.sales_invoice is NULL
                        {condition}
                ORDER BY tsd.from_time ASC
        """






















          ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/projects/report/employee_hours_utilization_based_on_timeshee                                                                                                             t/employee_hours_utilization_based_on_timesheet.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_ho                                                                                                             urs_utilization_based_on_timesheet.py", line 140
    additional_filters += f"AND ttd.{field} = '{self.filters.get(field)}'"
                                                                         ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/projects/report/employee_hours_utilization_based_on_timeshee                                                                                                             t/test_employee_util.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employ                                                                                                             ee_util.py", line 82
    frappe.db.sql(f"DELETE FROM `tabProject` WHERE name='{cls.test_project.name}'")
                                                                                 ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py", line 369
    if t.account_head in gst_accounts[f"{tax_type}_account"]:
                                                          ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wis                                                                                                             e_summary_of_outward_supplies.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_                                                                                                             outward_supplies.py", line 169
    f"""
                SELECT
                        `tabSales Invoice Item`.gst_hsn_code,
                        `tabSales Invoice Item`.stock_uom,
                        sum(`tabSales Invoice Item`.stock_qty) AS stock_qty,
                        sum(`tabSales Invoice Item`.taxable_value) AS taxable_value,
                        sum(`tabSales Invoice Item`.base_price_list_rate) AS base_price_list_rate,
                        `tabSales Invoice Item`.parent,
                        `tabSales Invoice Item`.item_code,
                        `tabGST HSN Code`.description
                FROM
                        `tabSales Invoice`
                        INNER JOIN `tabSales Invoice Item` ON `tabSales Invoice`.name = `tabSales Invoice Item`.parent
                        INNER JOIN `tabGST HSN Code` ON `tabSales Invoice Item`.gst_hsn_code = `tabGST HSN Code`.name
                WHERE
                        `tabSales Invoice`.docstatus = 1
                        AND `tabSales Invoice Item`.gst_hsn_code IS NOT NULL
                        {conditions}
                GROUP BY
                        `tabSales Invoice Item`.parent,
                        `tabSales Invoice Item`.item_code,
                        `tabSales Invoice Item`.gst_hsn_code,
                        `tabSales Invoice Item`.uom
                ORDER BY
                        `tabSales Invoice Item`.gst_hsn_code,
                        `tabSales Invoice Item`.uom
                """.format(


























                  ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/report/irs_1099/irs_1099.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/report/irs_1099/irs_1099.py", line 124
    f"{filters.fiscal_year} {filters.company} IRS 1099 Forms{IRS_1099_FORMS_FILE_EXTENSION}"
                                                                                           ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/report/ksa_vat/ksa_vat.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/report/ksa_vat/ksa_vat.py", line 174
    f"{doctype} Item",
                    ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/saudi_arabia/utils.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/saudi_arabia/utils.py", line 117
    filename = f"QRCode-{name}.png".replace(os.path.sep, "__")
                                  ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/saudi_arabia/wizard/operations/setup_ksa_vat_settin                                                                                                             g.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/saudi_arabia/wizard/operations/setup_ksa_vat_setting.py", line 2                                                                                                             8
    "item_tax_template": f"{item_tax_template} - {company.abbr}",
                                                               ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/doctype/item_group/item_group.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/doctype/item_group/item_group.py", line 88
    values[f"slide_{index + 1}_image"] = slide.image
                                    ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/doctype/naming_series/naming_series.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/doctype/naming_series/naming_series.py", line 225
    return _("Failed to generate names from the series") + f"\n{str(e)}"
                                                                       ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/doctype/naming_series/test_naming_series.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/setup/doctype/naming_series/test_naming_series.py", line 12
    self.ns: NamingSeries = frappe.get_doc("Naming Series")
           ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/bin/bin.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/bin/bin.py", line 95
    f"""select sum({qty_field})
                        from
                                `tabStock Entry` se, `tabStock Entry Detail` sed, `tabPurchase Order` po
                        where
                                se.docstatus=1
                                and se.purpose='Send to Subcontractor'
                                and ifnull(se.purchase_order, '') !=''
                                and (sed.item_code = %(item)s or sed.original_item = %(item)s)
                                and se.name = sed.parent
                                and se.purchase_order = po.name
                                and po.docstatus = 1
                                and po.is_subcontracted = 'Yes'
                                and po.status != 'Closed'
                                and po.per_received < 100
                """,














                  ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/bin/test_bin.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/bin/test_bin.py", line 34
    self.fail(f"Expected unique index on item-warehouse")
                                                       ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py", line 574
    msg = f"Please delete linked Website Item {frappe.bold(web_item_link)} before merging {old_name} into {new_name}"
                                                                                                                    ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/test_item.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/test_item.py", line 644
    self.fail(f"UoM change not allowed even though no SLE / BIN with positive qty exists: {e}")
                                                                                             ^


Do you know if this is related to Tasks error?

SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py", line 71
    f"Row {d.idx}: {d.receipt_document_type} {frappe.bold(d.receipt_document)} must be submitted"
                                                                                                ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.p                                                                                                             y'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py", line 117
    expected_values[gle.account][0], gle.debit, msg=f"incorrect debit for {gle.account}"
                                                                                       ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/pick_list/test_pick_list.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/pick_list/test_pick_list.py", line 419
    self.assertEqual(b.get(key), value, msg=f"{key} doesn't match")
                                                                 ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuati                                                                                                             on.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py", line                                                                                                              57
    msg=f"Exepcted true from : {case}",
                                     ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/serial_no/test_serial_no.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/serial_no/test_serial_no.py", line 307
    msg=f"{partial_fetch} should be subset of {first_fetch}",
                                                           ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry_utils.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry_utils.py", line 34
    ) -> "StockEntry":
    ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py'                                                                                                             ...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py", line 68
    self.assertEqual(v, act_value, msg=f"{k} doesn't match \n{exp_sle}\n{act_sle}")
                                                                                 ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py'.                                                                                                             ..
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py", line 622
    f"""
                select
                        i.name as item_code, i.item_name, bin.warehouse as warehouse, i.has_serial_no, i.has_batch_no
                from
                        tabBin bin, tabItem i
                where
                        i.name = bin.item_code
                        and IFNULL(i.disabled, 0) = 0
                        and i.is_stock_item = 1
                        and i.has_variants = 0
                        and exists(
                                select name from `tabWarehouse` where lft >= {lft} and rgt <= {rgt} and name = bin.warehouse
                        )
        """,













          ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/warehouse/test_warehouse.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/warehouse/test_warehouse.py", line 54
    warehouse_names = [f"_Test Warehouse {i} for Unlinking" for i in range(2)]
                                                          ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_rec                                                                                                             ommended_reorder_level.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reor                                                                                                             der_level.py", line 102
    ", ".join(f"'{p}'" for p in purpose_to_exclude)
                     ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/report/stock_ageing/stock_ageing.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/report/stock_ageing/stock_ageing.py", line 195
    f"0 - {filters['range1']}",
                             ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/report/test_reports.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/report/test_reports.py", line 13
    REPORT_FILTER_TEST_CASES: List[Tuple[ReportName, ReportFilters]] = [
                            ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/stock_ledger.py", line 143
    vouchers.append(f"{voucher_type} {voucher_no}")
                                                 ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/tests/test_utils.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/tests/test_utils.py", line 36
    self.assertEqual(v, act_value, msg=f"{k} doesn't match \n{exp_sle}\n{act_sle}")
                                                                                 ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/telephony/doctype/call_log/call_log.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/telephony/doctype/call_log/call_log.py", line 87
    text=f"""
                                        Scheduled Employees: {scheduled_employees}
                                        Matching Employee: {employee_emails}
                                        Show Popup To: {emails}
                                """




                                  ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/templates/pages/product_search.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/templates/pages/product_search.py", line 103
    query_string += f"|('{clean_up_query(s.string)}')"
                                                     ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/tests/test_exotel.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/tests/test_exotel.py", line 59
    f"/api/method/erpnext.erpnext_integrations.exotel_integration.{api_method}",
                                                                              ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/erpnext/erpnext/www/shop-by-category/index.py'...
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/www/shop-by-category/index.py", line 28
    values[f"slide_{index}_image"] = slide.image
                                ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/.github/helper/roulette.py'...
  File "/home/frappe/frappe-bench/apps/frappe/.github/helper/roulette.py", line 11
    api_url = f"https://api.github.com/repos/{repo}/pulls/{pr_number}"
                                                                     ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/.github/helper/translation.py'...
  File "/home/frappe/frappe-bench/apps/frappe/.github/helper/translation.py", line 17
    print(f'Checking: {_file}')
                             ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 175
    db: typing.Union[MariaDBDatabase, PostgresDatabase]
      ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/build.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/build.py", line 82
    url = f"https://github.com/frappe/frappe/releases/download/{tag}/assets.tar.gz"
                                                                                  ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 37
    click.secho(f"Site {site} does not exist!", fg="yellow")
                                             ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/commands/scheduler.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/scheduler.py", line 43
    click.secho(f"Event {event} does not exist!", fg="red")
                                               ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 326
    site_title = click.style(f"{site}", fg="green") if len(context.sites) > 1 else ""
                                     ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py", line 147
    prefix = f"{prefix}." if prefix else ""
                        ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/communication.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/communication.py", line 173
    self.content = f'{self.content}</p><br><p class="signature">{signature}'
                                                                           ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py", line 54
    **kwargs,
            ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/importer.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/importer.py", line 1067
    f"{label} ({df.fieldname})",
                              ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/test_file.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/test_file.py", line 419
    test_file: File = frappe.get_doc(
             ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/page/page.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/page/page.py", line 129
    self.script += f"\n\n//# sourceURL={page_name}.js"
                                                     ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/scheduled_job_type/scheduled_job_type.py", line 94
    frappe.logger("scheduler").info(f"Scheduled Job {status}: {self.method} for {frappe.local.site}")
                                                                                                   ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/server_script/server_script.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/server_script/server_script.py", line 138
    fullkey = f"{key}.{subkey}"
                              ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/server_script/test_server_script.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/server_script/test_server_script.py", line 168
    script=f"""
frappe.db.set_value("ToDo", "{todo.name}", "description", "safe")
""",


  ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/test_user.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/test_user.py", line 279
    key = f"rl:{data['cmd']}:{data['user']}"
                                           ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/client_script/client_script.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/client_script/client_script.py", line 12
    self.name = f"{self.dt}-{self.view}"
                                       ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 52
    MAX_WRITES_PER_TRANSACTION = 200_000
                                       ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 138
    return self.sql(f"RENAME TABLE `{old_name}` TO `{new_name}`")
                                                               ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/database/postgres/database.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/postgres/database.py", line 203
    return self.sql(f"ALTER TABLE `{old_name}` RENAME TO `{new_name}`")
                                                                     ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/database/postgres/setup_db.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/postgres/setup_db.py", line 57
    f"psql {frappe.conf.db_name} "
                                 ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/meta.py", line 139
    comment = f"\n\n/* Adding {path} */\n\n"
                                           ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/desk/query_report.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/query_report.py", line 196
    script += f"\n\n//# sourceURL={scrub(report.name)}.js"
                                                         ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/desk/reportview.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/reportview.py", line 61
    args.fields = [f"count({distinct}`tab{args.doctype}`.name) as total_count"]
                                                                             ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/desk/search.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/search.py", line 237
    if re.search(f"{re.escape(txt)}.*", _(v.name if as_dict else v[0]), re.IGNORECASE)
                                     ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/newsletter/newsletter.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/newsletter/newsletter.py", line 23
    self.route = f"newsletters/{self.name}"
                                          ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/newsletter/test_newsletter.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/newsletter/test_newsletter.py", line 39
    return f"{module}.{klass.__qualname__}"
                                          ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py", line 335
    unsubscribe_link = f'<a href="<!--unsubscribe_url-->" target="_blank">{unsubscribe_message}</a>'
                                                                                                   ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/event_streaming/doctype/event_consumer/event_consumer.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/event_streaming/doctype/event_consumer/event_consumer.py", line 210
    condition: str = dt_entry.condition
             ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/installer.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 241
    click.secho(f"App {app_name} not installed on Site {site}", fg="yellow")
                                                             ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/ldap_settings/ldap_settings.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/ldap_settings/ldap_settings.py", line 172
    user: "User" = None
        ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/ldap_settings/test_ldap_settings.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/integrations/doctype/ldap_settings/test_ldap_settings.py", line 96
    cls.ldap_user_path = f"ou=users,{cls.ldap_dc_path}"
                                                      ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/integrations/oauth2.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/integrations/oauth2.py", line 184
    "authorization_endpoint": f"{frappe_server_url}/api/method/frappe.integrations.oauth2.authorize",
                                                                                                   ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 514
    f"""
                        SHOW
                                INDEX
                        FROM
                                `tab{self.doctype}`
                        WHERE
                                key_name=%s
                        AND
                                Non_unique=0
                        """,









                          ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py", line 351
    if any(f"({keyword}" in field.lower() for keyword in blacklisted_keywords):
                       ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1532
    docstatus = f" docstatus={self.docstatus}" if self.docstatus else ""
                                             ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/model/rename_doc.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/rename_doc.py", line 576
    frappe.db.sql(f"update `tab{doctype}` set parenttype=%s where parenttype=%s", (new, old))
                                                                               ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/modules/export_file.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/export_file.py", line 50
    with open(os.path.join(folder, f"{fname}.json"), "w+") as txtfile:
                                                 ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/oauth.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/oauth.py", line 619
    request_url = f"{request_url.scheme}://{request_url.netloc}"
                                                               ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/parallel_test_runner.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/parallel_test_runner.py", line 46
    test_module = frappe.get_module(f"{self.app}.tests")
                                                      ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/patches/v13_0/queryreport_columns.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/patches/v13_0/queryreport_columns.py", line 19
    jstr = f'{{"columns":{jstr}}}'
                                 ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/printing/doctype/letter_head/letter_head.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/printing/doctype/letter_head/letter_head.py", line 67
    dimension_value = self.get(f"{dimension_prefix}{dimension}")
                                                              ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/query_builder/custom.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/query_builder/custom.py", line 47
    return f"{s} AGAINST ({frappe.db.escape(f'+{self._Against}*')} IN BOOLEAN MODE)"
                                                                                   ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/query_builder/terms.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/query_builder/terms.py", line 25
    param_key = f"%(param{len(self.parameters) + 1})s"
                                                     ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/rate_limiter.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/rate_limiter.py", line 44
    self.key = frappe.cache().make_key(f"rate-limit-counter-{self.window_number}")
                                                                                ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_api.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_api.py", line 33
    RESOURCE_URL = f"{SITE_URL}/api/resource"
                                            ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_commands.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_commands.py", line 264
    site_data = {"another_site": f"{frappe.local.site}-restore.test", **global_config}
                                                                   ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_db.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_db.py", line 83
    "fieldname": f"test_{fieldtype.lower()}",
                                           ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_document.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_document.py", line 318
    url = f"/ToDo/{todo.name}?key={old_document_key}"
                                                    ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_naming.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_naming.py", line 133
    self.assertEqual(doc.name, f"TestAutoname-{field}-{series:02}")
                                                                 ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_query_builder.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_query_builder.py", line 12
    return unittest.skipIf(db_type_is(frappe.conf.db_type) != dbtype, f"Only runs for {dbtype.value}")
                                                                                                    ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_rename_doc.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_rename_doc.py", line 63
    frappe.db.sql_ddl(f"DROP TABLE IF EXISTS `tab{dt}`")
                                                      ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_translate.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_translate.py", line 49
    msg=f"Mismatched output:\nExpected: {expected_output}\nFound: {data}",
                                                                        ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_utils.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/tests/test_utils.py", line 327
    self.fail(f"Invalid error thrown for valid expression: {expr}: {str(e)}")
                                                                           ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/translate.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/translate.py", line 36
    click.secho(f"{guess_language.__doc__}\n{get_language.__doc__}", fg="yellow")
                                                                  ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/utils/__init__.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/__init__.py", line 967
    return f"tab{table_name}" if not table_name.startswith("__") else table_name
                            ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/utils/backups.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/backups.py", line 209
    for_conf = f"{self.todays_date}-{self.site_slug}-site_config_backup.json"
                                                                            ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/utils/change_log.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/change_log.py", line 265
    r = requests.get(f"https://api.github.com/repos/{owner}/{repo}/releases")
                                                                           ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/utils/commands.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/commands.py", line 12
    f"https://api.github.com/users/{org}/repos", {"type": "sources", "per_page": 200}
                                              ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py", line 1956
    msg += f"<br><pre>{error_line}</pre>"
                                        ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/utils/jinja.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/jinja.py", line 252
    path = f"/assets/css-rtl/{file_name}"
                                        ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/utils/lazy_loader.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/lazy_loader.py", line 28
    raise ImportError(f"Module {name} Not found.")
                                                ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/utils/logger.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/logger.py", line 20
    module=None, with_more_info=False, allow_site=True, filter=None, max_size=100_000, file_count=20
                                                                                    ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/utils/response.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/response.py", line 96
    f'{frappe.response.get("display_content_as","attachment")}; filename="{frappe.response["filename"].replace(" ", "_")}"'
                                                                                                                          ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/utils/safe_exec.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/safe_exec.py", line 36
    raise AttributeError(f"module has no attribute '{key}'")
                                                          ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/website/doctype/personal_data_deletion_request/personal_data_d                                                                                                             eletion_request.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/doctype/personal_data_deletion_request/personal_data_deletion_reque                                                                                                             st.py", line 45
    site = domain if pattern.match(domain) else f"{domain}.com"
                                                              ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/website/doctype/website_settings/website_settings.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/doctype/website_settings/website_settings.py", line 142
    settings: "WebsiteSettings" = frappe.get_single("Website Settings")
            ^
SyntaxError: invalid syntax

*** Error compiling '/home/frappe/frappe-bench/apps/frappe/frappe/workflow/doctype/workflow_action/workflow_action.py'...
  File "/home/frappe/frappe-bench/apps/frappe/frappe/workflow/doctype/workflow_action/workflow_action.py", line 351
    subject = _("Workflow Action") + f" on {doctype}: {docname}"
                                                               ^
SyntaxError: invalid syntax

Also I just tried to login with an user who is not admin and that user can login, but the admin user cannot. I think it should be something that can be fixed

What is your python version ? Do you have any customization ?

These are all python compiling error… really strange !

I would suggest you take a backup in case you need do a reinstall later.

What is error you are getting when login using admin ?

Thank you for all your help centaur,
my python version is 2.7.12

Yes I made a snapshot from the server when the error first appeared, so I can restored it to this point anytime.

I just remembered I have another user which is also admin, I tried to log in and everything looks like it is working normal, however the user I normally use as system admin cannot login, and the error is the same one,

Ok now I understand… this not the standard task doctype… this is the custom doctype “Production tasks” you had created

Ok first try to clear the browser cache including the cookies. Try login using the system administrator. Since you are able to login by other users… this should solve it.

Yes, it is a custom doctype, first thing I did was to clear the cookies but that didn’t solve the issue, I have also tried with another browser and device, but the same error keeps poping up.

maybe somehow the admin user got linked stucked with the custom doctype which no longer exists?

I will try creating a new one with the same name to see if that solves the issue.

Yes the next step is to create a dummy doctype with the same name you have used before using the other admin user