1. Marcin Kuzminski
  2. RhodeCode
  3. Issues


Issue #386 invalid

Cannot create search-index for repositories in a group

Anonymous created an issue

I cannot create a search-index for my repositories that are in a group. I do have a clone of the rhodecode repository on the top level, so when i call

{{{ paster make-index production.ini }}}

it only works for this repository, but not for all other repositories in some group. And when i call something like this

{{{ paster make-index production.ini --index-only=vcs,groupname/reponame }}}

then i get the following error.

{{{ 2012-03-03 22:33:39,996 - whooshIndexer - DEBUG - STARTING INCREMENTAL INDEXING UPDATE Traceback (most recent call last): File "/opt/projects/rhodecode/rcenv/bin/paster", line 9, in <module> load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')() File "/opt/projects/rhodecode/rcenv/local/lib/python2.7/site-packages/paste/script/command.py", line 104, in run invoke(command, command_name, options, args[1:]) File "/opt/projects/rhodecode/rcenv/local/lib/python2.7/site-packages/paste/script/command.py", line 143, in invoke exit_code = runner.run(args) File "/opt/projects/rhodecode/rcenv/local/lib/python2.7/site-packages/rhodecode/lib/utils.py", line 597, in run return super(BasePasterCommand, self).run(args[1:]) File "/opt/projects/rhodecode/rcenv/local/lib/python2.7/site-packages/paste/script/command.py", line 238, in run result = self.command() File "/opt/projects/rhodecode/rcenv/local/lib/python2.7/site-packages/rhodecode/lib/indexers/init.py", line 109, in command .run(full_index=self.options.full_index) File "/opt/projects/rhodecode/rcenv/local/lib/python2.7/site-packages/rhodecode/lib/indexers/daemon.py", line 235, in run self.update_index() File "/opt/projects/rhodecode/rcenv/local/lib/python2.7/site-packages/rhodecode/lib/indexers/daemon.py", line 195, in update_index repo = self.repo_paths[fields['repository']] KeyError: u'RhodeCode' }}}

Comments (7)

  1. Marcin Kuzminski repo owner

    In 1.3.3 there was whoosh library change to latest version, try out using -f to force rebuild the index.

    paster make-index production.ini -f --index-only=vcs,groupname/reponame

  2. Anonymous

    When i enter paster make-index production.ini -f --index-only=vcs,toplevelrepo then the index is rebuilt (as expected).

    When i try to rebuild the index for a repository in a group or a repository that doesn't even exist, then i get this

    2012-03-04 18:45:39,439 - whooshIndexer - DEBUG - removing previous index
    2012-03-04 18:45:39,506 - whooshIndexer - DEBUG - >> COMMITING CHANGES <<
    2012-03-04 18:45:39,511 - whooshIndexer - DEBUG - >>> FINISHED BUILDING INDEX <<<
  3. Anonymous

    I tried reinstalling rhodecode in a test environment and it seemed to work there at first. I thought it was maybe some kind of update error, so i went to the production server and installed a new environment. And it didn't work again. The paths on the test and the production server were different and i also used symbolic links that point to the rhodecode installation (which i didn't have on the test server), so i installed again in a simple directory. That didn't help either. But then i figured it out, i guess. The problem was not the path to the rhodecode installation, but to the mercurial repositories. On the test server i had the repository directory on the same level as the file production.ini


    On the production server i had the repositories in a different place


    I copied the repositories into rcode_dir and then it suddenly worked. If i remove them again and set the old repository path, then i can rebuild the index only for the top-level repository (by calling paster make-index production.ini).

    As additional info, if i click on the Reindex button in the Admin>>Settings page, then i get this error in the celery log

    [2012-03-07 01:11:34,821: INFO/MainProcess] Got task from broker: rhodecode.lib.celerylib.tasks.whoosh_index[...]
    [2012-03-07 01:11:34,827: DEBUG/MainProcess] Mediator: Running callback for task: rhodecode.lib.celerylib.tasks.whoosh_index[...]
    [2012-03-07 01:11:34,829: DEBUG/MainProcess] TaskPool: Apply <function execute_and_trace at 0x30ea1b8> (args:('rhodecode.lib.celerylib.tasks.whoosh_index', '...', (u'/.../repos/hg', False), {}) kwargs:{'hostname': '...', 'request': {'retries': 0, 'loglevel': 10, 'delivery_info': {'consumer_tag': u'2', 'routing_key': u'celery', 'exchange': u'celery'}, 'is_eager': False, 'taskset': None, 'logfile': '/.../rhodecode/log/celery.log', 'id': '...'}})
    [2012-03-07 01:11:34,831: DEBUG/MainProcess] Task accepted: rhodecode.lib.celerylib.tasks.whoosh_index[...] pid:21998
    [2012-03-07 01:11:34,832: INFO/PoolWorker-3] running task with lockkey task_....lock
    [2012-03-07 01:11:34,889: ERROR/MainProcess] Task rhodecode.lib.celerylib.tasks.whoosh_index[...] raised exception: TypeError('Level not an integer or a valid string: <@task: rhodecode.lib.celerylib.tasks.whoosh_index>',)
    Traceback (most recent call last):
      File "/.../rhodecode/rcenv/local/lib/python2.7/site-packages/celery/execute/trace.py", line 34, in trace
        return cls(states.SUCCESS, retval=fun(*args, **kwargs))
      File "/.../rhodecode/rcenv/local/lib/python2.7/site-packages/celery/task/base.py", line 241, in __call__
        return self.run(*args, **kwargs)
      File "/.../rhodecode/rcenv/local/lib/python2.7/site-packages/celery/app/__init__.py", line 141, in run
        return fun(*args, **kwargs)
      File "<string>", line 2, in whoosh_index
      File "/.../rhodecode/rcenv/local/lib/python2.7/site-packages/rhodecode/lib/celerylib/__init__.py", line 101, in __wrapper
        ret = func(*fargs, **fkwargs)
      File "<string>", line 2, in whoosh_index
      File "/.../rhodecode/rcenv/local/lib/python2.7/site-packages/rhodecode/lib/celerylib/__init__.py", line 122, in __wrapper
        ret = func(*fargs, **fkwargs)
      File "/.../rhodecode/rcenv/local/lib/python2.7/site-packages/rhodecode/lib/celerylib/tasks.py", line 77, in whoosh_index
        log = whoosh_index.get_logger(whoosh_index)
      File "/.../rhodecode/rcenv/local/lib/python2.7/site-packages/celery/task/base.py", line 262, in get_logger
      File "/.../rhodecode/rcenv/local/lib/python2.7/site-packages/celery/log.py", line 190, in setup_task_logger
        logger = self._setup_logger(self.get_task_logger(loglevel, task_name),
      File "/.../rhodecode/rcenv/local/lib/python2.7/site-packages/celery/log.py", line 91, in get_task_logger
      File "/usr/lib/python2.7/logging/__init__.py", line 1108, in setLevel
        self.level = _checkLevel(level)
      File "/usr/lib/python2.7/logging/__init__.py", line 190, in _checkLevel
        raise TypeError("Level not an integer or a valid string: %r" % level)
    TypeError: Level not an integer or a valid string: <@task: rhodecode.lib.celerylib.tasks.whoosh_index>
  4. Anonymous

    For what it's worth, i think i finally figured out what the problem was. I kept getting these "untrusted user 'root'" messages from mercurial, which was because i didn't specify the user in the init scripts for rhodecode. Now i did it and i also changed the ownership of the repository files to the same user. Since then the indexer works for all repositories.

  5. Log in to comment