mitodl / edx-platform

The Open edX platform, the software that powers edX!
http://open.edx.org/
GNU Affero General Public License v3.0
6 stars 1 forks source link

Upstream block lengths bug fix #272

Closed pdpinch closed 2 years ago

pdpinch commented 3 years ago

@blarghmatey fixed a bug in our Residential version of lilac with https://github.com/mitodl/edx-platform/commit/18a4e0c665. We should upstream the fix.

pdpinch commented 3 years ago

@blarghmatey can you say anything more about the circumstance where we were seeing this error?

blarghmatey commented 3 years ago

This was happening in our QA environments due to some weirdness with how the data was getting restored from production. I'm still not certain exactly why it happened, but that commit is the fix that allows the site to load when it does happen.

asadiqbal08 commented 2 years ago

@blarghmatey I am looking around the change set and thinking is it possible to have a structure without blocks in it ? I am trying to get such a course structure that do not have any blocks defined but I could not find way to create such instance. such as in unittest.

It seems me, structures are defined that must have some blocks elements in them. such as course block Here is the call that is going to find structure something like

I noticed, this PR has not any tests. Can you tell me the scenario that do not have blocks from mongo structure ?

blarghmatey commented 2 years ago

So, we haven't experienced this bug when creating courses programmatically. The way that this occurs is through our backup/restore of data from our production environment into QA when we work through testing a new release, which points to some error in our strategy there which is introducing this bug. My suspicion is that it's due to a mismatch in what is stored in Mongo and what MySQL has as a reference for the course itself.

It might be that it isn't worth upstreaming this bug, but given that it's only a metrics event that's throwing an exception which prevents the otherwise proper functioning of the application, that's why I had added the logic to work around the problem.

shaidar commented 2 years ago

@blarghmatey Can we close this or is it still worth looking into upstreaming?

blarghmatey commented 2 years ago

This is purely due to issues with syncing data from production to QA which we are not going to be doing going forward.