Hi, I am currently trying to get analytics installed on an EC2 (Ubuntu 16.4) instance following the instructions located at :
https://openedx.atlassian.net/wiki/spaces/OpenOPS/pages/43385371/edX+Analytics+Installation
I’m currently using Tutor to deploy OpenEDX (koa.2) using an external MySQL (AWS RDS).
I have a tracking.log file I grabbed from the cms container and put put into the home directory of the EC2 analytics instance (as instructed).
I’m currently stuck on step 3 when running the command ansible-playbook -i localhost, -c local analytics_single.yml --extra-vars "INSIGHTS_LMS_BASE=<myLMS-site>"
The following log (I apologize if its one whole string)
TASK [edx_django_service : migrate database] ************************************************************************************************************************************************************************ fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["make", "migrate"], "delta": "0:00:00.785855", "end": "2021-04-07 02:57:08.871323", "msg": "non-zero return code", "rc": 2, "start": "2021-04-07 02:57:08.085468", "stderr": "Traceback (most recent call last):\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 217, in ensure_connection\n self.connect()\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 195, in connect\n self.connection = self.get_new_connection(conn_params)\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/mysql/base.py\", line 227, in get_new_connection\n return Database.connect(**conn_params)\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/MySQLdb/__init__.py\", line 130, in Connect\n return Connection(*args, **kwargs)\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/MySQLdb/connections.py\", line 185, in __init__\n super().__init__(*args, **kwargs2)\nMySQLdb._exceptions.OperationalError: (2002, \"Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)\")\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"./manage.py\", line 10, in <module>\n execute_from_command_line(sys.argv)\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/management/__init__.py\", line 381, in execute_from_command_line\n utility.execute()\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/management/__init__.py\", line 375, in execute\n self.fetch_command(subcommand).run_from_argv(self.argv)\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/management/base.py\", line 323, in run_from_argv\n self.execute(*args, **cmd_options)\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/management/base.py\", line 361, in execute\n self.check()\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/management/base.py\", line 387, in check\n all_issues = self._run_checks(\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/management/commands/migrate.py\", line 64, in _run_checks\n issues = run_checks(tags=[Tags.database])\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/checks/registry.py\", line 72, in run_checks\n new_errors = check(app_configs=app_configs)\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/checks/database.py\", line 10, in check_database_backends\n issues.extend(conn.validation.check(**kwargs))\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/mysql/validation.py\", line 9, in check\n issues.extend(self._check_sql_mode(**kwargs))\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/mysql/validation.py\", line 13, in _check_sql_mode\n with self.connection.cursor() as cursor:\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 256, in cursor\n return self._cursor()\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 233, in _cursor\n self.ensure_connection()\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 217, in ensure_connection\n self.connect()\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/utils.py\", line 89, in __exit__\n raise dj_exc_value.with_traceback(traceback) from exc_value\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 217, in ensure_connection\n self.connect()\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 195, in connect\n self.connection = self.get_new_connection(conn_params)\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/mysql/base.py\", line 227, in get_new_connection\n return Database.connect(**conn_params)\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/MySQLdb/__init__.py\", line 130, in Connect\n return Connection(*args, **kwargs)\n File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/MySQLdb/connections.py\", line 185, in __init__\n super().__init__(*args, **kwargs2)\ndjango.db.utils.OperationalError: (2002, \"Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)\")\nmake: *** [migrate] Error 1", "stderr_lines": ["Traceback (most recent call last):", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 217, in ensure_connection", " self.connect()", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 195, in connect", " self.connection = self.get_new_connection(conn_params)", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/mysql/base.py\", line 227, in get_new_connection", " return Database.connect(**conn_params)", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/MySQLdb/__init__.py\", line 130, in Connect", " return Connection(*args, **kwargs)", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/MySQLdb/connections.py\", line 185, in __init__", " super().__init__(*args, **kwargs2)", "MySQLdb._exceptions.OperationalError: (2002, \"Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)\")", "", "The above exception was the direct cause of the following exception:", "", "Traceback (most recent call last):", " File \"./manage.py\", line 10, in <module>", " execute_from_command_line(sys.argv)", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/management/__init__.py\", line 381, in execute_from_command_line", " utility.execute()", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/management/__init__.py\", line 375, in execute", " self.fetch_command(subcommand).run_from_argv(self.argv)", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/management/base.py\", line 323, in run_from_argv", " self.execute(*args, **cmd_options)", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/management/base.py\", line 361, in execute", " self.check()", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/management/base.py\", line 387, in check", " all_issues = self._run_checks(", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/management/commands/migrate.py\", line 64, in _run_checks", " issues = run_checks(tags=[Tags.database])", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/checks/registry.py\", line 72, in run_checks", " new_errors = check(app_configs=app_configs)", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/core/checks/database.py\", line 10, in check_database_backends", " issues.extend(conn.validation.check(**kwargs))", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/mysql/validation.py\", line 9, in check", " issues.extend(self._check_sql_mode(**kwargs))", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/mysql/validation.py\", line 13, in _check_sql_mode", " with self.connection.cursor() as cursor:", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 256, in cursor", " return self._cursor()", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 233, in _cursor", " self.ensure_connection()", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 217, in ensure_connection", " self.connect()", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/utils.py\", line 89, in __exit__", " raise dj_exc_value.with_traceback(traceback) from exc_value", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 217, in ensure_connection", " self.connect()", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/base/base.py\", line 195, in connect", " self.connection = self.get_new_connection(conn_params)", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/django/db/backends/mysql/base.py\", line 227, in get_new_connection", " return Database.connect(**conn_params)", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/MySQLdb/__init__.py\", line 130, in Connect", " return Connection(*args, **kwargs)", " File \"/edx/app/analytics_api/venvs/analytics_api/lib/python3.8/site-packages/MySQLdb/connections.py\", line 185, in __init__", " super().__init__(*args, **kwargs2)", "django.db.utils.OperationalError: (2002, \"Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)\")", "make: *** [migrate] Error 1"], "stdout": "./manage.py migrate --noinput --run-syncdb --database=default\nMakefile:106: recipe for target 'migrate' failed", "stdout_lines": ["./manage.py migrate --noinput --run-syncdb --database=default", "Makefile:106: recipe for target 'migrate' failed"]}
I’ve checked the comments below in the article by some people having issues and read about not using the master branch when checking out the repo. So I’ve used the following command: git clone --depth 1 --branch open-release/koa.2 https://github.com/edx/configuration
. However, it seems like the problem still persists. As, we’re still testing our deployment of edx we haven’t set up https yet, but according to the instructions, it isn’t required (and shouldn’t affect this step). Does anyone have any insight on what could be causing this error?