You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For cases when the platform can't define the site (e.g., from the request), it falls back to the site with id = SITE_ID with the appropriate consequences, like bulk emails being sent without the site branding.
How to check/reproduce
Go to the LMS admin site -> Sites and check IDs for example.com and your target domain (check the record URL for ID).
You can also try to navigate to the site object with ID = 1 (<LMS>/admin/sites/site/1/):
Environment
Mac OS 15.0.1
Tutor >=18;<19 (Redwood)
Workarounds
swap sites with id 2 and 3 manually (tested)
change SITE_ID setting to point to id 3 (not tested, possibly will work for existing installations only)
add the Site Theme record in the admin site for example.com (tested with bulk emails case, works for branding, but links use incorrect domain example.com)
The text was updated successfully, but these errors were encountered:
Hi,
You are describing your analysis of an issue but not clearly explaining what are the symptoms of this issue. Is the problem that bulk emails are sent without branding? If yes, please include screenshots of bulk emails before/after fix. Are there other side effects of not correctly setting SITE_ID? Then we need to know about those and document them here.
I'm not sure yet what's the best solution to this problem, as I don't know for sure what the actual problem is. But in my dream world, we would not have to define SITE_ID at all in the Django setting: the value of this setting is tied to the database, which means that we need to run migrations before defining settings. But obviously, we also need to define settings to run migrations. This circular dependency should be removed, if possible.
For now, I know only about the bulk email issue, but as I said in the issue description, the case potentially affects all the functionality that needs a correct site to define branding or get site configuration values. I would search across the celery tasks for such cases.
Here is an example of a bulk email without a fix (note: the email is sent from the main site, I don't have tenants):
And after the fix:
regisb
changed the title
SITE_ID misconfiguration
Bulk emails include links to example.com (SITE_ID misconfiguration)
Dec 30, 2024
regisb
added
the
bug
Bugs will be investigated and fixed as quickly as possible.
label
Dec 30, 2024
Bug description
Bottom line up:
Tutor installations have the SITE_ID setting pointing to the Django default
example.com
site while trying to avoid it.While Tutor explicitly says that it uses SITE_ID = 2 because example.com already uses id 1, it doesn't work that way.
Actual state on any Tutor-based openedx instance I checked:
After a shallow investigation I found:
Consequences
For cases when the platform can't define the site (e.g., from the request), it falls back to the site with id = SITE_ID with the appropriate consequences, like bulk emails being sent without the site branding.
How to check/reproduce
Go to the LMS admin site -> Sites and check IDs for
example.com
and your target domain (check the record URL for ID).You can also try to navigate to the site object with ID = 1 (
<LMS>/admin/sites/site/1/
):Environment
Mac OS 15.0.1
Tutor >=18;<19 (Redwood)
Workarounds
example.com
)The text was updated successfully, but these errors were encountered: