Closed Mishman7 closed 1 year ago
Hey, I'm assuming you're using Frappe Framework v14. This error happened because the v2.0.0
tag's target was master
(which doesn't support Frappe Framework v14). I've changed it to the version-14
branch and now the search will work fine.
@BreadGenie what should I do in my bench?
bench switch-to-branch version-14 wiki
@BreadGenie what should I do in my bench?
bench switch-to-branch version-14 wiki
Yes, that will work fine too
@BreadGenie what should I do in my bench?
bench switch-to-branch version-14 wiki
Yes, that will work fine too
Got error after switch-to branch and bench update --patch
admin@testerp:~/frappe$ bench update --patch
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From https://github.com/frappe/frappe
bench update --reset
. Consider the consequences of git reset --hard
on your apps before you run that.
To avoid seeing this warning, set shallow_clone to false in your common_site_config.json
Backing up sites...
Backup Summary for erpnext.voks-it.local at 2023-05-31 19:16:04.972626
Config : ./erpnext.voks-it.local/private/backups/20230531_191603-erpnext_voks-it_local-site_config_backup.json 271.0B
Database: ./erpnext.voks-it.local/private/backups/20230531_191603-erpnext_voks-it_local-database.sql.gz 1.8MiB
Backup for Site erpnext.voks-it.local has been successfully completed
Patching sites...
Migrating erpnext.voks-it.local
Updating DocTypes for frappe : [========================================] 100%
Updating DocTypes for erpnext : [========================================] 100%
Updating DocTypes for hrms : [========================================] 100%
Updating DocTypes for chat : [========================================] 100%
Updating DocTypes for vitapp : [========================================] 100%
Updating DocTypes for wiki : [========================================] 100%
wiki.wiki.doctype.wiki_page.search.rebuild_index_if_not_exists is not a valid method: No module named 'redisearch'
Updating Dashboard for frappe
Updating Dashboard for erpnext
Updating Dashboard for hrms
Updating Dashboard for chat
Updating Dashboard for vitapp
Updating Dashboard for wiki
Updating customizations for Address
Updating customizations for Contact
Queued rebuilding of search index for erpnext.voks-it.local
Traceback with variables (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
mod_name = 'frappe.utils.bench_helper'
alter_argv = True
mod_spec = ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f3371b3ee90>, origin='/home/admin/frappe/apps/frappe/frappe/utils/bench_helper.py')
code = <code object nil' object; Ellipsis represents
...' in slices.", 'package': '', 'loader': <class '_frozen_importlib.BuiltinImporter'>...
kwds = {}
File "/home/admin/frappe/apps/wiki/wiki/wiki/doctype/wiki_page/search.py", line 9, in
What version of Frappe Framework are you using? If you're using v14 then this might be happening due to the conflict of redisearch with redis-py you can remove redis and install redisearch using pip and that will solve the dependency issue.
@BreadGenie frappe 15.x.x-develop
Then you should be using master
branch instead of version-14
.
Then you should be using
master
branch instead ofversion-14
.
So, what steps should I take in general? Or there is no way to install wiki with current frappe version and apps?
Currently v15.x.x
or develop
branch of Frappe Framework supports only Wiki master
branch.
And for v14.x.x
or version-14
branch of Frappe Framework supports only Wiki version-14
branch.
You can switch branch to master
in Wiki now.
Ok, it is functioning now without errors. But search, obviously, not. Can I expect the search to work in the near future on master? And it would be great if there was some kind of guide on versions. Anyway thanks for the help and quick response!
Search does work on master (take a look at https://frappeframework.com/docs/v14)
Can you try creating a temporary Wiki Space and see if search works? This can happen due to the index not being built properly.
No, creation of new wiki space didn't help. Tried clear-cache and to restart bench. Maybe I missing some packages or modules?
admin@testerp:~/frappe$ pip show redisearch Name: redisearch Version: 2.1.1 Summary: RedisSearch Python Client Home-page: Author: RedisLabs Author-email: oss@redislabs.com License: BSD-3-Clause Location: /usr/local/lib/python3.10/dist-packages Requires: hiredis, redis, rejson, six Required-by:
Maybe the reason for "No results found" now might be due to the existence of redisearch. redisearch package is deprecated and doesn't support from frappe v15 onwards (this is also why frappe version-14 branch doesn't support master branch of wiki).
What you can do is uninstall redisearch and redis packages through pip and then install redis-py (which will also install redis as it's dependency)
Uninstalled redisearch, redis. I only found redispy (not redis-py) package, installed. Installed redis again. Restart bench. Behaviour is the same - "no results found".
Oops, sorry redis-py was recently renamed to just redis.
Don't forget to uninstall redispy package meanwhile.
Done. No effect.
Can you try running bench --site <sitename> execute wiki.wiki.doctype.wiki_page.search.rebuild_index
? This will rebuild index manually
Can you try running
bench --site <sitename> execute wiki.wiki.doctype.wiki_page.search.rebuild_index
? This will rebuild index manually
Console showed next info: unknown command 'FT.CREATE', with args beginning with: '_d7ea0fa0c3240419|wiki/test' 'PREFIX' '1' '_d7ea0fa0c3240419|wiki_page_search_docwiki/test:' 'SCORE_FIELD' 'doc_score' 'SCORE' unknown command 'FT.CREATE', with args beginning with: '_d7ea0fa0c3240419|wiki' 'PREFIX' '1' '_d7ea0fa0c3240419|wiki_page_search_docwiki:' 'SCORE_FIELD' 'doc_score' 'SCORE' '0.5' 'SCHE'
On a quick glance it looks like you don't have redis installed in your system (https://redis.io/docs/stack/get-started/install/). If you do have it installed can you share the installed version?
I have two packages, Debian 12 : redis-server/testing 5:7.0.11-1 amd64 [upgradable from: 5:7.0.7-1] Persistent key-value database with network interface
redis-tools/testing 5:7.0.11-1 amd64 [upgradable from: 5:7.0.7-1] Persistent key-value database with network interface (client)
Package 'redis' not installed. So... maybe I need to install linux packages from apt not pip? There is redis/testing 5:7.0.11-1 package and python3-redis/testing 4.3.4-3 in repo.
You need both redis packages (python package is just a wrapper over the actual redis package afaik)
You need both redis packages (python package is just a wrapper over the actual redis package afaik)
Done. All the same.
What's the output of bench --site <sitename> execute wiki.wiki.doctype.wiki_page.search.rebuild_index
?
If it's nothing then it should work.
What's the output of
bench --site <sitename> execute wiki.wiki.doctype.wiki_page.search.rebuild_index
?If it's nothing then it should work.
I meant that error is persist and is same: unknown command 'FT.CREATE', with args beginning with: '_d7ea0fa0c3240419|wiki/test' 'PREFIX' '1' '_d7ea0fa0c3240419|wiki_page_search_docwiki/test:' 'SCORE_FIELD' 'doc_score' 'SCORE' unknown command 'FT.CREATE', with args beginning with: '_d7ea0fa0c3240419|wiki' 'PREFIX' '1' '_d7ea0fa0c3240419|wiki_page_search_docwiki:' 'SCORE_FIELD' 'doc_score' 'SCORE' '0.5' 'SCHE'
Can you try loading redisearch.so file similar to how it's specified at https://github.com/frappe/wiki/blob/c6738f58aed25f6123ecb2858c1044e4f369dfff/.github/helper/install.sh#L36-L39
Yes, now it works. My bench directory is /home/admin/frappe, so i specified in /home/admin/frappe/config/redis_cache.conf line loadmodule /home/admin/frappe/apps/wiki/.github/helper/redisearch.so
, because there is no GITHUB_WORKSPACE variable outside of install script. Now rebuild_index goes without errors and search working on wiki. But it seems, that search are unlocalized - searching only English words... But works now!
Can you create an issue for the other search issue (unlocalized search) with more info?
Can you create an issue for the other search issue (unlocalized search) with more info?
Hmm... Is it your issue? Not redis?
Not sure. You can create one so that I won't forget to take a look at it later.
Version 2.0.0 Local install on same site as ERPnext Search gives only "Not results found" In bench debugger there is '"POST / HTTP/1.1" 200' - request on search field typing. It should contain "/wiki" in URL, i think. Cannot find any settings for wiki search.