Need help installing Insights


I’m trying to install Insights by following the script here:

(but using edx configuation at koa.2a tag)

However, I got error at “TASK [edx_django_service : migrate database]” which try to connect to local MySQL server:

django.db.utils.OperationalError: (2002, “Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)”)

I have already set the DB_HOST, DB_USERNAME … in the script to the DB server (on another host). I have tried changing INSIGHTS_DATABASE_HOST and other database parameters in playbooks/roles/insights/defaults/main.yml, but it still try to connect to local MySQL.

My question are:

  • Do I need to install a local MySQL server? (the script/playbook doesn’t install it)
  • If we don’t need local MySQL server, how to specify the remote host to connect to.

Thank you,

After installing MySQL and fixing here and there I’m able to complete the first Ansible playbook. Now the Insight app is running but I’m unable to login.

  • Already setup OAuth application on edX admin site.
  • When login, Insights redirect to edX with scope=user_id+profile+email which edX complain as invalid scope.
  • Tried manually using the redirect link with scope=profile+email, and now I get

requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://myhost.domain/oauth2/access_token

social_core.exceptions.AuthForbidden: Your credentials aren’t allowed

Does any one know how to properly configure this?

Thank you,

hello @pongtawat. How did you fix this issue

django.db.utils.OperationalError: (2002, “Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)”)

FYI this could help here openedx-deployment/ at master · open-craft/openedx-deployment · GitHub

I think you are missing to setup the OAuth Client that insights is going to use to communicate with the Open edX instance