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

Error during HRMS installation: Invalid DocType for field 'Final Customer Offer'. #798

Closed
1 task done
eyobtewe opened this issue Aug 17, 2023 · 6 comments
Closed
1 task done

Comments

@eyobtewe
Copy link

Information about bug

During the installation of the HRMS app, an error occurs due to an invalid DocType for the 'Final Customer Offer' field. This prevents the successful installation of the HRMS app.

Untitled

Module

HR

Version

ERPNext: v14.35.0 (version-14)
Frappe Framework: v14.45.0 (version-14)
Frappe HR: v14.10.1 (version-14)

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

An error occurred while installing hrms: Company: Options must be a valid DocType for field Final Customer Offer in row 39
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 15, in after_install
    create_custom_fields(get_custom_fields())
  File "apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 224, in create_custom_fields
    create_custom_field(doctype, df, ignore_validate=ignore_validate)
  File "apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 190, in create_custom_field
    custom_field.insert()
  File "apps/frappe/frappe/model/document.py", line 285, in insert
    self.run_post_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1088, in run_post_save_methods
    self.run_method("on_update")
  File "apps/frappe/frappe/model/document.py", line 915, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1277, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1259, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 912, in fn
    return method_object(*args, **kwargs)
  File "apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 102, in on_update
    validate_fields_for_doctype(self.dt)
  File "apps/frappe/frappe/core/doctype/doctype/doctype.py", line 1035, in validate_fields_for_doctype
    validate_fields(meta)
  File "apps/frappe/frappe/core/doctype/doctype/doctype.py", line 1464, in validate_fields
    check_link_table_options(meta.get("name"), d)
  File "apps/frappe/frappe/core/doctype/doctype/doctype.py", line 1110, in check_link_table_options
    frappe.throw(
  File "apps/frappe/frappe/__init__.py", line 534, in throw
    msgprint(
  File "apps/frappe/frappe/__init__.py", line 502, in msgprint
    _raise_exception()
  File "apps/frappe/frappe/__init__.py", line 451, in _raise_exception
    raise raise_exception(msg)
frappe.core.doctype.doctype.doctype.WrongOptionsDoctypeLinkError: Company: Options must be a valid DocType for field Final Customer Offer in row 39

Code of Conduct

  • I agree to follow this project's Code of Conduct
@eyobtewe eyobtewe added the bug Something isn't working label Aug 17, 2023
@ruchamahabal
Copy link
Member

ruchamahabal commented Aug 17, 2023

There is no such field in the core. You seem to have some custom field Final Customer Offer in your custom fields with an invalid option for the Link field. Remove the field or set the correct Link option.

@ruchamahabal ruchamahabal removed the bug Something isn't working label Aug 17, 2023
@ruchamahabal ruchamahabal closed this as not planned Won't fix, can't repro, duplicate, stale Aug 17, 2023
@sinhpn92
Copy link

I have same issue. Did you solve this @eyobtewe ?

@ruchamahabal
Copy link
Member

Do you all have any custom app installed?

@eyobtewe
Copy link
Author

I deleted my server and tried reinstalling it. Again I faced issues. There's no custom app.

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 415, in install_app
_install_app(app, verbose=context.verbose, force=force)
File "apps/frappe/frappe/installer.py", line 307, in install_app
frappe.g 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 679, 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 localhost:13000. Connection refused.

@ruchamahabal
Copy link
Member

@eyobtewe

ConnectionRefusedError: [Errno 111] Connection refused

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

on local:
bench start

on prod:
supervisorctl status

@sinhpn92
Copy link

supervisorctl

I installed hrms only. I found the field on tableCustom Field and remove it. Now It's working. Thank you.

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

3 participants