flexcomng / erpnext_quick_install

Unattended install script for ERPNext Versions, 13, 14 and 15
MIT License
176 stars 129 forks source link

Error in HRMS installation #22

Closed envobe closed 4 months ago

envobe commented 5 months ago

Hello, the terminal closes itself while installing the HRMS system. Do you have an update on this?

flexcomng commented 5 months ago

I found that HRMS installation tends to fail sometimes and it's got nothing to do with the installer.

toofun666 commented 4 months ago

Please exclude HRMS from this package. Drops the quality of this package to magma level. Destroyed 2 VM's in the last week trying to figure out what was the issue. Anyone who is interested in HRMS can do it easily.

flexcomng commented 4 months ago

Destroyed 2 VM's in the last week trying to figure out what was the issue.

@toofun666 Thanks for your feedback and suggestion. Just so you know, if the install crashes during HRMS install it does not require you to kill the vps as at that point the only process left is ssl setup which can be done manually.

I really don't understand why HRMS install is buggy because it is the same experience even outside the script. However, i would prefer to leave the decision to install HRMS to the user while informing of the risk. I will move HRMS install to the very end of the install process and add a warning to users to know that HRMS install might throw an error. Moving it to the end however ensures that the base setup is complete so the HRMS install crash will not force you to terminate your VM.

imlei commented 4 months ago

I have the same issue here. I have ubuntu 22.04 + erpnext 15

flexcomng commented 4 months ago

@imlei Please confirm if you're running the script as root.

imlei commented 4 months ago

@imlei Please confirm if you're running the script as root.

yes, I am running as root

flexcomng commented 4 months ago

@imlei You cannot run frappe installation as root. Please create a standard user and add to the sudoers and ssh with that user to run install.

imlei commented 4 months ago

@imlei You cannot run frappe installation as root. Please create a standard user and add to the sudoers and ssh with that user to run install.

Tired as frappe, get the error:

Installing hrms...
Setting up Frappe HR...
Installation for Frappe HR app failed due to an error. Please try re-installing                                                                                                                                                                                                                                              the app or report the issue on https://github.com/frappe/hrms/issues/new if not                                                                                                                                                                                                                                              resolved.
An error occurred while installing hrms: Module import failed for Expense Claim                                                                                                                                                                                                                                              Type, the DocType you're trying to open might be deleted.<br> Error: No module n                                                                                                                                                                                                                                             amed 'frappe.core.doctype.expense_claim_type'
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': ['apexsolu.com'], 'force': False, 'verbose': False, 'p                                                                                                                                                                                                                                             rofile': False}
      apps = ('hrms',)
      force = False
      _install_app = <function install_app at 0x7f255be520e0>
      filelock = <function filelock at 0x7f255be51d80>
      exit_code = 0
      site = 'apexsolu.com'
      app = 'hrms'
      err = ImportError("Module import failed for Expense Claim Type, the DocTyp                                                                                                                                                                                                                                             e you're trying to open might be deleted.<br> Error: No module named 'frappe.cor                                                                                                                                                                                                                                             e.doctype.expense_claim_type'")
  File "apps/frappe/frappe/installer.py", line 311, in install_app
    frappe.get_attr(after_install)()
      name = 'hrms'
      verbose = False
      set_as_patched = True
      force = False
      sync_jobs = <function sync_jobs at 0x7f255ad9c790>
      sync_for = <function sync_for at 0x7f255ad9d240>
      sync_customizations = <function sync_customizations at 0x7f255bdfcaf0>
      sync_fixtures = <function sync_fixtures at 0x7f255ad9d480>
      app_hooks = {'accounting_dimension_doctypes': ['Expense Claim', 'Expense C                                                                                                                                                                                                                                             laim Detail', 'Expense Taxes and Charges', 'Payroll Entry'], 'advance_payment_do                                                                                                                                                                                                                                             ctypes': ['Gratuity', 'Employee Advance'], 'after_app_install': ['hrms.setup.aft                                                                                                                                                                                                                                             er_app_install'], 'after_install': ['hrms.install.after_install'], 'after_migrat                                                                                                                                                                                                                                             e': ['hrms.setup.update_select_perm_after_install'], 'app_description': ['Modern                                                                                                                                                                                                                                              HR and Payroll Software'], 'app_email': ['contact@frappe.io'], 'app_include_css                                                                                                                                                                                                                                             ': ['hrms.bundle.css'], 'app_include_js': ['hrms.bundle.js'], 'app_license': ['G                                                                                                                                                                                                                                             NU General Public License (v3)'], 'app_name': ['hrms'], 'app_publisher': ['Frapp                                                                                                                                                                                                                                             e Technologies Pvt. Ltd.'], 'app_title': ['Frappe HR'], 'bank_reconciliation_doc                                                                                                                                                                                                                                             types': ['Expense Claim'], 'before_app_uninstall': ['hrms.setup.before_app_unins                                                                                                                                                                                                                                             tall'], 'before_tests': ['hrms.tests.test_utils.before_tests'], 'before_uninstal                                                                                                                                                                                                                                             l': ['hrms.uninstall.before_uninstall'], 'calendars': ['Leave Application'], 'do                                                                                                                                                                                                                                             c_events': {'User': {'validate': ['erpnext.setup.doctype.e...
      installed_apps = ['frappe', 'erpnext']
      app = 'frappe/erpnext'
      required_app = 'erpnext'
      after_install = 'hrms.install.after_install'
  File "apps/hrms/hrms/install.py", line 21, in after_install
    raise e
      BUG_REPORT_URL = 'https://github.com/frappe/hrms/issues/new'
  File "apps/hrms/hrms/install.py", line 9, in after_install
    setup()
      BUG_REPORT_URL = 'https://github.com/frappe/hrms/issues/new'
  File "apps/hrms/hrms/setup.py", line 18, in after_install
    make_fixtures()
  File "apps/hrms/hrms/setup.py", line 414, in make_fixtures
    make_records(records)
      records = [{'doctype': 'Expense Claim Type', 'name': 'Calls', 'expense_typ                                                                                                                                                                                                                                             e': 'Calls'}, {'doctype': 'Expense Claim Type', 'name': 'Food', 'expense_type':                                                                                                                                                                                                                                              'Food'}, {'doctype': 'Expense Claim Type', 'name': 'Medical', 'expense_type': 'M                                                                                                                                                                                                                                             edical'}, {'doctype': 'Expense Claim Type', 'name': 'Others', 'expense_type': 'O                                                                                                                                                                                                                                             thers'}, {'doctype': 'Expense Claim Type', 'name': 'Travel', 'expense_type': 'Tr                                                                                                                                                                                                                                             avel'}, {'doctype': 'Vehicle Service Item', 'service_item': 'Brake Oil'}, {'doct                                                                                                                                                                                                                                             ype': 'Vehicle Service Item', 'service_item': 'Brake Pad'}, {'doctype': 'Vehicle                                                                                                                                                                                                                                              Service Item', 'service_item': 'Clutch Plate'}, {'doctype': 'Vehicle Service It                                                                                                                                                                                                                                             em', 'service_item': 'Engine Oil'}, {'doctype': 'Vehicle Service Item', 'service                                                                                                                                                                                                                                             _item': 'Oil Change'}, {'doctype': 'Vehicle Service Item', 'service_item': 'Whee                                                                                                                                                                                                                                             ls'}, {'doctype': 'Leave Type', 'leave_type_name': 'Casual Leave', 'name': 'Casu                                                                                                                                                                                                                                             al Leave', 'allow_encashment': 1, 'is_carry_forward': 1, 'max_continuous_days_al                                                                                                                                                                                                                                             lowed': '3', 'include_holiday': 1}, {'doctype': 'Leave T...
  File "apps/frappe/frappe/desk/page/setup_wizard/setup_wizard.py", line 412, in                                                                                                                                                                                                                                              make_records
    doc = frappe.new_doc(doctype)
      records = [{'doctype': 'Expense Claim Type', 'name': 'Calls', 'expense_typ                                                                                                                                                                                                                                             e': 'Calls'}, {'doctype': 'Expense Claim Type', 'name': 'Food', 'expense_type':                                                                                                                                                                                                                                              'Food'}, {'doctype': 'Expense Claim Type', 'name': 'Medical', 'expense_type': 'M                                                                                                                                                                                                                                             edical'}, {'doctype': 'Expense Claim Type', 'name': 'Others', 'expense_type': 'O                                                                                                                                                                                                                                             thers'}, {'doctype': 'Expense Claim Type', 'name': 'Travel', 'expense_type': 'Tr                                                                                                                                                                                                                                             avel'}, {'doctype': 'Vehicle Service Item', 'service_item': 'Brake Oil'}, {'doct                                                                                                                                                                                                                                             ype': 'Vehicle Service Item', 'service_item': 'Brake Pad'}, {'doctype': 'Vehicle                                                                                                                                                                                                                                              Service Item', 'service_item': 'Clutch Plate'}, {'doctype': 'Vehicle Service It                                                                                                                                                                                                                                             em', 'service_item': 'Engine Oil'}, {'doctype': 'Vehicle Service Item', 'service                                                                                                                                                                                                                                             _item': 'Oil Change'}, {'doctype': 'Vehicle Service Item', 'service_item': 'Whee                                                                                                                                                                                                                                             ls'}, {'doctype': 'Leave Type', 'leave_type_name': 'Casual Leave', 'name': 'Casu                                                                                                                                                                                                                                             al Leave', 'allow_encashment': 1, 'is_carry_forward': 1, 'max_continuous_days_al                                                                                                                                                                                                                                             lowed': '3', 'include_holiday': 1}, {'doctype': 'Leave T...
      debug = False
      _dict = <class 'frappe._dict'>
      scrub = <function scrub at 0x7f255bfeac20>
      record = {'doctype': 'Expense Claim Type', 'name': 'Calls', 'expense_type'                                                                                                                                                                                                                                             : 'Calls'}
      doctype = 'Expense Claim Type'
      condition = None
  File "apps/frappe/frappe/__init__.py", line 1190, in new_doc
    new_doc = get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)
      doctype = 'Expense Claim Type'
      parent_doc = None
      parentfield = None
      as_dict = False
      kwargs = {}
      get_new_doc = <function get_new_doc at 0x7f25596196c0>
  File "apps/frappe/frappe/model/create_new.py", line 22, in get_new_doc
    frappe.local.new_doc_templates[doctype] = make_new_doc(doctype)
      doctype = 'Expense Claim Type'
      parent_doc = None
      parentfield = None
      as_dict = False
  File "apps/frappe/frappe/model/create_new.py", line 35, in make_new_doc
    doc = frappe.get_doc({"doctype": doctype, "__islocal": 1, "owner": frappe.se                                                                                                                                                                                                                                             ssion.user, "docstatus": 0})
      doctype = 'Expense Claim Type'
  File "apps/frappe/frappe/__init__.py", line 1333, in get_doc
    doc = frappe.model.document.get_doc(*args, **kwargs)
      args = ({'doctype': 'Expense Claim Type', '__islocal': 1, 'owner': 'Admini                                                                                                                                                                                                                                             strator', 'docstatus': 0},)
      kwargs = {}
      frappe = <module 'frappe' from 'apps/frappe/frappe/__init__.py'>
  File "apps/frappe/frappe/model/document.py", line 83, in get_doc
    controller = get_controller(doctype)
      args = ({'doctype': 'Expense Claim Type', '__islocal': 1, 'owner': 'Admini                                                                                                                                                                                                                                             strator', 'docstatus': 0},)
      kwargs = {'doctype': 'Expense Claim Type', '__islocal': 1, 'owner': 'Admin                                                                                                                                                                                                                                             istrator', 'docstatus': 0}
      doctype = 'Expense Claim Type'
  File "apps/frappe/frappe/model/base_document.py", line 70, in get_controller
    site_controllers[doctype] = import_controller(doctype)
      doctype = 'Expense Claim Type'
      site_controllers = {'Module Def': <class 'frappe.core.doctype.module_def.m                                                                                                                                                                                                                                             odule_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_settin                                                                                                                                                                                                                                             gs.SystemSettings'>, 'Notification Settings': <class 'frappe.desk.doctype.notifi                                                                                                                                                                                                                                             cation_settings.notification_settings.NotificationSettings'>, 'DefaultValue': <c                                                                                                                                                                                                                                             lass 'frappe.core.doctype.defaultvalue.defaultvalue.DefaultValue'>, 'Payment Rec                                                                                                                                                                                                                                             onciliation': <class 'erpnext.accounts.doctype.payment_reconciliation.payment_re                                                                                                                                                                                                                                             conciliation.PaymentReconciliation'>, 'Customize Form': <class 'frappe.custom.do                                                                                                                                                                                                                                             ctype.customize_form.customize_form.CustomizeForm'>, 'DocType Action': <class 'f                                                                                                                                                                                                                                             rappe.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_controlle                                                                                                                                                                                                                                             r
    module = load_doctype_module(doctype, module_name)
      doctype = 'Expense Claim Type'
      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.ERPNextAdd                                                                                                                                                                                                                                             ress'], 'Employee': ['hrms.overrides.employee_master.EmployeeMaster'], 'Timeshee                                                                                                                                                                                                                                             t': ['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 254, in load_doctype_module
    raise ImportError(msg) from e
      doctype = 'Expense Claim Type'
      module = 'Core'
      prefix = ''
      suffix = ''
      app = 'frappe'
      key = ********
      module_name = 'frappe.core.doctype.expense_claim_type.expense_claim_type'
      msg = "Module import failed for Expense Claim Type, the DocType you're try                                                                                                                                                                                                                                             ing to open might be deleted.<br> Error: No module named 'frappe.core.doctype.ex                                                                                                                                                                                                                                             pense_claim_type'"
builtins.ImportError: Module import failed for Expense Claim Type, the DocType y                                                                                                                                                                                                                                             ou're trying to open might be deleted.<br> Error: No module named 'frappe.core.d                                                                                                                                                                                                                                             octype.expense_claim_type'
An error occurred on line 458 with exit status 0
flexcomng commented 4 months ago

This is clearly an error from the HRMS app. Please do not install it for now. You can try to install it after your site is fully set up. I may have to remove the option to install HRMS as it is clearly a buggy app.