Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Internal Server Error in 0.15.0 #1502

Closed
Felix2yu opened this issue Jan 29, 2019 · 6 comments
Closed

Internal Server Error in 0.15.0 #1502

Felix2yu opened this issue Jan 29, 2019 · 6 comments
Labels

Comments

@Felix2yu
Copy link

In version 0.15.0, if the interface language is changed to [中文 (Chinese)]. Clicking the preferences again will display an internal service error. In version 0.14, there is no such problem.

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
ERROR:flask.app:Exception on /preferences [GET]
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/searx/searx/webapp.py", line 725, in preferences
    preferences=True)
  File "/usr/local/searx/searx/webapp.py", line 397, in render
    '{}/{}'.format(kwargs['theme'], template_name), **kwargs)
  File "/usr/lib/python3.6/site-packages/flask/templating.py", line 135, in render_template
    context, ctx.app)
  File "/usr/lib/python3.6/site-packages/flask/templating.py", line 117, in _render
    rv = template.render(context)
  File "/usr/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/searx/searx/templates/oscar/preferences.html", line 2, in top-level template code
    {% extends "oscar/base.html" %}
  File "/usr/local/searx/searx/templates/oscar/base.html", line 82, in top-level template code
    {% block content %}
  File "/usr/local/searx/searx/templates/oscar/preferences.html", line 78, in block "content"
    {% set method_info = _('Change how forms are submited, <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods" rel="external">learn more about request methods</a>') %}
  File "/usr/lib/python3.6/site-packages/jinja2/ext.py", line 134, in _gettext_alias
    return __context.call(__context.resolve('gettext'), *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/jinja2/ext.py", line 143, in gettext
    return rv % variables
  File "/usr/lib/python3.6/site-packages/markupsafe/__init__.py", line 102, in __mod__
    return self.__class__(text_type.__mod__(self, arg))
  File "/usr/lib/python3.6/site-packages/markupsafe/__init__.py", line 315, in __float__
    return float(self.obj)
TypeError: float() argument must be a string or a number, not 'dict'
@iiivii
Copy link

iiivii commented Jan 29, 2019

yes,I also have the same problem.

@bourrel
Copy link
Contributor

bourrel commented Feb 4, 2019

Can you try with this branch #1481 ? It updates jinja2 which seems to be part of the problem here.

@kvch
Copy link
Member

kvch commented Feb 23, 2019

I have tested the branch with the package updates. Unfortunately, jinja update does not help.
It seems like the UI cannot show the translated version of "Change how forms are submited, <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods" rel="external">learn more about request methods</a>". I am still looking into the issue.

@kvch
Copy link
Member

kvch commented Feb 23, 2019

The translation seems to be incorrect.
The following URL

https://zh.wikipedia.org/wiki/%E8%B6%85%E6%96%87%E6%9C%AC%E4%BC%A0%E8%BE%93%E5%8D%8F%E8%AE%AE#%E8%AF%B7%E6%B1%82%E6%96%B9%E6%B3%95

should be

https://zh.wikipedia.org/wiki/超文本传输协议#请求方法

in the translation.

@kvch
Copy link
Member

kvch commented Feb 23, 2019

I updated it on Transifex.

@asciimoo
Copy link
Member

asciimoo commented Mar 9, 2020

Fixed by @kvch

@asciimoo asciimoo closed this as completed Mar 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants