I had been using Frappe WIKI on two different applications, about a month a go (did not write exact date) the pages where unaccessible, i thought it would be corrected on next install. Now i had to totally uninstall the app (bench --site erpinstallation.com uninstall-app wiki --force), but when trying to reinstall i get the next error:
Updating DocTypes for wiki : [============ ] 30%An error occurred while installing wiki: Module import failed for Wiki Space, the DocType you’re trying to open might be deleted.
Error: No module named ‘redis.commands’
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 1327, 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_space/wiki_space.py”, line 11, in
from wiki.wiki.doctype.wiki_page.search import drop_index, rebuild_index_in_background
File “apps/wiki/wiki/wiki/doctype/wiki_page/search.py”, line 8, 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/commands/site.py”, line 416, in install_app
_install_app(app, verbose=context.verbose, force=force)
File “apps/frappe/frappe/installer.py”, line 294, in install_app
sync_for(name, force=force, reset_permissions=True)
File “apps/frappe/frappe/model/sync.py”, line 81, in sync_for
import_file_by_path(
File “apps/frappe/frappe/modules/import_file.py”, line 145, in import_file_by_path
import_doc(
File “apps/frappe/frappe/modules/import_file.py”, line 242, in import_doc
doc.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 1082, in run_post_save_methods
self.run_method(“on_update”)
File “apps/frappe/frappe/model/document.py”, line 914, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1264, in composer
return composed(self, method, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1246, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “apps/frappe/frappe/model/document.py”, line 911, in fn
return method_object(*args, **kwargs)
File “apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 409, in on_update
self.run_module_method(“on_doctype_update”)
File “apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 494, in run_module_method
module = load_doctype_module(self.name, self.module)
File “apps/frappe/frappe/modules/utils.py”, line 249, in load_doctype_module
raise ImportError(msg) from e
ImportError: Module import failed for Wiki Space, the DocType you’re trying to open might be deleted.
Error: No module named ‘redis.commands’
I have traced the error to redis.commands and i have reviewed the redis installation. These are some additional screenshots
erpnext@localhost:~$ python3 -m pip install --upgrade redis
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: redis in /usr/local/lib/python3.10/dist-packages (4.5.4)
Requirement already satisfied: async-timeout>=4.0.2 in /usr/local/lib/python3.10/dist-packages (from redis) (4.0.2)
erpnext@localhost:~/frappe-bench$ pip show redis
Name: redis
Version: 4.5.4
Summary: Python client for Redis database and key-value store
Home-page: GitHub - redis/redis-py: Redis Python Client
Author: Redis Inc.
Author-email: oss@redis.com
License: MIT
Location: /usr/local/lib/python3.10/dist-packages
Requires: async-timeout
Required-by:
erpnext@localhost:~/frappe-bench$ sudo systemctl status redis-server.service
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2023-04-24 22:36:11 UTC; 1h 21min ago
Docs: https://redis.io/docs/,
man:redis-server(1)
Main PID: 901 (redis-server)
Status: “Ready to accept connections”
Tasks: 5 (limit: 4530)
Memory: 4.9M
CPU: 6.500s
CGroup: /system.slice/redis-server.service
└─901 “/usr/bin/redis-server 127.0.0.1:6379” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “” “”
Apr 24 22:36:10 localhost systemd[1]: Starting Advanced key-value store…
Apr 24 22:36:11 localhost systemd[1]: Started Advanced key-value store.
erpnext@localhost:~/frappe-bench$ pip3 list | grep redis
redis 4.5.4
I am by no means a python expert or developer, but i tried all solutions that were posted previously (mix of develop and V14 versions, unexisting redis installation,…), i do not know if the redis version available is the correct for WIKI.
I have always run production versions on my installations, as far as i could tell never installed a develop branch.
I am temporarily running the installations without the WIKI app, and would love to get back using it, but if it is not possible i would move to another solution. If WIKI is no longer compatible with the current erpnext/frappe release it would be great to know
Regards and thank you for any help
Luis Montanaro