when i am installing helpdesk in site shows PostgreSQL is trying to compare a smallint
(small integer) with a boolean value, which is not a valid operation in PostgreSQL.
bench --site ezapp.localhost install-app helpdesk
Installing helpdesk…
Updating DocTypes for helpdesk : [========================================] 100%
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 “/opt/ezapp/apps/frappe/frappe/utils/bench_helper.py”, line 114, in
main()
File “/opt/ezapp/apps/frappe/frappe/utils/bench_helper.py”, line 20, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/opt/ezapp/env/lib/python3.10/site-packages/click/core.py”, line 1157, in call
return self.main(*args, **kwargs)
File “/opt/ezapp/env/lib/python3.10/site-packages/click/core.py”, line 1078, in main
rv = self.invoke(ctx)
File “/opt/ezapp/env/lib/python3.10/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/ezapp/env/lib/python3.10/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/ezapp/env/lib/python3.10/site-packages/click/core.py”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/ezapp/env/lib/python3.10/site-packages/click/core.py”, line 783, in invoke
return __callback(*args, **kwargs)
File “/opt/ezapp/env/lib/python3.10/site-packages/click/decorators.py”, line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File “/opt/ezapp/apps/frappe/frappe/commands/init.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/opt/ezapp/apps/frappe/frappe/commands/site.py”, line 445, in install_app
_install_app(app, verbose=context.verbose, force=force)
File “/opt/ezapp/apps/frappe/frappe/installer.py”, line 311, in install_app
frappe.get_attr(after_install)()
File “/opt/ezapp/apps/helpdesk/helpdesk/setup/install.py”, line 29, in after_install
create_welcome_ticket()
File “/opt/ezapp/apps/helpdesk/helpdesk/setup/welcome_ticket.py”, line 27, in create_welcome_ticket
create_ticket()
File “/opt/ezapp/apps/helpdesk/helpdesk/setup/welcome_ticket.py”, line 40, in create_ticket
d.insert()
File “/opt/ezapp/apps/frappe/frappe/model/document.py”, line 291, in insert
self.run_before_save_methods()
File “/opt/ezapp/apps/frappe/frappe/model/document.py”, line 1085, in run_before_save_methods
self.run_method(“before_validate”)
File “/opt/ezapp/apps/frappe/frappe/model/document.py”, line 962, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/opt/ezapp/apps/frappe/frappe/model/document.py”, line 1322, in composer
return composed(self, method, *args, **kwargs)
File “/opt/ezapp/apps/frappe/frappe/model/document.py”, line 1304, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/opt/ezapp/apps/frappe/frappe/model/document.py”, line 959, in fn
return method_object(*args, **kwargs)
File “/opt/ezapp/apps/helpdesk/helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py”, line 170, in before_validate
self.set_sla()
File “/opt/ezapp/apps/helpdesk/helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py”, line 705, in set_sla
if sla := get_sla(self):
File “/opt/ezapp/apps/helpdesk/helpdesk/helpdesk/doctype/hd_service_level_agreement/utils.py”, line 38, in get_sla
sla_list = q.run(as_dict=True)
File “/opt/ezapp/apps/frappe/frappe/query_builder/utils.py”, line 87, in execute_query
result = frappe.db.sql(query, params, *args, **kwargs) # nosemgrep
File “/opt/ezapp/apps/frappe/frappe/database/postgres/database.py”, line 218, in sql
return super().sql(modify_query(query), modify_values(values), *args, **kwargs)
File “/opt/ezapp/apps/frappe/frappe/database/database.py”, line 256, in sql
traceback.print_stack()
‘Error in query:\noperator does not exist: smallint = boolean\nLINE 1: …e" WHERE “tabHD Service Level Agreement”.“enabled”=true AND …\n ^\nHINT: No operator matches the given name and argument types. You might need to add explicit type casts.\n’
An error occurred while installing helpdesk: operator does not exist: smallint = boolean
LINE 1: …e" WHERE “tabHD Service Level Agreement”.“enabled”=true AND …
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
Traceback with variables (most recent call last):
File “apps/frappe/frappe/commands/site.py”, line 445, in install_app
_install_app(app, verbose=context.verbose, force=force)
context = {‘sites’: [‘ezapp.localhost’], ‘force’: False, ‘verbose’: False, ‘profile’: False}
apps = (‘helpdesk’,)
force = False
_install_app = <function install_app at 0x7eceb8f78c10>
filelock = <function filelock at 0x7eceb8f788b0>
exit_code = 0
site = ‘ezapp.localhost’
app = ‘helpdesk’
err = UndefinedFunction(‘operator does not exist: smallint = boolean\nLINE 1: …e" WHERE “tabHD Service Level Agreement”.“enabled”=true AND …\n ^\nHINT: No operator matches the given name and argument types. You might need to add explicit type casts.\n’)
File “apps/frappe/frappe/installer.py”, line 311, in install_app
frappe.get_attr(after_install)()
name = ‘helpdesk’
verbose = False
set_as_patched = True
force = False
sync_jobs = <function sync_jobs at 0x7eceb70755a0>
sync_for = <function sync_for at 0x7eceb7075f30>
sync_customizations = <function sync_customizations at 0x7eceb90f35b0>
sync_fixtures = <function sync_fixtures at 0x7eceb70760e0>
app_hooks = {‘after_install’: [‘helpdesk.setup.install.after_install’], ‘app_color’: [‘grey’], ‘app_description’: [‘Customer Service Software’], ‘app_email’: [‘hello@frappe.io’], ‘app_icon’: [‘octicon octicon-file-directory’], ‘app_license’: [‘AGPLv3’], ‘app_name’: [‘helpdesk’], ‘app_publisher’: [‘Frappe Technologies’], ‘app_title’: [‘Helpdesk’], ‘before_install’: [‘helpdesk.setup.install.before_install’], ‘doc_events’: {‘Contact’: {‘before_insert’: [‘helpdesk.helpdesk.hooks.contact.before_insert’]}, ‘Assignment Rule’: {‘on_trash’: [‘helpdesk.overrides.on_assignment_rule_trash’]}}, ‘has_permission’: {‘HD Ticket’: [‘helpdesk.helpdesk.doctype.hd_ticket.hd_ticket.has_permission’]}, ‘website_route_rules’: [{‘from_route’: ‘/helpdesk/path:app_path’, ‘to_route’: ‘helpdesk’}]}
installed_apps = [‘frappe’, ‘erpnext’, ‘ezapp’]
before_install = ‘helpdesk.setup.install.before_install’
out = None
after_install = ‘helpdesk.setup.install.after_install’
File “apps/helpdesk/helpdesk/setup/install.py”, line 29, in after_install
create_welcome_ticket()
File “apps/helpdesk/helpdesk/setup/welcome_ticket.py”, line 27, in create_welcome_ticket
create_ticket()
File “apps/helpdesk/helpdesk/setup/welcome_ticket.py”, line 40, in create_ticket
d.insert()
d = <HDTicket: 6>
File “apps/frappe/frappe/model/document.py”, line 291, in insert
self.run_before_save_methods()
self = <HDTicket: 6>
ignore_permissions = None
ignore_links = None
ignore_if_duplicate = False
ignore_mandatory = None
set_name = None
set_child_names = True
File “apps/frappe/frappe/model/document.py”, line 1085, in run_before_save_methods
self.run_method(“before_validate”)
self = <HDTicket: 6>
File “apps/frappe/frappe/model/document.py”, line 962, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
self = <HDTicket: 6>
args = ()
kwargs = {}
fn = <function Document.run_method..fn at 0x7eceb3fdc8b0>
method = ‘before_validate’
File “apps/frappe/frappe/model/document.py”, line 1322, in composer
return composed(self, method, args, **kwargs)
self = <HDTicket: 6>
args = ()
kwargs = {}
hooks = []
method = ‘before_validate’
doc_events = {'': {‘on_update’: [‘frappe.desk.notifications.clear_doctype_notifications’, ‘frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions’, ‘frappe.core.doctype.file.utils.attach_files_to_document’, ‘frappe.automation.doctype.assignment_rule.assignment_rule.apply’, ‘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.automation.doctype.assignment_rule.assignment_rule.apply’], ‘on_trash’: [‘frappe.desk.notifications.clear_doctype_notifications’, ‘frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions’], ‘on_update_after_submit’: ['frappe.workflow.doctype.workflow_action.workflow_action.process_w…
composed = <function Document.hook..compose..runner at 0x7eceb11a0430>
compose = <function Document.hook..compose at 0x7eceb11a00d0>
f = <function Document.run_method..fn at 0x7eceb3fdc8b0>
File “apps/frappe/frappe/model/document.py”, line 1304, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
self = <HDTicket: 6>
method = ‘before_validate’
args = ()
kwargs = {}
add_to_return_value = <function Document.hook..add_to_return_value at 0x7eceb3fdf400>
fn = <function Document.run_method..fn at 0x7eceb3fdc8b0>
hooks = ()
File “apps/frappe/frappe/model/document.py”, line 959, in fn
return method_object(*args, **kwargs)
self = <HDTicket: 6>
args = ()
kwargs = {}
method_object = <bound method HDTicket.before_validate of <HDTicket: 6>>
method = ‘before_validate’
File “apps/helpdesk/helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py”, line 170, in before_validate
self.set_sla()
self = <HDTicket: 6>
File “apps/helpdesk/helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py”, line 705, in set_sla
if sla := get_sla(self):
self = <HDTicket: 6>
File “apps/helpdesk/helpdesk/helpdesk/doctype/hd_service_level_agreement/utils.py”, line 38, in get_sla
sla_list = q.run(as_dict=True)
ticket = <HDTicket: 6>
QBSla = Table(‘tabHD Service Level Agreement’)
QBPriority = Table(‘tabHD Service Level Priority’)
now = datetime.datetime(2024, 9, 13, 16, 17, 45, 269250)
priority = ‘Medium’
q = SELECT “tabHD Service Level Agreement”.“name”,“tabHD Service Level Agreement”.“condition” FROM “tabHD Service Level Agreement” JOIN “tabHD Service Level Priority” ON “tabHD Service Level Priority”.“parent”=“tabHD Service Level Agreement”.“name” WHERE “tabHD Service Level Agreement”.“enabled”=true AND “tabHD Service Level Agreement”.“default_sla”=false AND (“tabHD Service Level Agreement”.“start_date” IS NULL OR “tabHD Service Level Agreement”.“start_date”<=‘2024-09-13T16:17:45.269250’) AND (“tabHD Service Level Agreement”.“end_date” IS NULL OR “tabHD Service Level Agreement”.“end_date”>=‘2024-09-13T16:17:45.269250’) AND “tabHD Service Level Priority”.“priority”=‘Medium’
File “apps/frappe/frappe/query_builder/utils.py”, line 87, in execute_query
result = frappe.db.sql(query, params, *args, **kwargs) # nosemgrep
query = ‘SELECT “tabHD Service Level Agreement”.“name”,“tabHD Service Level Agreement”.“condition” FROM “tabHD Service Level Agreement” JOIN “tabHD Service Level Priority” ON “tabHD Service Level Priority”.“parent”=“tabHD Service Level Agreement”.“name” WHERE “tabHD Service Level Agreement”.“enabled”=true AND “tabHD Service Level Agreement”.“default_sla”=false AND (“tabHD Service Level Agreement”.“start_date” IS NULL OR “tabHD Service Level Agreement”.“start_date”<='2024-09-13T16:17:45.269250') AND (“tabHD Service Level Agreement”.“end_date” IS NULL OR “tabHD Service Level Agreement”.“end_date”>='2024-09-13T16:17:45.269250') AND “tabHD Service Level Priority”.“priority”=%(param1)s’
args = ()
kwargs = {‘as_dict’: True}
child_queries =
params = {‘param1’: ‘Medium’}
execute_child_queries = <function patch_query_execute..execute_child_queries at 0x7eceb7d8f370>
prepare_query = <function patch_query_execute..prepare_query at 0x7eceb7d8f400>
File “apps/frappe/frappe/database/postgres/database.py”, line 218, in sql
return super().sql(modify_query(query), modify_values(values), *args, **kwargs)
self = <frappe.database.postgres.database.PostgresDatabase object at 0x7eceb7d7a110>
query = ‘SELECT “tabHD Service Level Agreement”.“name”,“tabHD Service Level Agreement”.“condition” FROM “tabHD Service Level Agreement” JOIN “tabHD Service Level Priority” ON “tabHD Service Level Priority”.“parent”=“tabHD Service Level Agreement”.“name” WHERE “tabHD Service Level Agreement”.“enabled”=true AND “tabHD Service Level Agreement”.“default_sla”=false AND (“tabHD Service Level Agreement”.“start_date” IS NULL OR “tabHD Service Level Agreement”.“start_date”<='2024-09-13T16:17:45.269250') AND (“tabHD Service Level Agreement”.“end_date” IS NULL OR “tabHD Service Level Agreement”.“end_date”>='2024-09-13T16:17:45.269250') AND “tabHD Service Level Priority”.“priority”=%(param1)s’
values = {‘param1’: ‘Medium’}
args = ()
kwargs = {‘as_dict’: True}
class = <class ‘frappe.database.postgres.database.PostgresDatabase’>
File “apps/frappe/frappe/database/database.py”, line 234, in sql
self._cursor.execute(query, values)
self = <frappe.database.postgres.database.PostgresDatabase object at 0x7eceb7d7a110>
query = ‘SELECT “tabHD Service Level Agreement”.“name”,“tabHD Service Level Agreement”.“condition” FROM “tabHD Service Level Agreement” JOIN “tabHD Service Level Priority” ON “tabHD Service Level Priority”.“parent”=“tabHD Service Level Agreement”.“name” WHERE “tabHD Service Level Agreement”.“enabled”=true AND “tabHD Service Level Agreement”.“default_sla”=false AND (“tabHD Service Level Agreement”.“start_date” IS NULL OR “tabHD Service Level Agreement”.“start_date”<='2024-09-13T16:17:45.269250') AND (“tabHD Service Level Agreement”.“end_date” IS NULL OR “tabHD Service Level Agreement”.“end_date”>='2024-09-13T16:17:45.269250') AND “tabHD Service Level Priority”.“priority”=%(param1)s’
values = {‘param1’: ‘Medium’}
as_dict = True
as_list = 0
debug = False
ignore_ddl = 0
auto_commit = 0
update = None
explain = False
run = True
pluck = False
as_iterator = False
trace_id = None
psycopg2.errors.UndefinedFunction: operator does not exist: smallint = boolean
LINE 1: …e" WHERE “tabHD Service Level Agreement”.“enabled”=true AND …
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.