Installation for Frappe HR app failed due to an error

Error while installing HR module.

Please check below error and guide.

App erpnext already installed

Installing hrms...
Updating DocTypes for hrms          : [========================================] 100%
Setting up Frappe HR...

Patching Existing Data...
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: Error 111 connecting to 127.0.0.1:13001. Connection refused.
Traceback (most recent call last):
  File "env/lib/python3.10/site-packages/redis/connection.py", line 559, in connect
    sock = self._connect()
  File "env/lib/python3.10/site-packages/redis/connection.py", line 615, in _connect
    raise err
  File "env/lib/python3.10/site-packages/redis/connection.py", line 603, in _connect
    sock.connect(socket_address)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apps/frappe/frappe/commands/site.py", line 415, in install_app
    _install_app(app, verbose=context.verbose, force=force)
  File "apps/frappe/frappe/installer.py", line 307, in install_app
    frappe.get_attr(after_install)()
  File "apps/hrms/hrms/install.py", line 21, in after_install
    raise e
  File "apps/hrms/hrms/install.py", line 9, in after_install
    setup()
  File "apps/hrms/hrms/setup.py", line 23, in after_install
    run_post_install_patches()
  File "apps/hrms/hrms/setup.py", line 687, in run_post_install_patches
    frappe.get_attr(f"hrms.patches.post_install.{patch_name}.execute")()
  File "apps/hrms/hrms/patches/post_install/rename_stop_to_send_birthday_reminders.py", line 10, in execute
    rename_field("HR Settings", "stop_birthday_reminders", "send_birthday_reminders")
  File "apps/frappe/frappe/model/utils/rename_field.py", line 55, in rename_field
    update_user_settings(doctype, old_fieldname, new_fieldname)
  File "apps/frappe/frappe/model/utils/rename_field.py", line 166, in update_user_settings
    sync_user_settings()
  File "apps/frappe/frappe/model/utils/user_settings.py", line 49, in sync_user_settings
    for key, data in frappe.cache().hgetall("_user_settings").items():
  File "apps/frappe/frappe/utils/redis_wrapper.py", line 181, in hgetall
    value = super().hgetall(self.make_key(name))
  File "env/lib/python3.10/site-packages/redis/client.py", line 3014, in hgetall
    return self.execute_command('HGETALL', name)
  File "env/lib/python3.10/site-packages/redis/client.py", line 898, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
  File "env/lib/python3.10/site-packages/redis/connection.py", line 1192, in get_connection
    connection.connect()
  File "env/lib/python3.10/site-packages/redis/connection.py", line 563, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to 127.0.0.1:13001. Connection refused.

After this error when I check bench version…

khan@Umar:~/bench14$ bench --site all list-apps
frappe
erpnext
hrms
khan@Umar:~/bench14$ bench version -f table
+---------+---------+------------+---------+
| App     | Version | Branch     | Commit  |
+---------+---------+------------+---------+
| erpnext | 14.52.1 | version-14 | 7b6f25c |
| frappe  | 14.57.0 | version-14 | a403c47 |
| hrms    | 14.18.1 | version-14 | 0826951 |
+---------+---------+------------+---------+

Looks like redis server is not running.

check with this command:

systemctl status redis
2 Likes

@umarless run bench start, then open another terminal and change directory to your bench directory, then uninstall hrms and re-install hrms.
Make sure bench should be running in previous terminal.

3 Likes

Thanks Himanshu,
It worked.
:slightly_smiling_face:

2 Likes