Error while Installing Insights along with ERPNext 15

I was installing Insights develop branch to ERPNext version 14.4. The installation shows a success and on the search bar in ERPNext i can get Insights. But when I try to run it It says the page isn’t not found.
When I install it on v15 develop version of ERPnext Insight works but not in v14 and on the docs it says Insights is compatible with v15. Any tips on how to resolve this issue?

Hi
Install two bench, one with frappev14 and ERPNExt, and another with frappe v15 and insight

2 Likes

Hi @FHenry,
I currently have that setup. But using insights inside ERPNext removes the hustle of user access contol since we frequently change it. Just curios if Insight isn’t compatible with v14.
Also Hoping ERPNext v15 will be released in couple of days should i wait for that?

Running “bench migrate” fixed this problem for me.

@mrPauwHaan I did build and migrate but no luck for me. I think the issue maybe from the version of requirments like node. my current installation is node v16.
Can you share me the version of node?

I think node needs to be v18, but you should see errors about that during the installation then.

1 Like

Yes whien i build insights specifically using ‘bench build --app insights --force’ … i get the error below

Running build command for insights
$ cd frontend && yarn build
$ vite build --base=/assets/insights/frontend/ && yarn copy-html-entry
vite: invalid option – ‘-’
vite: invalid option – ‘b’
vite: invalid option – ‘a’
Splitting build
Cannot open file build
Aborted (core dumped)
error Command failed with exit code 134.
info Visit yarn run | Yarn for documentation about this command.
error Command failed with exit code 134.
info Visit yarn run | Yarn for documentation about this command.
Error: Command failed: yarn build
at checkExecSyncError (node:child_process:828:11)
at execSync (node:child_process:899:15)
at run_build_command_for_apps (/home/emc/frappe-bench/apps/frappe/esbuild/esbuild.js:433:5)
at /home/emc/frappe-bench/apps/frappe/esbuild/esbuild.js:88:35
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
status: 134,
signal: null,
output: [ null, null, null ],
pid: 1394023,
stdout: null,
stderr: null
}
Done in 4.75s

Also if i update the node to v18 will it work with erpnext v14?

@girumtibebu. yes, it works in V14.

Run the below command to resolve node v18 dependency.

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

updated node to v18.18.0 but still getting this error:

Running build command for insights
$ cd frontend && yarn build
$ vite build --base=/assets/insights/frontend/ && yarn copy-html-entry
vite: invalid option – ‘-’
vite: invalid option – ‘b’
vite: invalid option – ‘a’
Splitting build
Cannot open file build
Aborted (core dumped)
error Command failed with exit code 134.
info Visit yarn run | Yarn for documentation about this command.
error Command failed with exit code 134.
info Visit yarn run | Yarn for documentation about this command.
Error: Command failed: yarn build
at checkExecSyncError (node:child_process:890:11)
at execSync (node:child_process:962:15)
at run_build_command_for_apps (/home/emc/frappe-bench/apps/frappe/esbuild/esbuild.js:433:5)
at /home/emc/frappe-bench/apps/frappe/esbuild/esbuild.js:88:35
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
status: 134,
signal: null,
output: [ null, null, null ],
pid: 1473156,
stdout: null,
stderr: null
}
clean: postcss.plugin was deprecated. Migration guide:
PostCSS 8.0: Plugin migration guide—Martian Chronicles, Evil Martians’ team blog
Done in 3.91s.

i get the following error when installing it on v15

Installing insights…
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/global/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 114, in
main()
File “/home/global/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 20, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/global/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1157, in call
return self.main(*args, **kwargs)
File “/home/global/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1078, in main
rv = self.invoke(ctx)
File “/home/global/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/global/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/global/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/global/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 783, in invoke
return __callback(*args, **kwargs)
File “/home/global/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/global/frappe-bench/apps/frappe/frappe/commands/init.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/global/frappe-bench/apps/frappe/frappe/commands/site.py”, line 446, in install_app
_install_app(app, verbose=context.verbose, force=force)
File “/home/global/frappe-bench/apps/frappe/frappe/installer.py”, line 309, in install_app
frappe.get_attr(after_install)()
File “/home/global/frappe-bench/apps/insights/insights/setup/init.py”, line 12, in after_install
sync_site_tables()
File “/home/global/frappe-bench/apps/insights/insights/setup/init.py”, line 19, in sync_site_tables
if not frappe.db.exists(“Insights Data Source”, “Site DB”):
File “/home/global/frappe-bench/apps/frappe/frappe/database/database.py”, line 1120, in exists
return self.get_value(dt, dn, ignore=True, cache=cache, order_by=None)
File “/home/global/frappe-bench/apps/frappe/frappe/database/database.py”, line 517, in get_value
result = self.get_values(
File “/home/global/frappe-bench/apps/frappe/frappe/database/database.py”, line 618, in get_values
out = self._get_values_from_table(
File “/home/global/frappe-bench/apps/frappe/frappe/database/database.py”, line 888, in _get_values_from_table
return query.run(as_dict=as_dict, debug=debug, update=update, run=run, pluck=pluck)
File “/home/global/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/global/frappe-bench/apps/frappe/frappe/database/database.py”, line 262, in sql
traceback.print_stack()
Error in query:
(‘SELECT name FROM tabInsights Data Source WHERE name=%(param1)s LIMIT 1’, {‘param1’: ‘Site DB’})
An error occurred while installing insights: Module import failed for Insights Data Source, the DocType you’re trying to open might be deleted.
Error: No module named ‘frappe.core.doctype.insights_data_source’
Traceback with variables (most recent call last):
File “apps/frappe/frappe/commands/site.py”, line 446, in install_app
_install_app(app, verbose=context.verbose, force=force)
context = {‘sites’: [‘work.bobyangold.com’], ‘force’: False, ‘verbose’: False, ‘profile’: False}
apps = (‘insights’,)
force = False
_install_app = <function install_app at 0x7fb8efed5c60>
filelock = <function filelock at 0x7fb8efed5900>
exit_code = 0
site = ‘work.bobyangold.com
app = ‘insights’
err = ImportError(“Module import failed for Insights Data Source, the DocType you’re trying to open might be deleted.
Error: No module named ‘frappe.core.doctype.insights_data_source’”)
File “apps/frappe/frappe/installer.py”, line 309, in install_app
frappe.get_attr(after_install)()
name = ‘insights’
verbose = False
set_as_patched = True
force = False
sync_jobs = <function sync_jobs at 0x7fb8ef7513f0>
sync_for = <function sync_for at 0x7fb8ef751ea0>
sync_customizations = <function sync_customizations at 0x7fb8f00688b0>
sync_fixtures = <function sync_fixtures at 0x7fb8ef7520e0>
app_hooks = {‘after_install’: [‘insights.setup.after_install’], ‘app_color’: [‘grey’], ‘app_description’: [‘Powerful Reporting Tool for Frappe Apps’], ‘app_email’: [‘hello@frappe.io’], ‘app_icon’: [‘octicon octicon-file-directory’], ‘app_license’: [‘GNU GPLv3’], ‘app_name’: [‘insights’], ‘app_publisher’: [‘Frappe Technologies Pvt. Ltd.’], ‘app_title’: [‘Frappe Insights’], ‘app_version’: [‘2.1.2’], ‘before_tests’: [‘insights.tests.utils.before_tests’], ‘fixtures’: [‘Insights Data Source’], ‘has_permission’: {‘Insights Data Source’: [‘insights.overrides.has_permission’], ‘Insights Table’: [‘insights.overrides.has_permission’], ‘Insights Query’: [‘insights.overrides.has_permission’], ‘Insights Dashboard’: [‘insights.overrides.has_permission’]}, ‘scheduler_events’: {‘all’: [‘insights.insights.doctype.insights_alert.insights_alert.send_alerts’]}, ‘setup_wizard_requires’: [‘assets/insights/js/setup_wizard.js’], ‘setup_wizard_stages’: [‘insights.setup.setup_wizard.get_setup_stages’], 'website_route_rules…
installed_apps = [‘frappe’, ‘erpnext’, ‘bg_items’, ‘location_management’, ‘stock_records’, ‘custom_auth’, ‘bg_general_customizations’, ‘bulk_barcode’, ‘hrms’]
after_install = ‘insights.setup.after_install’
File “apps/insights/insights/setup/init.py”, line 12, in after_install
sync_site_tables()
File “apps/insights/insights/setup/init.py”, line 20, in sync_site_tables
create_site_db_data_source()
File “apps/insights/insights/setup/init.py”, line 32, in create_site_db_data_source
frappe.get_doc(site_db).insert()
data_source_fixture_path = ‘apps/insights/insights/fixtures/insights_data_source.json’
f = <_io.TextIOWrapper name=‘apps/insights/insights/fixtures/insights_data_source.json’ mode=‘r’ encoding=‘UTF-8’>
site_db = {‘doctype’: ‘Insights Data Source’, ‘is_site_db’: 1, ‘name’: ‘Site DB’, ‘title’: ‘Site DB’, ‘status’: ‘Active’, ‘database_type’: ‘MariaDB’, ‘modified’: ‘2022-01-01 00:01:00.000000’, ‘creation’: ‘2022-01-01 00:01:00.000000’}
File “apps/frappe/frappe/init.py”, line 1276, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
args = ({‘doctype’: ‘Insights Data Source’, ‘is_site_db’: 1, ‘name’: ‘Site DB’, ‘title’: ‘Site DB’, ‘status’: ‘Active’, ‘database_type’: ‘MariaDB’, ‘modified’: ‘2022-01-01 00:01:00.000000’, ‘creation’: ‘2022-01-01 00:01:00.000000’},)
kwargs = {}
frappe = <module ‘frappe’ from ‘apps/frappe/frappe/init.py’>
File “apps/frappe/frappe/model/document.py”, line 79, in get_doc
controller = get_controller(doctype)
args = ({‘doctype’: ‘Insights Data Source’, ‘is_site_db’: 1, ‘name’: ‘Site DB’, ‘title’: ‘Site DB’, ‘status’: ‘Active’, ‘database_type’: ‘MariaDB’, ‘modified’: ‘2022-01-01 00:01:00.000000’, ‘creation’: ‘2022-01-01 00:01:00.000000’},)
kwargs = {‘doctype’: ‘Insights Data Source’, ‘is_site_db’: 1, ‘name’: ‘Site DB’, ‘title’: ‘Site DB’, ‘status’: ‘Active’, ‘database_type’: ‘MariaDB’, ‘modified’: ‘2022-01-01 00:01:00.000000’, ‘creation’: ‘2022-01-01 00:01:00.000000’}
doctype = ‘Insights Data Source’
File “apps/frappe/frappe/model/base_document.py”, line 70, in get_controller
site_controllers[doctype] = import_controller(doctype)
doctype = ‘Insights Data Source’
site_controllers = {‘Module Def’: <class ‘frappe.core.doctype.module_def.module_def.ModuleDef’>, ‘DocField’: <class ‘frappe.core.doctype.docfield.docfield.DocField’>, ‘DocPerm’: <class ‘frappe.core.doctype.docperm.docperm.DocPerm’>, ‘DocType Link’: <class ‘frappe.core.doctype.doctype_link.doctype_link.DocTypeLink’>, ‘System Settings’: <class ‘frappe.core.doctype.system_settings.system_settings.SystemSettings’>, ‘Notification Settings’: <class ‘frappe.desk.doctype.notification_settings.notification_settings.NotificationSettings’>, ‘DefaultValue’: <class ‘frappe.core.doctype.defaultvalue.defaultvalue.DefaultValue’>, ‘Payment Reconciliation’: <class ‘erpnext.accounts.doctype.payment_reconciliation.payment_reconciliation.PaymentReconciliation’>, ‘Customize Form’: <class ‘frappe.custom.doctype.customize_form.customize_form.CustomizeForm’>, ‘DocType Action’: <class ‘frappe.core.doctype.doctype_action.doctype_action.DocTypeAction’>, ‘DocType State’: <class 'frappe.core.doctype.doctype_state.doctype_state.DocTyp…
File “apps/frappe/frappe/model/base_document.py”, line 95, in import_controller
module = load_doctype_module(doctype, module_name)
doctype = ‘Insights Data Source’
Document = <class ‘frappe.model.document.Document’>
NestedSet = <class ‘frappe.utils.nestedset.NestedSet’>
module_name = ‘Core’
doctype_info = None
module_path = None
class_overrides = {‘Address’: [‘erpnext.accounts.custom.address.ERPNextAddress’], ‘Employee’: [‘hrms.overrides.employee_master.EmployeeMaster’], ‘Timesheet’: [‘hrms.overrides.employee_timesheet.EmployeeTimesheet’], ‘Payment Entry’: [‘hrms.overrides.employee_payment_entry.EmployeePaymentEntry’], ‘Project’: [‘hrms.overrides.employee_project.EmployeeProject’]}
File “apps/frappe/frappe/modules/utils.py”, line 241, in load_doctype_module
raise ImportError(msg) from e
doctype = ‘Insights Data Source’
module = ‘Core’
prefix = ‘’
suffix = ‘’
app = ‘frappe’
key = ********
module_name = ‘frappe.core.doctype.insights_data_source.insights_data_source’
msg = “Module import failed for Insights Data Source, the DocType you’re trying to open might be deleted.
Error: No module named ‘frappe.core.doctype.insights_data_source’”
builtins.ImportError: Module import failed for Insights Data Source, the DocType you’re trying to open might be deleted.
Error: No module named ‘frappe.core.doctype.insights_data_source’

is it not compatible with erpnext and frappe v15 ?