1. Jakub Wilk
  2. marasca-wbl
Issue #1 wontfix

copus path problem

Anonymous created an issue

hello,

after configuring and launching the marasca I was continually getting "Unable to open configuration file" error message when trying to execute any query. After a moment of debugging I've found, that the views.py quietly ignores the path configuration setting from Corpus class.

For some reasons I can't attach a patch as a file, so I paste it below:

--- views.py.old    2012-10-12 13:53:04.000000000 +0200
+++ views.py    2012-10-12 16:01:32.000000000 +0200
@@ -16,6 +16,7 @@
 import contextlib
 import sys
 import time
 +import os.path

 import django.conf
 import django.core.mail
@@ -140,7 +141,7 @@
     return info

 def run_query(connection, settings, corpus, query, l, r):
-    connection.open_corpus(corpus.id)
+    connection.open_corpus(os.path.join(corpus.path, corpus.id))
     try:
         connection.make_query(query, force=settings.need_query_remake())
     except poliqarp.InvalidQuery, ex:

Comments (2)

  1. Jakub Wilk repo owner

    Thanks for reporting the issue.

    The current behavior is intentional. The client assumes that poliqarpd is configured in such a way it's possible to open a corpus using an identifier (rather than full path). I would recommend such a setup anyway, both for performance reasons and as a security hardening measure.

    I can't apply your patch as-is, as it would break existing maraca installations. Perhaps we could make the behaviour conditional upon a configuration option, though.

  2. Log in to comment