Error in invoives when I open the sales invoices module

hi
am facing the error since saturday whereby whenever I open the sales invoice it throws an error below

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 942, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/notifications.py”, line 267, in get_open_count
filters={fieldname: name}, limit=100, distinct=True, ignore_ifnull=True))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1180, in get_all
return get_list(doctype, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1153, in get_list
return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 87, in execute
result = self.build_and_run()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 111, in build_and_run
return frappe.db.sql(query, as_dict=not self.as_list, debug=self.debug, update=self.update)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 205, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 165, in execute
result = self._query(query)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 321, in _query
conn.query(q)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 860, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1061, in _read_query_result
result.read()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1349, in read
first_packet = self.connection._read_packet()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1018, in _read_packet
packet.check_error()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 384, in check_error
err.raise_mysql_exception(self._data)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/err.py”, line 107, in raise_mysql_exception
raise errorclass(errno, errval)
InternalError: (1054, u"Unknown column ‘tabSubscription.sales_invoice’ in ‘where clause’")

I tried to update the bench yesterday but the error still exists. another thing is cant be able to use an offline pos as per the last update and the online pos does not show the quantities at warehouse…

kindly ant one help here.
thank you.

What branch are you on?

And I guess you’ve already tried bench migrate but the error persists.

am on master branch production

The problem is that there is a query uses a sales_invoice field or column in the Subscription doctype and that column no longer exists, I suggest you to make a custom field in the Subscription doctype with sales_invoice name to be existed in the database to allow that query works properly and then get rid of this error.

hope this helps

hi
this is what am getting aftet bench migrate command…

Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/core/report/transaction_log_report/init.pyc.140215063473008’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/core/report/transaction_log_report/transaction_log_report.pyc.140215064420400’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/desk/doctype/auto_repeat/init.pyc.140215064543808’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/desk/doctype/auto_repeat/auto_repeat.pyc.140215063430416’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/desk/doctype/auto_repeat/test_auto_repeat.pyc.140215063430656’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/email/doctype/email_template/init.pyc.140215063490704’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/email/doctype/email_template/email_template.pyc.140215063431856’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/email/doctype/email_template/test_email_template.pyc.140215063490704’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/integrations/data_migration_mapping/init.pyc.140215064896448’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/integrations/data_migration_mapping/event_to_gcalendar/init.pyc.140215065192368’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/integrations/data_migration_mapping/gcalendar_to_event/init.pyc.140215065192368’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/integrations/doctype/gcalendar_account/init.pyc.140215063468864’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/integrations/doctype/gcalendar_account/gcalendar_account.pyc.140215063490704’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/integrations/doctype/gcalendar_account/test_gcalendar_account.pyc.140215064543904’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/integrations/doctype/gcalendar_settings/init.pyc.140215063468864’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/integrations/doctype/gcalendar_settings/gcalendar_settings.pyc.140215063468336’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/integrations/doctype/gcalendar_settings/test_gcalendar_settings.pyc.140215063466512’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/patches/v11_0/init.pyc.140215063259632’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/patches/v11_0/drop_column_apply_user_permissions.pyc.140215063259632’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/patches/v11_0/rename_standard_reply_to_email_template.pyc.140215063259632’
Sorry [Errno 13] Permission denied: ‘…/apps/frappe/frappe/patches/v11_0/sync_user_permission_doctype_before_migrate.pyc.140215063259632’
root@vultr:/home/frappe/frappe-bench#

how do i solve that now

i solved above by sudo chown -R frappe:frappe *
but the error log keeps cooming up

Its another issue now, I think you should open another discussion thread for that

A fix for the issue has been sent -
https://github.com/frappe/erpnext/pull/13956

1 Like

still not working

The PR is still open and not merged yet. As soon as its merged, you can pull it to get the fix :+1:

:+1: thanks

that solved my problem… thank you @Zlash65