xelkano / redmine_xapian

This plugin allows searches across attachments with xapian search engine
GNU General Public License v2.0
54 stars 26 forks source link

Can't open Xapian database on redmine 4.1.1 #106

Closed snowfrs closed 4 years ago

snowfrs commented 4 years ago

Environment

OS: Ubuntu 20.04.1 LTS Linux redmine 5.4.0-48-generic 52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Redmine Environment: Redmine version 4.1.1.stable Ruby version 2.6.6-p146 (2020-03-31) [x86_64-linux] Rails version 5.2.4.2 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp SCM: Subversion 1.13.0 Git 2.25.1 Filesystem
Redmine plugins: redmine_dmsf 2.4.4 redmine_xapian 2.0.2

Ruby installed by rbenv. Xapian-core-1.4.17 Xapian-bindings-1.4.17 and Xapian-omega-1.4.17 compiled from source to binding to ruby which controlled by rbenv.

redmine_xapian plugin settings: Enable xapian engine to allow searches on [checked] Enable generation of n-grams from CJK [checked]

XAPIAN_CJK_NGRAM=true ruby plugins/redmine_xapian/extra/xapian_indexer.rb -fxv

This command seems normal and no error reported.

When I search on redmine, the $redmine/log/production.log shows

Current user: admin (id=1) Can't open Xapian database /opt/redmine-4.1.1/file_index/repodb - #<IOError: DatabaseOpeningError: Couldn't stat '/opt/redmine-4.1.1/file_index/repodb' (No such file or directory)> Rendering plugins/redmine_xapian/app/views/search/index.html.erb within layouts/base Rendered plugins/redmine_dmsf/app/views/search/_container.html.erb (0.6ms) Rendered plugins/redmine_xapian/app/views/search/index.html.erb within layouts/base (7.5ms) Completed 200 OK in 59ms (Views: 19.7ms | ActiveRecord: 9.3ms)

ls -ld $redmine/file_index/* 

output:

rwxrwxr-x 2 adminuser adminuser 4096 Sep 22 14:36 /opt/redmine-4.1.1/file_index/english Indeed no repodb.

Questions:

  1. how to resolve the repodb issue?
  2. I install redmine_dmsf and redmine_xapian, it seems I need to set crontab for them separately. Right?
picman commented 4 years ago
snowfrs commented 4 years ago

OK. Thanks!

This notice means there is no repositories on my redmine instance ? Can't open Xapian database /opt/redmine-4.1.1/file_index/repodb - #<IOError: DatabaseOpeningError: Couldn't detect type of database>

Thanks for your explain.

picman commented 4 years ago

Yes, if you have no repositories, or the repositories don't contain index-able files, just empty repodb folder is created but without any database. Correctly created database should looks like follows.

$ ls file_index/repodb/
docdata.glass  flintlock  iamglass  position.glass  postlist.glass  termlist.glass