Skip to content

Error in patches #89

@aasif-patel

Description

@aasif-patel

Information about bug

patches are getting failed while updating the server

`Migrating postgres-project-site.8848digitalerp.com
Updating DocTypes for frappe : [========================================] 100%
Updating DocTypes for erpnext : [========================================] 100%
Updating DocTypes for assets : [========================================] 100%
Updating DocTypes for erpnext_crm : [========================================] 100%
Updating DocTypes for projects : [========================================] 100%
Updating DocTypes for sales_commission: [========================================] 100%
Updating DocTypes for payments : [========================================] 100%
Updating DocTypes for india_compliance: [========================================] 100%
Executing india_compliance.patches.v14.set_pending_boe_qty #1 in postgres-project-site.8848digitalerp.com (_037066e14dd8c71e)
'Syntax error in query:\nUPDATE "tabPurchase Invoice Item" JOIN "tabPurchase Invoice" ON "tabPurchase Invoice Item"."parent"="tabPurchase Invoice"."name" LEFT JOIN (SELECT "pi_detail",SUM("qty") "qty" FROM "tabBill of Entry Item" WHERE "docstatus"= '1' GROUP BY "pi_detail") "sq0" ON "tabPurchase Invoice Item"."name"="sq0"."pi_detail" SET "pending_boe_qty"="tabPurchase Invoice Item"."qty"-coalesce("sq0"."qty",0) WHERE "tabPurchase Invoice"."docstatus"= '1' AND "tabPurchase Invoice"."gst_category"=%(param1)s {'param1': 'Overseas'}'
Queued rebuilding of search index for postgres-project-site.8848digitalerp.com

Traceback (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,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 114, in
main()
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
click.Group(commands=commands)(prog_name="bench")
File "/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1161, in call
return self.main(*args, **kwargs)
File "/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
File "/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/init.py", line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/site.py", line 681, in migrate
SiteMigration(
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/migrate.py", line 188, in run
self.run_schema_updates()
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/migrate.py", line 52, in wrapper
raise e
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/migrate.py", line 44, in wrapper
ret = method(*args, **kwargs)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/migrate.py", line 121, in run_schema_updates
frappe.modules.patch_handler.run_all(
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 76, in run_all
run_patch(patch)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 62, in run_patch
if not run_single(patchmodule=patch):
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 152, in run_single
return execute_patch(patchmodule, method, methodargs)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 188, in execute_patch
_patch()
File "/home/ubuntu/frappe-bench/apps/india_compliance/india_compliance/patches/v14/set_pending_boe_qty.py", line 29, in execute
.run()
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/query_builder/utils.py", line 87, in execute_query
result = frappe.db.sql(query, params, *args, **kwargs) # nosemgrep
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/database/postgres/database.py", line 326, in sql
return super().sql(modify_query(query), modify_values(values), *args, **kwargs)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/database/database.py", line 236, in sql
self._cursor.execute(query, values)
psycopg2.errors.SyntaxError: syntax error at or near "JOIN"
LINE 1: UPDATE "tabPurchase Invoice Item" JOIN "tabPurchase Invoice"...`

Version

frappe 15.67.0 pre-prod-develop
erpnext 15.60.0 pre-prod-develop
assets 0.0.1 pre-prod-develop
erpnext_crm 0.0.1 pre-prod-develop
projects 0.0.1 pre-prod-develop
sales_commission 0.0.1 pre-prod-develop
payments 0.0.1 version-15
india_compliance 15.18.0 pre-prod-develop

Relevant log output / Stack trace / Full Error Message.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Ref PR:

#86

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions