Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while installing - "Could not find DocType: Bill of Entry" #1911

Closed
1 task done
chavan0 opened this issue Mar 21, 2024 · 3 comments
Closed
1 task done

Error while installing - "Could not find DocType: Bill of Entry" #1911

chavan0 opened this issue Mar 21, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@chavan0
Copy link

chavan0 commented Mar 21, 2024

Information about bug

bench get-app --branch version-15 https://github.com/resilient-tech/india-compliance.git

Got the following error-
An error occurred while installing india_compliance: Could not find DocType: Bill of Entry

And when accessed through on the website, the following error is shown because of your installation of version -
image

Traceback (most recent call last):
File "apps/frappe/frappe/modules/utils.py", line 237, in load_doctype_module
doctype_python_modules[key] = frappe.get_module(module_name)
File "apps/frappe/frappe/init.py", line 1429, in get_module
return importlib.import_module(modulename)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 992, in _find_and_load_unlocked
File "", line 241, in _call_with_frames_removed
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'frappe.core.doctype.gst_settings'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "apps/frappe/frappe/www/app.py", line 27, in get_context
boot = frappe.sessions.get()
File "apps/frappe/frappe/sessions.py", line 137, in get
bootinfo = get_bootinfo()
File "apps/frappe/frappe/boot.py", line 86, in get_bootinfo
frappe.get_attr(method)(bootinfo)
File "apps/india_compliance/india_compliance/boot.py", line 18, in set_bootinfo
gst_settings = frappe.get_cached_doc("GST Settings").as_dict()
File "apps/frappe/frappe/init.py", line 1160, in get_cached_doc
doc = get_doc(*args, **kwargs)
File "apps/frappe/frappe/init.py", line 1286, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 83, in get_doc
controller = get_controller(doctype)
File "apps/frappe/frappe/model/base_document.py", line 70, in get_controller
site_controllers[doctype] = import_controller(doctype)
File "apps/frappe/frappe/model/base_document.py", line 95, in import_controller
module = load_doctype_module(doctype, module_name)
File "apps/frappe/frappe/modules/utils.py", line 241, in load_doctype_module
raise ImportError(msg) from e
ImportError: Module import failed for GST Settings, the DocType you're trying to open might be deleted.
Error: No module named 'frappe.core.doctype.gst_settings'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "apps/frappe/frappe/website/serve.py", line 20, in get_response
response = renderer_instance.render()
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
html = self.get_html()
File "apps/frappe/frappe/website/utils.py", line 523, in cache_html_decorator
html = func(*args, **kwargs)
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 95, in get_html
self.update_context()
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 163, in update_context
data = self.run_pymodule_method("get_context")
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 223, in run_pymodule_method
return method(self.context)
File "apps/frappe/frappe/www/app.py", line 29, in get_context
raise frappe.SessionBootFailed from e
frappe.exceptions.SessionBootFailed

Version

ERPNext: v15.17.4 (version-15)

Frappe Framework: v15.18.0 (version-15)

India Compliance: v15.6.0 (version-15)

Relevant log output / Stack trace / Full Error Message.

App erpnext already installed

Installing india_compliance...
Installation for India Compliance failed due to an error. Please try re-installing the app or report the issue on https://github.com/resilient-tech/india-compliance/issues/new if not resolved.
An error occurred while installing india_compliance: Could not find DocType: Bill of Entry
Traceback with variables (most recent call last):
File "apps/frappe/frappe/commands/site.py", line 424, in install_app
_install_app(app, verbose=context.verbose, force=force)
context = {'sites': ['company_name.local'], 'force': False, 'verbose': False, 'profile': False}
apps = ('india_compliance',)
force = False
_install_app = <function install_app at 0x7f1daf839ea0>
filelock = <function filelock at 0x7f1daf839b40>
exit_code = 0
site = 'company_name.local'
app = 'india_compliance'
err = LinkValidationError('Could not find DocType: Bill of Entry')
File "apps/frappe/frappe/installer.py", line 311, in install_app
frappe.get_attr(after_install)()
name = 'india_compliance'
verbose = False
set_as_patched = True
force = False
sync_jobs = <function sync_jobs at 0x7f1dae11f520>
sync_for = <function sync_for at 0x7f1dae12c040>
sync_customizations = <function sync_customizations at 0x7f1daf9f1870>
sync_fixtures = <function sync_fixtures at 0x7f1dae12c280>
app_hooks = {'accounting_dimension_doctypes': ['Bill of Entry', 'Bill of Entry Item'], 'after_app_install': ['india_compliance.install.after_app_install'], 'after_install': ['india_compliance.install.after_install'], 'after_migrate': ['india_compliance.audit_trail.setup.after_migrate'], 'app_color': ['grey'], 'app_description': ['ERPNext app to simplify compliance with Indian Rules and Regulations'], 'app_email': ['hello@indiacompliance.app'], 'app_icon': ['octicon octicon-file-directory'], 'app_include_js': ['india_compliance.bundle.js'], 'app_license': ['GNU General Public License (v3)'], 'app_name': ['india_compliance'], 'app_publisher': ['Resilient Tech'], 'app_title': ['India Compliance'], 'audit_trail_doctypes': ['Accounts Settings', 'Dunning', 'Invoice Discounting', 'Journal Entry', 'Payment Entry', 'Period Closing Voucher', 'Process Deferred Accounting', 'Purchase Invoice', 'Sales Invoice', 'Asset', 'Asset Capitalization', 'Asset Repair', 'Delivery Note', 'Landed Cost Voucher', 'Purchase R...
installed_apps = ['frappe', 'erpnext']
app = 'frappe/erpnext'
required_app = 'erpnext'
before_install = 'india_compliance.patches.check_version_compatibility.execute'
out = None
after_install = 'india_compliance.install.after_install'
File "apps/india_compliance/india_compliance/install.py", line 73, in after_install
raise e
File "apps/india_compliance/india_compliance/install.py", line 52, in after_install
setup_audit_trail()
File "apps/india_compliance/india_compliance/audit_trail/setup.py", line 15, in setup_fixtures
create_property_setters_for_versioning()
File "apps/india_compliance/india_compliance/audit_trail/setup.py", line 35, in create_property_setters_for_versioning
property_setter.insert()
doctype = 'Bill of Entry'
property_setter_data = {'doctype_or_field': 'DocType', 'doc_type': 'Bill of Entry', 'property': 'track_changes', 'value': '1', 'property_type': 'Check', 'is_system_generated': 1}
property_setter = <PropertySetter: unsaved>
File "apps/frappe/frappe/model/document.py", line 281, in insert
self._validate_links()
self = <PropertySetter: unsaved>
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 928, in validate_links
frappe.throw(
("Could not find {0}").format(msg), frappe.LinkValidationError)
self = <PropertySetter: unsaved>
invalid_links = [('doc_type', 'Bill of Entry', 'DocType: Bill of Entry')]
cancelled_links = []
msg = 'DocType: Bill of Entry'
File "apps/frappe/frappe/init.py", line 602, in throw
msgprint(
msg = 'Could not find DocType: Bill of Entry'
exc = <class 'frappe.exceptions.LinkValidationError'>
title = None
is_minimizable = False
wide = False
as_list = False
primary_action = None
File "apps/frappe/frappe/init.py", line 567, in msgprint
_raise_exception()
title = None
as_table = False
as_list = False
indicator = 'red'
alert = False
primary_action = None
is_minimizable = False
wide = False
realtime = False
sys = <module 'sys' (built-in)>
_raise_exception = <function msgprint.._raise_exception at 0x7f1dac03e440>
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
msg = 'Could not find DocType: Bill of Entry'
out = {'message': 'Could not find DocType: Bill of Entry', 'title': 'Message', 'indicator': 'red', 'raise_exception': 1, '__frappe_exc_id': '5dfb70f4351fdbcc1838600179d5780e904633d8b18923e05010298b'}
raise_exception = <class 'frappe.exceptions.LinkValidationError'>
File "apps/frappe/frappe/init.py", line 518, in _raise_exception
raise exc
exc = LinkValidationError('Could not find DocType: Bill of Entry')
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
msg = 'Could not find DocType: Bill of Entry'
out = {'message': 'Could not find DocType: Bill of Entry', 'title': 'Message', 'indicator': 'red', 'raise_exception': 1, '__frappe_exc_id': '5dfb70f4351fdbcc1838600179d5780e904633d8b18923e05010298b'}
raise_exception = <class 'frappe.exceptions.LinkValidationError'>
frappe.exceptions.LinkValidationError: Could not find DocType: Bill of Entry

Code of Conduct

  • I agree to follow this project's Code of Conduct
@chavan0 chavan0 added the bug Something isn't working label Mar 21, 2024
@chavan0
Copy link
Author

chavan0 commented Mar 22, 2024

Apparently this was the problem when installing the app.

Ignoring dependencies of https://github.com/resilient-tech/india-compliance.git. To install dependencies use --resolve-deps

So i reinstalled it with

bench get-app --branch version-15 --resolve-deps https://github.com/resilient-tech/india-compliance.git

Now works like a charm!

@chavan0 chavan0 closed this as completed Mar 22, 2024
@chavan0 chavan0 reopened this Apr 1, 2024
@chavan0
Copy link
Author

chavan0 commented Apr 1, 2024

The solution doesn't work anymore.

@vorasmit
Copy link
Collaborator

vorasmit commented Apr 1, 2024

Looks like you are not installing correctly, or following the correct steps.

With the following steps, installation is working correctly for test cases.
https://github.com/resilient-tech/india-compliance/blob/develop/.github/helper/install.sh

In case you are not a developer, you should consult one or use frappe cloud.

@vorasmit vorasmit closed this as not planned Won't fix, can't repro, duplicate, stale Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants