Error with the Forum, comments service

Keywords: OpenEdX - Google Cloud Platform - Technical issue - Other
bnsupport ID: de7e751d-0337-2586-9d01-d55c77d1a329
Description:
I've got two errors:
1. Downloading translation services for the Forum:
cd /opt/bitnami/apps/forum/cs_comments_service
When I run sudo bundle install --with test (couldn't do run it without sudo because of file permissions) I get the following error

Fetching gem metadata from https://rubygems.org/.........
git: '/opt/bitnami/apps/forum/cs_comments_service/vendor/bundle/ruby/2.4.0/cache/bundler/git/mongoid-tree-782d1c594c580403d2c9520bbc2ed36dded0ca6a' is not a git command. See 'git --help'.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Retrying git fetch --force --quiet --tags "/opt/bitnami/apps/forum/cs_comments_service/vendor/bundle/ruby/2.4.0/cache/bundler/git/mongoid-tree-782d1c594c580403d2c9520bbc2ed36dded0ca6a" due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command git fetch --force --quiet --tags "/opt/bitnami/apps/forum/cs_comments_service/vendor/bundle/ruby/2.4.0/cache/bundler/git/mongoid-tree-782d1c594c580403d2c9520bbc2ed36dded0ca6a" in directory /opt/bitnami/apps/forum/cs_comments_service/vendor/bundle/ruby/2.4.0/bundler/gems/mongoid-tree-b381dd56f1b3 has failed.
If this error persists you could try removing the cache directory '/opt/bitnami/apps/forum/cs_comments_service/vendor/bundle/ruby/2.4.0/cache/bundler/git/mongoid-tree-782d1c594c580403d2c9520bbc2ed36dded0ca6a'
git: '/opt/bitnami/apps/forum/cs_comments_service/vendor/bundle/ruby/2.4.0/cache/bundler/git/mongoid-tree-782d1c594c580403d2c9520bbc2ed36dded0ca6a' is not a git command. See 'git --help'.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

2.- When I try to open the Discussion Forum in Open Edx I get:
It looks like Bundler could not find a gem. Maybe you didn't install all the gems that this application needs. To install your gems, please run bundle install

When I try to run bundle install

I ran the bitnami support tool and the number is: de7e751d-0337-2586-9d01-d55c77d1a329

Thank you

Hi @dpacheco,

We highly recommend you doing a server backup before doing any other modification so you can restore back your current state in case something fails

https://docs.bitnami.com/google/faq/administration/backup-restore-server/

Thanks for using Bitnami. I've just launched a fresh new Open edX server on Google Cloud and the Forum feature is configured and enabled by default. I created a new course and then visited the Discussion section. As you can see in the image below, I was able to create a new post without any issue.

In your error message, it gives you some advice

If this error persists you could try removing the cache directory '/opt/bitnami/apps/forum/cs_comments_service/vendor/bundle/ruby/2.4.0/cache/bundler/git/mongoid-tree-782d1c594c580403d2c9520bbc2ed36dded0ca6a'

Could you try to remove the mentioned directory and then run the bundle install command again?

sudo rm -rf /opt/bitnami/apps/forum/cs_comments_service/vendor/bundle/ruby/2.4.0/cache/bundler/git/mongoid-tree-782d1c594c580403d2c9520bbc2ed36dded0ca6a

Apart from that, I'm having some issues trying to retrieve translations from transifex. Do you have any guide we can use so we can try to reproduce your issue?

Best regards,
Gonzalo

Hi Gonzalo,
Thank you for your quick replied. I tried removed the cache with no luck: same problem.

So I started from the beginning and reproduced the same error. I started with a new image. I checked the discussion forum worked, enabled debugging and went to Modify the interface language (that's where the problem lies).

I follow all the instructions for modifying the interface language modifying the language code and making sure the language code in /opt/bitnami/apps/edx/edx-platform/lms/envs/common.py is "es-419" while in the jsons files is "es_419".

When I download the translation by sudo /opt/bitnami/apps/edx/bin/paver.edxapp i18n_robot_pull
apparently it asks me for an token, unaware that I haved already created the transifex file before. I trype tx init, re open the file ~/.transifexrc and resaved it with sudo.

I tried again sudo /opt/bitnami/apps/edx/bin/paver.edxapp i18n_robot_pull and I get the following error

The text output is:
Traceback (most recent call last):
File "manage.py", line 118, in
startup.run()
File "/opt/bitnami/apps/edx/edx-platform/lms/startup.py", line 19, in run
django.setup()
File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/apps/config.py", line 94, in create
module = import_module(entry)
File "/opt/bitnami/python/lib/python2.7/importlib/__init__.py", line 37, in import_module
import(name)
ImportError: No module named debug_toolbar
Captured Task Output:


---> pavelib.i18n.i18n_robot_pull
---> pavelib.i18n.i18n_clean
git clean -fdX conf/locale
---> pavelib.i18n.i18n_transifex_pull
---> pavelib.i18n.i18n_validate_transifex_config
i18n_tool transifex pull
---> pavelib.i18n.i18n_extract
---> pavelib.prereqs.install_prereqs
---> pavelib.i18n.i18n_validate_gettext
i18n_tool extract
---> pavelib.i18n.i18n_dummy
i18n_tool dummy
i18n_tool generate
python manage.py lms --settings=devstack compilejsi18n

After I restarted apache I checked the Discussion forum and it still worked.
Finally, I tried to do
cd /opt/bitnami/apps/forum/cs_comments_service
bundle install --with test
failing with the same error as the first post. I restarted apache and checked the Discussion forums and now it's not appearing due to technical problems.

I ran the support tool. The number is e818e9aa-d3ca-ccf1-7f9b-08db0a40abb2

Hi @dpacheco,

Thanks for such detailed information. I was able to reproduce your issue and I have reported it to our Engineering Team for them to further investigate it. They will contact you again when they have any news.

Sorry for the inconvenience it may cause you.

Best regards,
Gonzalo

Hi @dpacheco, unfortunately there is a bug in how Open edX downloads translations. We need to report this issue to edX as it seems https://openedx.atlassian.net/browse/CRI-129 was closed and they're not aware of the latest comments.

You are using edX Hawthorn.2. In this release, we were able to identify a fix for the issue, please see this thread for more info: https://community.bitnami.com/t/paver-i18n-robot-pull-command-doesnt-work/64029/6?u=marcos

Note: In Ironwood releases a similar issue occurs but we have not identified a fix yet, as it seems the language files are not valid for msgfmt. In fact, the it seems to be an upstream issue:

$ msgfmt -c /opt/bitnami/apps/edx/edx-platform/conf/locale/ru/LC_MESSAGES/django-partial.po
/opt/bitnami/apps/edx/edx-platform/conf/locale/ru/LC_MESSAGES/django-partial.po:6509: 'msgstr' is not a valid Python brace format string, unlike 'msgid'. Reason: In the directive number 0, there is an unterminated format directive.
/opt/bitnami/apps/edx/edx-platform/conf/locale/ru/LC_MESSAGES/django-partial.po:9617: 'msgstr' is not a valid Python brace format string, unlike 'msgid'. Reason: In the directive number 0, '�' cannot start a field name.
/opt/bitnami/apps/edx/edx-platform/conf/locale/ru/LC_MESSAGES/django-partial.po:12431: 'msgstr' is not a valid Python brace format string, unlike 'msgid'. Reason: In the directive number 0, '�' cannot start a field name.
msgfmt: found 3 fatal errors

Hi Marcos,
I followed the instructions and it's not appearing that problem anymore. Thank you.
There's a new issue now.

The stacktrace is this:

i18n_tool generate --strict
INFO:i18n.generate:Merging djangojs.po locale es_419
Traceback (most recent call last):
  File "/opt/bitnami/apps/edx/venvs/edxapp/bin/i18n_tool", line 11, in <module>
    sys.exit(main())
  File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/i18n/main                                                                                        .py", line 60, in main
    return module.main()
  File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/i18n/__in                                                                                        it__.py", line 51, in __call__
    return self.run(args)
  File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/i18n/gene                                                                                        rate.py", line 176, in run
    merge_files(configuration, locale, fail_if_missing=args.strict)
  File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/i18n/gene                                                                                        rate.py", line 80, in merge_files
    merge(configuration, locale, target, sources, fail_if_missing)
  File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/i18n/gene                                                                                        rate.py", line 47, in merge
    validate_files(locale_directory, sources)
  File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/i18n/gene                                                                                        rate.py", line 148, in validate_files
    raise Exception("I18N: Cannot generate because file not found: {0}".format(p                                                                                        athname))
Exception: I18N: Cannot generate because file not found: /opt/bitnami/apps/edx/e                                                                                        dx-platform/conf/locale/es_419/LC_MESSAGES/djangojs-partial.po

Apparently a file not found for translations. Any ideas?
Thanks,

Diana

Hi @dpacheco, if you see the thread I linked, you will see a post where I describe how to fix that issue: https://community.bitnami.com/t/paver-i18n-robot-pull-command-doesnt-work/64029/10?u=marcos

Hope it works!

Hi Marcos,
I tried it. No more errors with the missing local file.
There's a new error. Probably similar to this post https://community.bitnami.com/t/openedx-translations-install-downloads-but-fails-to-compile/66363/3 but I'm not sure how he fixed it.

The stacktrace is this:

INFO:i18n.generate:Merging django.po locale en
INFO:i18n.execute:Executing in /opt/bitnami/apps/edx/edx-platform/conf/locale/en/LC_MESSAGES ...
INFO:i18n.execute:msgcat -o merged.po django-partial.po django-studio.po mako.po mako-studio.po wiki.po
INFO:i18n.execute:Executing in . ...
INFO:i18n.execute:django-admin.py compilemessages -v0
INFO:i18n.generate:Copying mapped locale /opt/bitnami/apps/edx/edx-platform/conf/locale/zh_CN/LC_MESSAGES to /opt/bitnami/apps/edx/edx-platform/conf/locale/zh_HANS/LC_MESSAGES
python manage.py lms --settings=devstack compilejsi18n
Traceback (most recent call last):
  File "manage.py", line 118, in <module>
    startup.run()
  File "/opt/bitnami/apps/edx/edx-platform/lms/startup.py", line 19, in run
    django.setup()
  File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/apps/config.py", line 94, in create
    module = import_module(entry)
  File "/opt/bitnami/python/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named debug_toolbar

Thanks,

Diana

Hi @dpacheco, unfortunately we could not reproduce that issue. From your error, it seems the edx-ora2 module was not loaded or installed properly. Could you run the commands below again and let us know if it worked?

  • Load the environment:

    sudo /opt/bitnami/use_edx
    . /opt/bitnami/apps/edx/conf/edxapp_env
  • Install the proper version of edx-ora2 (IMPORTANT: do not run "sudo pip install", but "pip install"):

    pip install git+https://github.com/edx/edx-ora2.git@2.1.18#egg=ora2==2.1.18
  • Update /opt/bitnami/apps/edx/edx-platform/pavelib/i18n.py and change:

    "pavelib.i18n.i18n_generate_strict",

    To:

    "pavelib.i18n.i18n_generate",
  • And download translations:

    sudo /opt/bitnami/apps/edx/bin/paver.edxapp i18n_robot_pull

Hi Marcos,
I loaded again a new open edx bitnami instance and followed your steps.

Before, I ran the following commands:

sudo apt-get update
Had to do sudo pip install transifex-client because of permissions errors

Uncommented the languages in /opt/bitnami/apps/edx/edx-platform/conf/locale/config.yaml (I left only en and es_419 uncommented)

Set the value of the LANGUAGE_CODE in
/opt/bitnami/apps/edx/conf/cms.env.json to es_419
/opt/bitnami/apps/edx/conf/lms.env.json es_419
/opt/bitnami/apps/edx/edx-platform/lms/envs/common.py to es-419

Loaded the environment:

sudo /opt/bitnami/use_edx
. /opt/bitnami/apps/edx/conf/edxapp_env

pip install git+https://github.com/edx/edx-ora2.git@2.1.18#egg=ora2==2.1.18

Updated pavelib.i18n.i18n_generate

Had to create a ~/transifexrc file inside the loaded environment so it would read the credentials

Downloaded translations with sudo /opt/bitnami/apps/edx/bin/paver.edxapp i18n_robot_pull
And same error :frowning2:

Traceback (most recent call last):
  File "manage.py", line 120, in <module>
    startup.run()
  File "/opt/bitnami/apps/edx/edx-platform/lms/startup.py", line 19, in run
    django.setup()
  File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/__                                                                                        init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/ap                                                                                        ps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/ap                                                                                        ps/config.py", line 94, in create
    module = import_module(entry)
  File "/opt/bitnami/python/lib/python2.7/importlib/__init__.py", line 37, in im                                                                                        port_module
    __import__(name)
ImportError: No module named debug_toolbar

Bitnami support ticket: 5881c30b-17af-444e-c2d9-eb4accf0adb8

Some good news.:relaxed:

I solved the no module name debug_toolbar error by installing the debug_toolbar with these commands
pip install django-debug-toolbar
pip install django-debug-toolbar-mongo
inside the loaded environment (sudo /opt/bitnami/use_edx . /opt/bitnami/apps/edx/conf/edxapp_env)
After that, I downloaded the translations without errors.:slight_smile:

I had to also configure git username and email.

Forum
Now, when I tried to download the translations for the forum (outside of the loaded environment), following the guidelines, when I ran cd /opt/bitnami/apps/forum/cs_comments_service
bundle install --with test

It failed with permission errors
There was an error while trying to write to
/opt/bitnami/apps/forum/cs_comments_service/.bundle/config. It is likely that
you need to grant write permissions for that path.

I checked the forum and I wonder if I ever need to fix the prior error because apparently it's already translated (as seen in the attached image).

1 Like

Hi @dpacheco, that's great to hear!

As for the forum translations, it seems the instructions on Bitnami Docs are wrong. Try this instead:

  • Load the Bitnami console:

    sudo /opt/bitnami/use_edx
  • Download forum translations as documented in Bitnami Docs:

    cd /opt/bitnami/apps/forum/cs_comments_service
    bundle install --with test
    bundle exec bin/rake i18n:pull

Since the edX forum service is mostly a backend service, users may not notice it as the main translations are placed on the edx-platform project. However, in case of errors, warnings, etc., they may see errors in the other language as that's where edx-forum (or cs_comments_service) comes in.

Hope it works now!

Hi @marcos,

It worked! :confetti_ball:
No more errors.

Thank you,

Diana

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.