Analytics Installation

Hi when i run ansible-playbook for analytics i got this error

ansible-playbook -i localhost, -c local analytics_single.yml --extra-vars “INSIGHTS_LMS_BASE=domain_name INSIGHTS_VERSION=open-release/ironwood.master ANALYTICS_API_VERSION=open-release/ironwood.master”

Error:

TASK [git_clone : Require a clean working tree] **********************************************************************************************************

failed: [localhost] (item={’_ansible_parsed’: True, ‘stderr_lines’: , u’changed’: True, u’end’: u’2020-03-14 14:34:00.235124’, ‘_ansible_no_log’: False, u’stdout’: u’ M analytics_dashboard/settings/base.py\n M package-lock.json’, ‘_ansible_item_result’: True, u’rc’: 0, u’start’: u’2020-03-14 14:34:00.228059’, u’cmd’: u’test ! -e “/edx/app/insights/edx_analytics_dashboard” || git -C “/edx/app/insights/edx_analytics_dashboard” status --porcelain --untracked-files=no’, ‘item’: u’/edx/app/insights/edx_analytics_dashboard’, u’delta’: u’0:00:00.007065’, u’invocation’: {u’module_args’: {u’creates’: None, u’executable’: None, u’_uses_shell’: True, u’_raw_params’: u’test ! -e “/edx/app/insights/edx_analytics_dashboard” || git -C “/edx/app/insights/edx_analytics_dashboard” status --porcelain --untracked-files=no’, u’removes’: None, u’warn’: True, u’chdir’: None}}, ‘stdout_lines’: [u’ M analytics_dashboard/settings/base.py’, u’ M package-lock.json’], u’stderr’: u’’}) => {“failed”: true, “item”: {“changed”: true, “cmd”: “test ! -e “/edx/app/insights/edx_analytics_dashboard” || git -C “/edx/app/insights/edx_analytics_dashboard” status --porcelain --untracked-files=no”, “delta”: “0:00:00.007065”, “end”: “2020-03-14 14:34:00.235124”, “invocation”: {“module_args”: {"_raw_params": “test ! -e “/edx/app/insights/edx_analytics_dashboard” || git -C “/edx/app/insights/edx_analytics_dashboard” status --porcelain --untracked-files=no”, “_uses_shell”: true, “chdir”: null, “creates”: null, “executable”: null, “removes”: null, “warn”: true}}, “item”: “/edx/app/insights/edx_analytics_dashboard”, “rc”: 0, “start”: “2020-03-14 14:34:00.228059”, “stderr”: “”, “stderr_lines”: , “stdout”: " M analytics_dashboard/settings/base.py\n M package-lock.json", “stdout_lines”: [" M analytics_dashboard/settings/base.py", " M package-lock.json"]}, “msg”: “There are modified files in /edx/app/insights/edx_analytics_dashboard: M analytics_dashboard/settings/base.py\n M package-lock.json”}
to retry, use: --limit @/root/configuration/playbooks/analytics_single.retry

PLAY RECAP *************************************************************************************************************************************************************
localhost : ok=192 changed=39 unreachable=0 failed=1

Pls, help me

Hi,

When you follow this documentation for installing OpenEDX IronWood Master: https://openedx.atlassian.net/wiki/spaces/OpenOPS/pages/146440579/Native+Open+edX+platform+Ubuntu+16.04+64+bit+Installation , the insight is installed by default, you juste have to enable it in /edx/etc/nginx/sites-available by creating a virtualHost file

That sounds really interesting, I am currently trying to install insights for juniper but am still not successful. If one does not have to install insights on ironwood, I’d go back to ironwood…
So is that still the case with juniper (I don’t find an nginx directory in /edx/edc)? And can you provide a link to a documentation what must be included in this virtualHost file?

1 Like

I am currently trying to install insights for juniper but am still not successful

I think in Juniper it’s also installed by default, just check if you see this the insights service running:

openedx-root@lms_ ~

(I don’t find an nginx directory in /edx/edc)?

Sorry, this is the path: /edx/app/nginx/sites-available

And can you provide a link to a documentation what must be included in this virtualHost file?

No online documentation, but i can give you the process to do it

insights (3.0 KB)

1- Copy this file to /edx/app/nginx/sites-available/

2- create the symbolic link:

ln -s /edx/app/nginx/sites-available/insights /etc/nginx/sites-enabled/

3- Restart Nginx

/etc/init.d/nginx restart

4- Restart LMS and INSIGHTS, or just restart all:

/edx/bin/supervisorctl restart all

5- Type those commands:

cd /edx/app/insights/edx_analytics_dashboard

source /edx/app/insights/venvs/insights/bin/activate

export ANALYTICS_DASHBOARD_CFG=/edx/etc/insights.yml

./manage.py migrate --run-syncdb --settings=analytics_dashboard.settings.production

deactivate

Now you should access insight, http://yourLmsDomaiName:18110/courses/course-v1:edX+DemoX+Demo_Course/

Try this, if it still doesn’t works, then we will check your /edx/etc/analytics_api.yml and /edx/etc/insights.yml configurations…

Thank you very much for the extensive instruction. I cannot see the screenshot how I can check if the insights service is running. However, if I run

sudo service insights status

it returns
grafik

Yet I found the folder you mentioned.
When I follow your instruction, the migrate command fails with

" Your models have changes that are not yet reflected in a migration, and so won’t be applied.
Run ‘manage.py makemigrations’ to make new migrations, and then re-run ‘manage.py migrate’ to apply them."
https://textbin.net/tCtzMVZmRR

Thanks a lot for the help so far.

I cannot see the screenshot how I can check if the insights service is running.

The command to check services is:

/edx/bin/supervisorctl status

Ok thank you, there it appears :slight_smile:

If you ABSOLUTELY need INSIGHTS, then we continue working on it…

Just tell you that you can use FIGURES by APPSEMBLER, more simple to install, configure, and it works, you just need 15 min to make it up and running.

I tried to make INSIGHTS work but i faced a lot of issues, i was just able make it run, but when i want to use statistic i failed, so i move to FIGURES

Ok, it means that we have to check your config files befor.

Let’s see your /edx/etc/analytics_api.yml and /edx/etc/insights.yml

In /edx/etc/analytics_api.yml:

replace all “http://127.0.0.1:8000/oauth2” with “http://yourLmsDomaiName/oauth2
replace all “http://127.0.0.1:8000” with “http://yourLmsDomaiName

set those values:

JWT_PUBLIC_SIGNING_JWK_SET: null
LMS_BASE_URL: http://yourLmsDomaiName/
SOCIAL_AUTH_EDX_OIDC_LOGOUT_URL: http://yourLmsDomaiName/logout

in /edx/etc/insights.yml:

replace all “http://127.0.0.1:8000/oauth2” with “http://yourLmsDomaiName/oauth2

set those values:

COURSE_API_URL: http://yourLmsDomaiName/api/courses/v1/
LMS_COURSE_SHORTCUT_BASE_URL: http://yourLmsDomaiName/courses
CMS_COURSE_SHORTCUT_BASE_URL: http://yourLmsDomaiName/course

in /edx/app/edxapp/lms.env.json:

set those values:

JWT_PUBLIC_SIGNING_JWK_SET: null
"ANALYTICS_DASHBOARD_NAME": "Your Platform Name Here Insights", 
"ANALYTICS_DASHBOARD_URL": "http://yourLmsDomaiName:18110", 

Restart LMS and INSIGHTS, or just restart all, and run the step 5- i mentioned before, and tell me the result

I try as you said . But I meet a permission denied as attached file above.

You are on Ubuntu, so run another terminal console, and do this:

sudo su

cd /edx/app/insights/edx_analytics_dashboard

source /edx/app/insights/venvs/insights/bin/activate

export ANALYTICS_DASHBOARD_CFG=/edx/etc/insights.yml

./manage.py migrate --run-syncdb --settings=analytics_dashboard.settings.production

deactivate

And check if it works: http://yourLmsDomaiName:18110/courses/course-v1:edX+DemoX+Demo_Course/

I can see the insights home now. But press the login button(“http://[my-domain]:18110/login”) will redirect to “http://127.0.0.1:8000/oauth2/authorize?response_type=code&state=…”

I double confirm the three files below and there is no “127.0.0.1:8000”:
/edx/etc/insights.yml
/edx/app/edxapp/lms.env.json
/edx/etc/analytics_api.yml

Do you have any suggestion?

1 Like

Edit /edx/etc/discovery.yml, and check those values:

EDX_DRF_EXTENSIONS:
    	OAUTH2_USER_INFO_URL: http://yourLmsDomaiName/oauth2/user_info
	
JWT_AUTH:
	JWT_ISSUERS:
	-   AUDIENCE: SET-ME-PLEASE
		ISSUER: http://yourLmsDomaiName/oauth2
		SECRET_KEY: SET-ME-PLEASE
	JWT_PUBLIC_SIGNING_JWK_SET: null
	
SOCIAL_AUTH_EDX_OIDC_ID_TOKEN_DECRYPTION_KEY: discovery-secret
SOCIAL_AUTH_EDX_OIDC_ISSUER: http://yourLmsDomaiName/oauth2
SOCIAL_AUTH_EDX_OIDC_KEY: discovery-key
SOCIAL_AUTH_EDX_OIDC_LOGOUT_URL: http://yourLmsDomaiName/logout
SOCIAL_AUTH_EDX_OIDC_PUBLIC_URL_ROOT: http://yourLmsDomaiName/oauth2
SOCIAL_AUTH_EDX_OIDC_SECRET: discovery-secret
SOCIAL_AUTH_EDX_OIDC_URL_ROOT: http://yourLmsDomaiName/oauth2

Restart all and test if it works…

I modified the file and fix the problem:
/edx/app/insights/edx_analytics_dashboard/analytics_dashboard/settings/base.py

But I meet a new one:

And I saw the setting in DJANGO OAUTH TOOLKIT:
Redirect uris: https://[my-insights-domain]/complete/edx-oidc/

Is this wrong ?

It should work.

Lets see the log file please…

Only shows:
Aug 27 22:30:42 xyaw-VirtualBox [service_variant=insights][django.request][env:no_env] WARNING [xyaw-VirtualBox 29829] [log.py:228] - Not Found: /complete/edx-oidc/
Aug 27 22:30:42 xyaw-VirtualBox [service_variant=insights][django.request][env:no_env] WARNING [xyaw-VirtualBox 29829] [log.py:228] - Not Found: /complete/edx-oidc/

in /edx/app/edxapp/lms.env.json, we set “ANALYTICS_DASHBOARD_URL”: “http://yourLmsDomaiName:18110, so make sure you “Redirect uri:” match http://yourLmsDomaiName:18110/complete/edx-oidc/, and restart all service.

Attached file is the settings in my DJANGO-OAUTH-TOOLKIT.
I found in other post and try the two return uri:
https://xinsights.twshop.asia/complete/edx-oidc
https://xinsights.twshop.asia/complete/edx-oauth2
(Both of them show error : missmatching redirect URI)

My server is open-release / juniper.2 . Which one should be correct?

The django-oauth-toolkit problem is fixed.
(The redirect uris should be : https://xinsights.twshop.asia/complete/edx-oauth2/)


And I can login into the insights .

There is another problem :


I press anything items the system will show 500 error .
insight.log (3.4 KB)

Do you have any suggestion to fix this problem?

1 Like