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

Wiki Module not loading after installation: ModuleNotFoundError: No module named 'redis.commands' #207

Closed
djpalshikar opened this issue Dec 29, 2023 · 3 comments
Assignees

Comments

@djpalshikar
Copy link

Frappe Wiki(commit: d9e1310) was installed on Frappe Cloud . This was installed with other apps -

image

Module is not visible on the sidebar. When accessing any Doctype, such as "New Wiki Page", the following error is seen -
image

The traceback for the above error -

`Traceback (most recent call last):
File "apps/frappe/frappe/modules/utils.py", line 245, in load_doctype_module
doctype_python_modules[key] = frappe.get_module(module_name)
File "apps/frappe/frappe/init.py", line 1348, in get_module
return importlib.import_module(modulename)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "apps/wiki/wiki/wiki/doctype/wiki_page/wiki_page.py", line 24, in
from wiki.wiki.doctype.wiki_page.search import remove_index, update_index
File "apps/wiki/wiki/wiki/doctype/wiki_page/search.py", line 9, in
from redis.commands.search.field import TextField
ModuleNotFoundError: No module named 'redis.commands'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 95, in application
response = frappe.api.handle()
File "apps/frappe/frappe/api.py", line 55, in handle
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 47, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/init.py", line 1628, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/desk/form/load.py", line 72, in getdoctype
docs = get_meta_bundle(doctype)
File "apps/frappe/frappe/desk/form/load.py", line 83, in get_meta_bundle
bundle = [frappe.desk.form.meta.get_meta(doctype)]
File "apps/frappe/frappe/desk/form/meta.py", line 44, in get_meta
meta = FormMeta(doctype)
File "apps/frappe/frappe/desk/form/meta.py", line 55, in init
self.load_assets()
File "apps/frappe/frappe/desk/form/meta.py", line 69, in load_assets
self.load_templates()
File "apps/frappe/frappe/desk/form/meta.py", line 251, in load_templates
module = load_doctype_module(self.name)
File "apps/frappe/frappe/modules/utils.py", line 249, in load_doctype_module
raise ImportError(msg) from e
ImportError: Module import failed for Wiki Page, the DocType you're trying to open might be deleted.
Error: No module named 'redis.commands'`

@akhashogji
Copy link

I solved it by upgrading redis using this:
sudo bench pip install --upgrade redis

@ankush
Copy link
Member

ankush commented Jan 1, 2024

@BreadGenie @djpalshikar

This needs a better fix for v14 compatibility or maybe a separate branch. Redisearch's current implementation can't be compatible with v14 and v15 both at same time.

Maybe keep old style search as fallback?

@ankush
Copy link
Member

ankush commented Jan 1, 2024

#208

This should fix it.

@ankush ankush closed this as completed Jan 1, 2024
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