mirumee / legacy-views

A legacy fork of Saleor that contains the old storefront and dashboard code
Other
14 stars 14 forks source link

thumbnail error in production #23

Closed javadfarah closed 4 years ago

javadfarah commented 4 years ago

What I'm trying to achieve

sorry for my poor english hi. im deploying saleor on vps.

but when i set debug_mode=False

then get_thumbnail raise error: TypeError: '<' not supported between instances of 'SafeText' and 'int'

this error is because of VERSATILEIMAGEFIELD_SETTINGS when i set VERSATILEIMAGEFIELD_SETTINGS = True it works perfectly! i don't khow why!!!

full log:

Mar 18 18:11:52 avby gunicorn[21620]: Traceback (most recent call last):
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
Mar 18 18:11:52 avby gunicorn[21620]:     response = get_response(request)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/core/handlers/base.py", line 145, in _get_response
Mar 18 18:11:52 avby gunicorn[21620]:     response = self.process_exception_by_middleware(e, request)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/core/handlers/base.py", line 143, in _get_response
Mar 18 18:11:52 avby gunicorn[21620]:     response = response.render()
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/response.py", line 106, in render
Mar 18 18:11:52 avby gunicorn[21620]:     self.content = self.rendered_content
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/response.py", line 83, in rendered_content
Mar 18 18:11:52 avby gunicorn[21620]:     content = template.render(context, self._request)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/backends/django.py", line 61, in render
Mar 18 18:11:52 avby gunicorn[21620]:     return self.template.render(context)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/base.py", line 171, in render
Mar 18 18:11:52 avby gunicorn[21620]:     return self._render(context)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/base.py", line 163, in _render
Mar 18 18:11:52 avby gunicorn[21620]:     return self.nodelist.render(context)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/base.py", line 937, in render
Mar 18 18:11:52 avby gunicorn[21620]:     bit = node.render_annotated(context)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated
Mar 18 18:11:52 avby gunicorn[21620]:     return self.render(context)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/loader_tags.py", line 150, in render
Mar 18 18:11:52 avby gunicorn[21620]:     return compiled_parent._render(context)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/base.py", line 163, in _render
Mar 18 18:11:52 avby gunicorn[21620]:     return self.nodelist.render(context)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/base.py", line 937, in render
Mar 18 18:11:52 avby gunicorn[21620]:     bit = node.render_annotated(context)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated
Mar 18 18:11:52 avby gunicorn[21620]:     return self.render(context)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/loader_tags.py", line 62, in render
Mar 18 18:11:52 avby gunicorn[21620]:     result = block.nodelist.render(context)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/base.py", line 937, in render
Mar 18 18:11:52 avby gunicorn[21620]:     bit = node.render_annotated(context)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated
Mar 18 18:11:52 avby gunicorn[21620]:     return self.render(context)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/defaulttags.py", line 209, in render
Mar 18 18:11:52 avby gunicorn[21620]:     nodelist.append(node.render_annotated(context))
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated
Mar 18 18:11:52 avby gunicorn[21620]:     return self.render(context)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/myprojectenv/lib/python3.6/site-packages/django/template/library.py", line 192, in render
Mar 18 18:11:52 avby gunicorn[21620]:     output = self.func(*resolved_args, **resolved_kwargs)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/saleor/product/templatetags/product_images.py", line 88, in get_thumbnail
Mar 18 18:11:52 avby gunicorn[21620]:     used_size = get_thumbnail_size(size, method, rendition_key_set)
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/saleor/product/templatetags/product_images.py", line 70, in get_thumbnail_size
Mar 18 18:11:52 avby gunicorn[21620]:     larger = [x for x in avail_sizes if size < x <= size * 2]
Mar 18 18:11:52 avby gunicorn[21620]:   File "/home/sammy/vd_robot/saleor/product/templatetags/product_images.py", line 70, in <listcomp>
Mar 18 18:11:52 avby gunicorn[21620]:     larger = [x for x in avail_sizes if size < x <= size * 2]
Mar 18 18:11:52 avby gunicorn[21620]: TypeError: '<' not supported between instances of 'SafeText' and 'int'
Mar 18 18:11:53 avby gunicorn[21620]: ERROR django.request Internal Server Error: /en/ [PID:21640:MainThread]

System information Operating system: ubuntu 18.0.4 django 2.2 saleor 2.9

karolkielecki commented 4 years ago

Hi @javadfarah. It looks like you are using python 3.6. I recommend you to install python 3.8 and check if you still receive this error.

javadfarah commented 4 years ago

hi @karolkielecki thanks for your reply! with python3.8.2 still same error:(

karolkielecki commented 4 years ago

Hello @javadfarah. I'm sorry for my late reply. We will investigate this much more closely because we're not sure what happens with the code here. If I have any news, I'll let you know.

karolkielecki commented 4 years ago

Hey! Unfortunately, it looks like an issue with the old storefront, which we don't maintain anymore...

javadfarah commented 4 years ago

@karolkielecki hi, thanks for your reply! so what should i do? i used V2.9. if it's old store front why is still there!?

karolkielecki commented 4 years ago

Hey. Saleor 2.9 can use both the old and the new PWA storefront, but we don't maintain the first one anymore. We focus on developing the new storefront: https://github.com/mirumee/saleor-storefront/releases/tag/v0.7.0. It's still beta quality, but we're working on its optimization and stability. Generally speaking, I would recommend you to try our new storefront :)

javadfarah commented 4 years ago

@karolkielecki thank you for reply and your advice:) i actually tried new store front, it's awesome but i can't develop and customize react applications.

anyway thanks for your support, wish you best :)