Skip to content

Commit 2466787

Browse files
authored
Merge pull request #341 from openedx/bmtcril/superset_oauth_patch
docs: Update troubleshooting doc for Superset OAuth patch
2 parents dc2ec30 + 978f2b1 commit 2466787

1 file changed

Lines changed: 48 additions & 7 deletions

File tree

docs/technical_documentation/how-tos/aspects_troubleshooting.rst

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,66 @@ dashboard.
3232
Solution: Make sure you have published your courses since installing / reinstalling Aspects, or :ref:`backfill course blocks <backfill_course_blocks>` .
3333

3434

35-
Embedded Dashboard Errors
36-
=========================
35+
Embedded Dashboard / Superset Login Errors
36+
==========================================
3737

3838
Symptom: In the Instructor Dashboard "Reports" tab or In-Context Metrics in Studio the dashboards
3939
fail to load, showing only a message like:
4040

4141
- ``Something went wrong with embedded authentication. Check the dev console for details.``
4242
- or ``Error: invalid_request Invalid client_id``
4343

44-
This most often happens when moving between Tutor deployment types (dev/local/k8s) but can also
45-
happen when the hostnames or ports your LMS or Superset change (such as when populating a staging
46-
environment from a production database). This is usually an issue with the OAuth Application entry
47-
not matching the Superset URL. Make sure you ``config.yml`` settings are correct for your
48-
environment (especially ``SUPERSET_HOST`` and ``SUPERSET_PORT``) then:
44+
There are numerous potential causes of these errors, but most they often happen when moving between
45+
Tutor deployment types (dev/local/k8s) but can also happen when the hostnames or ports in your LMS or
46+
Superset configuration change (such as when populating a staging environment from a production database).
47+
48+
This root issue is usually an the OAuth Application LMS database entry not matching the Superset
49+
URL. Make sure your ``config.yml`` settings are correct for your environment (especially
50+
``SUPERSET_HOST`` and ``SUPERSET_PORT``).
51+
52+
External Proxy
53+
--------------
54+
55+
If you are running behind a proxy separate from Tutor's Caddy there may be mismatches between
56+
the expected http/https redirect URIs that Aspects sets by default. In this case you can set
57+
the ``SUPERSET_PROXY_FIX`` Tutor setting to True in your config. It tells Superset to use the
58+
headers set by the proxy to confirm the URL. See the
59+
`Flask documentation <https://flask.palletsprojects.com/en/latest/deploying/proxy_fix/>`_
60+
for important details and security implications.
61+
62+
Outdated Settings
63+
-----------------
64+
65+
If you are not running behind an external proxy you can take these steps:
4966

5067
- Go into the Django admin: ``{LMS_ROOT}/admin/oauth2_provider/application/``
5168
- Delete the Application entries for `superset-sso` and ``superset-sso-dev`` if they exist
5269
- Re-run ``tutor [dev|local|k8s] do init -l aspects`` to recreate the entries
5370

71+
Tutor Local HTTPS
72+
-----------------
73+
74+
Some configurations of ``tutor local`` (usually when selecting HTTPS for a localhost development
75+
installation, which cannot support HTTPS) can cause this error as well. In those cases you can
76+
get around the error by using the following Tutor patch.
77+
78+
.. warning::
79+
80+
This patch turns off an important security setting and potentially creates a vulnerability in
81+
your application. If you run into the above error in a production environment please reach out
82+
for assistance instead of using this patch!
83+
84+
85+
.. code-block:: yaml
86+
87+
name: superset-auth-override
88+
version: "1.0.0"
89+
patches:
90+
openedx-common-settings: |
91+
import os
92+
os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "1"
93+
SUPERSET_CONFIG["internal_service_url"] = "http://superset:8088"
94+
5495
5596
General Troubleshooting
5697
***********************

0 commit comments

Comments
 (0)