Custom Frappe Docker with HRMS App | Tables tabdepartment and tabtask is marked as crashed and should be repaired

I have been trying out frappe_docker official for the past two weeks.
With the documentations i was able to setup multi bench in single server.

From V14 HRMS is no more part of standard ERPNext modules. I was trying to find if there is a standard image with HRMS. I could not find one.
Then I started to follow the custom app documentation to build an image with HRMS.

I was successful creating a bench and site with erpnext
When i install HRMS app, i constantly get the same error

Installing hrms...
Updating DocTypes for hrms          : [========================================] 100%
Traceback (most recent call last):
  File "/usr/local/bin/", line 48, in <module>
    raise SystemExit(main())
  File "/usr/local/bin/", line 43, in main
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/", line 18, in main
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/", line 782, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/", line 357, in reinstall
    _reinstall(site, admin_password, db_root_username, db_root_password, yes, verbose=context.verbose)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/", line 381, in _reinstall
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 101, in _new_site
    install_app(app, verbose=verbose, set_as_patched=not source_sql, force=False)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 299, in install_app
  File "/home/frappe/frappe-bench/apps/hrms/hrms/", line 12, in after_install
  File "/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/", line 208, in create_custom_fields
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/", line 365, in updatedb
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/", line 44, in sync
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/", line 148, in alter
    raise e
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/", line 132, in alter
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/", line 209, in sql
    self._cursor.execute(query, values)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/", line 148, in execute
    result = self._query(query)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/", line 310, in _query
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/", line 775, in _read_query_result
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/", line 725, in _read_packet
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/", line 221, in raise_for_error
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1194, "Table 'tabtask' is marked as crashed and should be repaired")

Once logged into desk, company initially setup is missing.
when tried to create a new company getting the below error.

Restarted the Mariadb container and it did the magic. The tables were repaired.

Mostly if you install a new site only install erpnext at first. Complete the setup and then install the hrms app.

If you face the tab is marked as crashed error restart the mariadb container.

1 Like

How do you install HRMS once you have ERPNext installed? I have tried
bench --site install-app hrms
but it fails with “Could not find app “hrms””

You have to run this command first
bench get-app

After this, then run
bench --site install-app hrms

When I run bench get-app it I just get “Error: Only Frappe framework bench commands are available in container setup.”
I am trying to run within the erpnext backend container. Was hoping to do it without making an custom app container but seems not possible. seeing as this is a standard frappe app I don’t know why this cant be directly available in frappe_docker.

The official frappe Docker only ship Frappe and ERPNext in its image.

If you need HRMS you need to build your own custom image using the steps in the official frappe docker documentation.

I have built a custom image with HRMS app. You can refer to this repo for reference

You can refer to the post for more information frappe docker with custom app error