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

Problem while installing HRMS on site using SSH on Ubuntu 22.04 LTS #369

Closed
1 task done
senzait opened this issue Mar 6, 2023 · 5 comments
Closed
1 task done

Comments

@senzait
Copy link

senzait commented Mar 6, 2023

Information about bug

When i tried to install HRMS on my site i got following error.

`erpnext@erpnext:~/frappe-bench$ bench --site erp.senzait.com install-app hrms
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 localhost:13000. 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 416, in install_app
_install_app(app, verbose=context.verbose, force=force)
File "apps/frappe/frappe/installer.py", line 304, 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 662, 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 177, 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 localhost:13000. Connection refused.`

Module

HR

Version

Latest new installation of Frappe and ERPNext

`erpnext@erpnext:~/frappe-bench$ bench --site erp.senzait.com install-app hrms
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 localhost:13000. 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 416, in install_app
_install_app(app, verbose=context.verbose, force=force)
File "apps/frappe/frappe/installer.py", line 304, 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 662, 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 177, 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 localhost:13000. Connection refused.`

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@senzait senzait added the bug Something isn't working label Mar 6, 2023
@logicallimit
Copy link

Facing same issue

frappe@erpnext14:~/frappe-bench$ bench --site erp.llc.in install-app hrms
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 localhost:13000. 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 416, in install_app
_install_app(app, verbose=context.verbose, force=force)
File "apps/frappe/frappe/installer.py", line 304, 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 662, 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 177, 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 localhost:13000. Connection refused.

frappe@erpnext14:~/frappe-bench$ bench restart
WARN: restart failed: Couldn't find supervisorctl in PATH

@ruchamahabal
Copy link
Member

Just make sure your bench is running while installing the app on your site

supervisorctl status

@ruchamahabal ruchamahabal removed the bug Something isn't working label Mar 10, 2023
@senzait
Copy link
Author

senzait commented Mar 11, 2023

@ruchamahabal is it necessary even when doing fresh brand new installations? as few weeks ago i did followed the same steps which I am using right now, but that time there were no such errors, but now this time only i am getting this error.

@ruchamahabal
Copy link
Member

ruchamahabal commented Mar 14, 2023

Since Frappe HR has been separated from ERPNext, we run post install patches (patches that aren't present in patch log) to make sure existing data has been patched. We can probably skip post install patches for fresh installations, but appropriately finding out whether it's a fresh installation or not is the tricky part. People might be creating a site from backup and data will still need patching. Will check if there is a way to do this without any false assumptions.

So currently installing Frappe HR will require the bench to be running.

@qbadev
Copy link

qbadev commented Jul 31, 2024

In my case, issue was bench was not started. So I had only to run command bench start and wait for the server to set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants