openedx / openedx/edx-notes-api

errors with haystack running

Open
#32 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
16
Forks
63
Avg merge
22h 48m
Merged PRs (30d)
8

Description

Got this warning in LMS
'Sorry we could not search the store for annotations'

I checked the log and got this,

Dec 15 15:18:44 vultr [service_variant=edx-notes-api][django.request][env:no_env] ERROR [vultr 23056] [base.py:231] - Internal Server Error: /api/v1/search/
Traceback (most recent call last):
File "/edx/app/edx_notes_api/venvs/edx_notes_api/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 98, in get_response
resolver_match = resolver.resolve(request.path_info)
File "/edx/app/edx_notes_api/venvs/edx_notes_api/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 343, in resolve
for pattern in self.url_patterns:
File "/edx/app/edx_notes_api/venvs/edx_notes_api/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 372, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/edx/app/edx_notes_api/venvs/edx_notes_api/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 366, in urlconf_module
self._urlconf_module = import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/edx/app/edx_notes_api/edx_notes_api/notesserver/urls.py", line 8, in
url(r'^api/', include('notesapi.urls', namespace='api')),
File "/edx/app/edx_notes_api/venvs/edx_notes_api/local/lib/python2.7/site-packages/django/conf/urls/init.py", line 28, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/edx/app/edx_notes_api/edx_notes_api/notesapi/urls.py", line 5, in
url(r'^v1/', include('notesapi.v1.urls', namespace='v1')),
File "/edx/app/edx_notes_api/venvs/edx_notes_api/local/lib/python2.7/site-packages/django/conf/urls/init.py", line 28, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/edx/app/edx_notes_api/edx_notes_api/notesapi/v1/urls.py", line 2, in
from notesapi.v1.views import AnnotationListView, AnnotationDetailView, AnnotationSearchView
File "/edx/app/edx_notes_api/edx_notes_api/notesapi/v1/views.py", line 13, in
from haystack.query import SQ
File "/edx/app/edx_notes_api/venvs/edx_notes_api/local/lib/python2.7/site-packages/haystack/init.py", line 41, in
raise ImproperlyConfigured("The default alias '%s' must be included in the HAYSTACK_CONNECTIONS setting." % DEFAULT_ALIAS)
ImproperlyConfigured: The default alias 'default' must be included in the HAYSTACK_CONNECTIONS setting.

But the settings look alright...

edx_notes_api/notesserver/settings/common.py

HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'notesserver.highlight.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200/',
'INDEX_NAME': 'notes_index',
},
}

Any ideas?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with notesapi/v1/views.py and the /api/v1/search/ entry point, then inspect notesserver/settings/common.py and the HAYSTACK_CONNECTIONS configuration shown in the report. Reproduce the import or search request and trace why Haystack does not see the default alias. Done means the search endpoint loads without the ImproperlyConfigured error.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, elasticsearch, python
Domain
backend, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.