Need help installing Insights

Hello,

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

https://openedx.atlassian.net/wiki/spaces/OpenOPS/pages/43385371/edX+Analytics+Installation

(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,
pongtawat

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,
Pongtawat