NatLibFi / Annif

Annif is a multi-algorithm automated subject indexing tool for libraries, archives and museums.
https://annif.org
Other
203 stars 41 forks source link

Initialization failure under mod_wsgi #148

Closed osma closed 6 years ago

osma commented 6 years ago

I get this error when running under mod_wsgi:

 Traceback (most recent call last):
   File "/var/www/Annif/annif.wsgi", line 6, in <module>
     application = create_app()
   File "/opt/Annif/annif/__init__.py", line 30, in create_app
     annif.project.initialize_projects(cxapp.app)
   File "/opt/Annif/annif/project.py", line 223, in initialize_projects
     projects_file, datadir, init_projects)
   File "/opt/Annif/annif/project.py", line 214, in _create_projects
     projects[project_id].initialize()
   File "/opt/Annif/annif/project.py", line 63, in initialize
     analyzer = self.analyzer
   File "/opt/Annif/annif/project.py", line 112, in analyzer
     self._analyzer = annif.analyzer.get_analyzer(self.analyzer_spec)
   File "/opt/Annif/annif/analyzer/__init__.py", line 15, in get_analyzer
     match = re.match(r'(\\w+)(\\((.*)\\))?', analyzerspec)
   File "/usr/lib/python3.5/re.py", line 163, in match
     return _compile(pattern, flags).match(string)
 TypeError: expected string or bytes-like object
osma commented 6 years ago

Probably because there's a project that doesn't define an analyzer.