Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'check_location' from 'storages.utils' (/app/.heroku/python/lib/python3.9/site... #4977

Closed
sentry-io bot opened this issue Jul 8, 2021 · 7 comments
Assignees

Comments

@sentry-io
Copy link

sentry-io bot commented Jul 8, 2021

Sentry Issue: MICROMASTERS-57H

TypeError: 'Rendition' object is not subscriptable
  File "django/template/base.py", line 829, in _resolve_lookup
    current = current[bit]

ImportError: cannot import name 'check_location' from 'storages.utils' (/app/.heroku/python/lib/python3.9/site-packages/storages/utils.py)
(38 additional frame(s) were not displayed)
...
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "storages/backends/s3boto3.py", line 20, in <module>
    from storages.utils import (
@pdpinch
Copy link
Member

pdpinch commented Jul 8, 2021

So far, this is only happening on CI and RC.

@pdpinch
Copy link
Member

pdpinch commented Jul 9, 2021

This seems to be a side-effect of PR #4928 #4951 which has been reverted.

@arslanashraf7
Copy link
Contributor

Putting it On Hold in favor of other high priority work

@pdpinch
Copy link
Member

pdpinch commented Aug 31, 2021

This started happening again on RC, but it's not showing up in Sentry because we've used up too many events in August.

What is the impact of this error?

@arslanashraf7
Copy link
Contributor

This started happening again on RC, but it's not showing up in Sentry because we've used up too many events in August.

What is the impact of this error?

I'm not sure if it will produce on production or not, last time I checked it wasn't produced locally. I was looking at the history and we recently merged a #5026 PR that did some package upgrades and definitely, wagtail is not one of them so it is some other package that is the reason behind this odd behavior.

@arslanashraf7
Copy link
Contributor

A deeper look at it reveals the PR by @annagav #5026 I mentioned above also only updates just one package in requirements.in and other changes in the requirements.txt are just a change of order of packages. Something similar to a PR that we once reverted #4978. My idea is that just the change in the order of packages is the culprit.

@arslanashraf7
Copy link
Contributor

In addition to the above comment, I'm cross-posting the very useful insights provided by @rhysyngsun's on slack:

ok, so apparently django-storages-redux was a fork of the original django-storages, because django-storages was unmaintained at the time. django-storages-redux has now become django-storages so now django-storages-redux is deprecated and no longer maintained in favor of django-storages again

this happened around early/mid 2017, so probably after we implemented this in MM. I'm pretty confident we can just remove the redux version from requirements.in, we were overwriting it anyway.

In the light of the above, we created a PR(#5028) to remove django-storages-redux, and that PR potentially solved this issue.

@pdpinch I believe we can close this issue, but I'll wait on you if you'd want to add anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants