mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 13:49:26 +02:00
On a long-running server, the tracebacks below can be found (albeit rarely), which indicate problems with NoneType where a string or another data type is expected. result.img_src:: File "/usr/local/searxng/searxng-src/searx/templates/simple/result_templates/images.html", line 13, in top-level template code <img src="" data-src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}">{{- "" -}} ^ File "/usr/local/searxng/searxng-src/searx/webapp.py", line 284, in image_proxify if url.startswith('//'): ^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'startswith' result.content:: File "/usr/local/searxng/searxng-src/searx/result_types/_base.py", line 105, in _normalize_text_fields result.content = WHITESPACE_REGEX.sub(" ", result.content).strip() ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ TypeError: expected string or bytes-like object, got 'NoneType' html_to_text, when html_str is a NoneType:: File "/usr/local/searxng/searxng-src/searx/engines/wikipedia.py", line 190, in response title = utils.html_to_text(api_result.get('titles', {}).get('display') or api_result.get('title')) File "/usr/local/searxng/searxng-src/searx/utils.py", line 158, in html_to_text html_str = html_str.replace('\n', ' ').replace('\r', ' ') ^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'replace' presearch engine, when json_resp is a NoneType:: File "/usr/local/searxng/searxng-src/searx/engines/presearch.py", line 221, in response results = parse_search_query(json_resp.get('results')) File "/usr/local/searxng/searxng-src/searx/engines/presearch.py", line 161, in parse_search_query for item in json_results.get('specialSections', {}).get('topStoriesCompact', {}).get('data', []): ^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'get' Signed-off-by: Markus Heiser <markus.heiser@darmarit.de> |
||
---|---|---|
.. | ||
answerers | ||
botdetection | ||
data | ||
enginelib | ||
engines | ||
favicons | ||
infopage | ||
metrics | ||
network | ||
plugins | ||
result_types | ||
search | ||
static/themes/simple | ||
templates/simple | ||
translations | ||
__init__.py | ||
autocomplete.py | ||
babel_extract.py | ||
compat.py | ||
exceptions.py | ||
extended_types.py | ||
external_bang.py | ||
external_urls.py | ||
flaskfix.py | ||
limiter.py | ||
limiter.toml | ||
locales.py | ||
openmetrics.py | ||
preferences.py | ||
query.py | ||
redisdb.py | ||
redislib.py | ||
results.py | ||
searxng.msg | ||
settings.yml | ||
settings_defaults.py | ||
settings_loader.py | ||
sqlitedb.py | ||
sxng_locales.py | ||
unixthreadname.py | ||
utils.py | ||
version.py | ||
webadapter.py | ||
webapp.py | ||
webutils.py |