Error with forum

I tried to enable to forum this morning after upgrading to version 3.12.16.

I received the following error in the LMS logs:

lms_1             | 2020-06-09 10:48:56,958 ERROR 11 [edx.courseware] views.py:592 - Error in /courses/course-v1:UofW+CS115+2019_09/discussion/forum/: user=XXXXXX, effective_user=XXXXX, course=course-v1:UW+CS115+2019_09
lms_1             | Traceback (most recent call last):
lms_1             |   File "/openedx/edx-platform/lms/djangoapps/courseware/views/views.py", line 521, in get
lms_1             |     return super(CourseTabView, self).get(request, course=course, page_context=page_context, **kwargs)
lms_1             |   File "/openedx/venv/local/lib/python2.7/site-packages/web_fragments/views.py", line 26, in get
lms_1             |     fragment = self.render_to_fragment(request, **kwargs)
lms_1             |   File "/openedx/edx-platform/lms/djangoapps/courseware/views/views.py", line 656, in render_to_fragment
lms_1             |     return tab.render_to_fragment(request, course, **kwargs)
lms_1             |   File "/openedx/edx-platform/common/lib/xmodule/xmodule/tabs.py", line 294, in render_to_fragment
lms_1             |     return self.fragment_view.render_to_fragment(request, course_id=unicode(course.id), **kwargs)
lms_1             |   File "/openedx/edx-platform/lms/djangoapps/discussion/views.py", line 704, in render_to_fragment
lms_1             |     base_context = _create_base_discussion_view_context(request, course_key)
lms_1             |   File "/openedx/edx-platform/lms/djangoapps/discussion/views.py", line 405, in _create_base_discussion_view_context
lms_1             |     user_info = cc_user.to_dict()
lms_1             |   File "/openedx/edx-platform/lms/lib/comment_client/models.py", line 59, in to_dict
lms_1             |     self.retrieve()
lms_1             |   File "/openedx/edx-platform/lms/lib/comment_client/models.py", line 64, in retrieve
lms_1             |     self._retrieve(*args, **kwargs)
lms_1             |   File "/openedx/edx-platform/lms/lib/comment_client/user.py", line 152, in _retrieve
lms_1             |     metric_tags=self._metric_tags,
lms_1             |   File "/openedx/edx-platform/lms/lib/comment_client/utils.py", line 70, in perform_request
lms_1             |     timeout=config.connection_timeout
lms_1             |   File "/openedx/venv/local/lib/python2.7/site-packages/requests/api.py", line 60, in request
lms_1             |     return session.request(method=method, url=url, **kwargs)
lms_1             |   File "/openedx/venv/local/lib/python2.7/site-packages/requests/sessions.py", line 533, in request
lms_1             |     resp = self.send(prep, **send_kwargs)
lms_1             |   File "/openedx/venv/local/lib/python2.7/site-packages/requests/sessions.py", line 646, in send
lms_1             |     r = adapter.send(request, **kwargs)
lms_1             |   File "/openedx/venv/local/lib/python2.7/site-packages/requests/adapters.py", line 516, in send
lms_1             |     raise ConnectionError(e, request=request)
lms_1             | ConnectionError: HTTPConnectionPool(host='forum', port=4567): Max retries exceeded with url: /api/v1/users/3?complete=True&request_id=bcfbb462-24d1-4889-924d-ca6520470405 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7ce7623d90>: Failed to establish a new connection: [Errno -2] Name or service not known',))

I checked the logs from elasticsearch:

ttaching to tutor_local_elasticsearch_1
elasticsearch_1   | [2020-06-09 10:46:52,971][INFO ][node                     ] [Radion the Atomic Man] version[1.5.2], pid[1], build[62ff986/2015-04-27T09:21:06Z]
elasticsearch_1   | [2020-06-09 10:46:52,986][INFO ][node                     ] [Radion the Atomic Man] initializing ...
elasticsearch_1   | [2020-06-09 10:46:53,003][INFO ][plugins                  ] [Radion the Atomic Man] loaded [], sites []
elasticsearch_1   | [2020-06-09 10:46:59,091][INFO ][node                     ] [Radion the Atomic Man] initialized
elasticsearch_1   | [2020-06-09 10:46:59,129][INFO ][node                     ] [Radion the Atomic Man] starting ...
elasticsearch_1   | [2020-06-09 10:46:59,814][INFO ][transport                ] [Radion the Atomic Man] bound_address {inet[/0.0.0.0:9300]}, publish_address {inet[/192.168.0.4:9300]}
elasticsearch_1   | [2020-06-09 10:47:00,003][INFO ][discovery                ] [Radion the Atomic Man] openedx/AAtrkd9OQTuBQcRAO0hB4w
elasticsearch_1   | [2020-06-09 10:47:04,032][INFO ][cluster.service          ] [Radion the Atomic Man] new_master [Radion the Atomic Man][AAtrkd9OQTuBQcRAO0hB4w][8587f0deb762][inet[/192.168.0.4:9300]], reason: zen-disco-join (elected_as_master)
elasticsearch_1   | [2020-06-09 10:47:04,142][INFO ][http                     ] [Radion the Atomic Man] bound_address {inet[/0.0.0.0:9200]}, publish_address {inet[/192.168.0.4:9200]}
elasticsearch_1   | [2020-06-09 10:47:04,143][INFO ][node                     ] [Radion the Atomic Man] started
elasticsearch_1   | [2020-06-09 10:47:04,150][INFO ][gateway                  ] [Radion the Atomic Man] recovered [0] indices into cluster_state

And finally found an error in the forum logs:
forum_1 | Waiting for mongodb/elasticsearch…
forum_1 | 2020/06/09 10:52:24 Waiting for: tcp://mongodb:27017
forum_1 | 2020/06/09 10:52:24 Waiting for: http://elasticsearch:9200
forum_1 | 2020/06/09 10:52:24 Connected to tcp://mongodb:27017
forum_1 | 2020/06/09 10:52:24 Received 200 from http://elasticsearch:9200
forum_1 | /openedx/cs_comments_service/vendor/bundle/ruby/2.4.0/gems/elasticsearch-transport-1.1.2/lib/elasticsearch/transport/transport/base.rb:52: warning: constant ::Fixnum is deprecated
forum_1 | /openedx/cs_comments_service/vendor/bundle/ruby/2.4.0/gems/elasticsearch-transport-1.1.2/lib/elasticsearch/transport/transport/base.rb:54: warning: constant ::Fixnum is deprecated
forum_1 | W, [2020-06-09T10:52:26.432944 #16] WARN – : Overwriting existing field _id in class User.
forum_1 | W, [2020-06-09T10:52:26.471272 #16] WARN – : MONGODB | Unsupported client option ‘max_retries’. It will be ignored.
forum_1 | W, [2020-06-09T10:52:26.471399 #16] WARN – : MONGODB | Unsupported client option ‘retry_interval’. It will be ignored.
forum_1 | W, [2020-06-09T10:52:26.471486 #16] WARN – : MONGODB | Unsupported client option ‘timeout’. It will be ignored.
forum_1 | ERROR: ElasticSearch configuration validation failed. “rake search:validate_index” failed with the following message: Alias ‘content’ does not exist.

I tried running tutor local init after reading the post here Forum not working but it did not help.

Any thoufhts?

Did the tutor local init command succeed?

It did. I stopped everything, rebuilt the images and ran tutor local start --detach.

I confirmed that forum and elasticsearch containers were running.

I reran tutor local init again and received:

Initialising forum...
docker-compose -f /root/.local/share/tutor/env/local/docker-compose.yml --project-name tutor_local -f /root/.local/share/tutor/env/local/docker-compose.jobs.yml run --rm forum-job sh -e -c export MONGOHQ_URL="mongodb://$MONGODB_AUTH$MONGODB_HOST:$MONGODB_PORT/cs_comments_service"

bundle exec rake search:initialize
bundle exec rake search:rebuild_index
Waiting for mongodb/elasticsearch...
2020/06/09 12:05:48 Waiting for: tcp://mongodb:27017
2020/06/09 12:05:48 Waiting for: http://elasticsearch:9200
2020/06/09 12:05:48 Connected to tcp://mongodb:27017
2020/06/09 12:05:48 Received 200 from http://elasticsearch:9200
/openedx/cs_comments_service/lib/tasks/deep_search.rake:7: warning: already initialized constant ROOT
/openedx/cs_comments_service/lib/tasks/flags.rake:6: warning: previous definition of ROOT was here
/openedx/cs_comments_service/lib/tasks/kpis.rake:7: warning: already initialized constant ROOT
/openedx/cs_comments_service/lib/tasks/deep_search.rake:7: warning: previous definition of ROOT was here
/openedx/cs_comments_service/vendor/bundle/ruby/2.4.0/gems/elasticsearch-transport-1.1.2/lib/elasticsearch/transport/transport/base.rb:52: warning: constant ::Fixnum is deprecated
/openedx/cs_comments_service/vendor/bundle/ruby/2.4.0/gems/elasticsearch-transport-1.1.2/lib/elasticsearch/transport/transport/base.rb:54: warning: constant ::Fixnum is deprecated
/openedx/cs_comments_service/models/constants.rb:2: warning: already initialized constant COURSE_ID
/openedx/cs_comments_service/lib/tasks/db.rake:28: warning: previous definition of COURSE_ID was here
W, [2020-06-09T12:05:51.059639 #15]  WARN -- : Overwriting existing field _id in class User.
W, [2020-06-09T12:05:51.102145 #15]  WARN -- : MONGODB | Unsupported client option 'max_retries'. It will be ignored.
W, [2020-06-09T12:05:51.102209 #15]  WARN -- : MONGODB | Unsupported client option 'retry_interval'. It will be ignored.
W, [2020-06-09T12:05:51.102245 #15]  WARN -- : MONGODB | Unsupported client option 'timeout'. It will be ignored.
I, [2020-06-09T12:05:51.328720 #15]  INFO -- : Added mappings to index: content_20200609120551114.
I, [2020-06-09T12:05:51.328860 #15]  INFO -- : Created new index: content_20200609120551114.
I, [2020-06-09T12:05:51.378268 #15]  INFO -- : Alias [content] now points to index [content_20200609120551114].
/openedx/cs_comments_service/lib/tasks/deep_search.rake:7: warning: already initialized constant ROOT
/openedx/cs_comments_service/lib/tasks/flags.rake:6: warning: previous definition of ROOT was here
/openedx/cs_comments_service/lib/tasks/kpis.rake:7: warning: already initialized constant ROOT
/openedx/cs_comments_service/lib/tasks/deep_search.rake:7: warning: previous definition of ROOT was here
/openedx/cs_comments_service/vendor/bundle/ruby/2.4.0/gems/elasticsearch-transport-1.1.2/lib/elasticsearch/transport/transport/base.rb:52: warning: constant ::Fixnum is deprecated
/openedx/cs_comments_service/vendor/bundle/ruby/2.4.0/gems/elasticsearch-transport-1.1.2/lib/elasticsearch/transport/transport/base.rb:54: warning: constant ::Fixnum is deprecated
/openedx/cs_comments_service/models/constants.rb:2: warning: already initialized constant COURSE_ID
/openedx/cs_comments_service/lib/tasks/db.rake:28: warning: previous definition of COURSE_ID was here
W, [2020-06-09T12:05:53.792529 #30]  WARN -- : Overwriting existing field _id in class User.
W, [2020-06-09T12:05:53.839986 #30]  WARN -- : MONGODB | Unsupported client option 'max_retries'. It will be ignored.
W, [2020-06-09T12:05:53.840132 #30]  WARN -- : MONGODB | Unsupported client option 'retry_interval'. It will be ignored.
W, [2020-06-09T12:05:53.840204 #30]  WARN -- : MONGODB | Unsupported client option 'timeout'. It will be ignored.
I, [2020-06-09T12:05:54.022686 #30]  INFO -- : Added mappings to index: content_20200609120553846.
I, [2020-06-09T12:05:54.022806 #30]  INFO -- : Created new index: content_20200609120553846.
I, [2020-06-09T12:05:54.040259 #30]  INFO -- : Catch up from 2020-06-09 12:00:53 UTC complete.
I, [2020-06-09T12:05:54.071188 #30]  INFO -- : Alias [content] now points to index [content_20200609120553846].
I, [2020-06-09T12:05:54.079402 #30]  INFO -- : Catch up from 2020-06-09 12:00:54 UTC complete.
I, [2020-06-09T12:05:54.079480 #30]  INFO -- : Rebuild index complete.
All services initialised.

I’m still receiving the same error message.

I’ve stopped everything again, rebuilt the images and started everything. It is now working properly. I’m not sure what would have changed.

1 Like