You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an error while trying to load the "Meldungen" page. The page loads but the following error is present in the apache error.log file:
[Mon Nov 20 15:51:21.230547 2023] [wsgi:error] [pid 1570133] Exception in thread Thread-53:
[Mon Nov 20 15:51:21.230786 2023] [wsgi:error] [pid 1570133] Traceback (most recent call last):
[Mon Nov 20 15:51:21.230884 2023] [wsgi:error] [pid 1570133] File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
[Mon Nov 20 15:51:21.231176 2023] [wsgi:error] [pid 1570133] self.run()
[Mon Nov 20 15:51:21.231300 2023] [wsgi:error] [pid 1570133] File "/usr/lib/python3.9/threading.py", line 892, in run
[Mon Nov 20 15:51:21.231532 2023] [wsgi:error] [pid 1570133] self._target(*self._args, **self._kwargs)
[Mon Nov 20 15:51:21.231603 2023] [wsgi:error] [pid 1570133] File "/data/GeoPortal.rlp/useroperations/utils/useroperations_helper.py", line 39, in __set_tag
[Mon Nov 20 15:51:21.231744 2023] [wsgi:error] [pid 1570133] if searcher.is_article_internal(title):
[Mon Nov 20 15:51:21.231849 2023] [wsgi:error] [pid 1570133] File "/data/GeoPortal.rlp/searchCatalogue/utils/searcher.py", line 401, in is_article_internal
[Mon Nov 20 15:51:21.232061 2023] [wsgi:error] [pid 1570133] resp = self.get_info_result_category(tmp)
[Mon Nov 20 15:51:21.232155 2023] [wsgi:error] [pid 1570133] File "/data/GeoPortal.rlp/searchCatalogue/utils/searcher.py", line 386, in get_info_result_category
[Mon Nov 20 15:51:21.232321 2023] [wsgi:error] [pid 1570133] response = response["query"]["pages"]
[Mon Nov 20 15:51:21.232380 2023] [wsgi:error] [pid 1570133] KeyError: 'query'
Or go to Informationen and go to the sub categories like Über uns, GDI-Hessen-
See in the error log file.
Problem:
The code mightn't work what it is intended for. Hence it could be made error free, even though no error could be seen in frontend.
Solving approach:
In the Geoportal.rlp/useroperations/utils/useroperations_helper.py:37, the title is empty string (always) when the Meldungen page is loaded. The expected name of the title should be Meldungen. Hence it passes the empty title in the searcher in line 39:
and the title ultimately passed to resp = self.get_info_result_category(tmp) in searchCatalouge/utils/searcher.py which makes a bad response and also doesnot include ["query"]["pages"].
The code from line 37 to 42 in useroperations/utils/useroperations_helper.py was replaced with:
forelemin_list:
attrib=elem.get(attribute)
iftag=='a':
# Parse the href attribute as a URLurl=urlparse(elem.get('href', ''))
# Extract the query parameters from the URLquery_params=parse_qs(url.query)
# Get the "title" query parametertitle=query_params.get('title', [''])[0].replace(' ', '_')
iftitleandsearcher.is_article_internal(title):
attrib="/article/"+titleifprotocolnotinattrib:
elem.set(attribute, prefix+attrib)
It removes the error in the error log file, but I have have doubt this new lines of code can serve its purpose.
What is the purpose of these code in line searchCatalogue/utils/searcher.py:390-405 and in get_info_result_category(tmp)?
Is it serving its purpose?
I cant tell 100% because the code is from a former colleague, but it has something to do with mediawiki articles that have the
category "Portalseite" are rendered internally in the info search and/or maybe in other places as well:
Not sure if this has ever worked as expected.
I used a part of your code for commit, should be enough to get rid of the error: 9926d88
Description:
I encountered an error while trying to load the "Meldungen" page. The page loads but the following error is present in the apache error.log file:
[Mon Nov 20 15:51:21.230547 2023] [wsgi:error] [pid 1570133] Exception in thread Thread-53:
[Mon Nov 20 15:51:21.230786 2023] [wsgi:error] [pid 1570133] Traceback (most recent call last):
[Mon Nov 20 15:51:21.230884 2023] [wsgi:error] [pid 1570133] File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
[Mon Nov 20 15:51:21.231176 2023] [wsgi:error] [pid 1570133] self.run()
[Mon Nov 20 15:51:21.231300 2023] [wsgi:error] [pid 1570133] File "/usr/lib/python3.9/threading.py", line 892, in run
[Mon Nov 20 15:51:21.231532 2023] [wsgi:error] [pid 1570133] self._target(*self._args, **self._kwargs)
[Mon Nov 20 15:51:21.231603 2023] [wsgi:error] [pid 1570133] File "/data/GeoPortal.rlp/useroperations/utils/useroperations_helper.py", line 39, in __set_tag
[Mon Nov 20 15:51:21.231744 2023] [wsgi:error] [pid 1570133] if searcher.is_article_internal(title):
[Mon Nov 20 15:51:21.231849 2023] [wsgi:error] [pid 1570133] File "/data/GeoPortal.rlp/searchCatalogue/utils/searcher.py", line 401, in is_article_internal
[Mon Nov 20 15:51:21.232061 2023] [wsgi:error] [pid 1570133] resp = self.get_info_result_category(tmp)
[Mon Nov 20 15:51:21.232155 2023] [wsgi:error] [pid 1570133] File "/data/GeoPortal.rlp/searchCatalogue/utils/searcher.py", line 386, in get_info_result_category
[Mon Nov 20 15:51:21.232321 2023] [wsgi:error] [pid 1570133] response = response["query"]["pages"]
[Mon Nov 20 15:51:21.232380 2023] [wsgi:error] [pid 1570133] KeyError: 'query'
Steps to reproduce:
Problem:
The code mightn't work what it is intended for. Hence it could be made error free, even though no error could be seen in frontend.
Solving approach:
In the Geoportal.rlp/useroperations/utils/useroperations_helper.py:37, the title is empty string (always) when the Meldungen page is loaded. The expected name of the title should be Meldungen. Hence it passes the empty title in the searcher in line 39:
and the title ultimately passed
to resp = self.get_info_result_category(tmp)
in searchCatalouge/utils/searcher.py which makes a bad response and also doesnot include ["query"]["pages"].The code from line 37 to 42 in useroperations/utils/useroperations_helper.py was replaced with:
It removes the error in the error log file, but I have have doubt this new lines of code can serve its purpose.
@holsandre
Question:
What is the purpose of these code in line searchCatalogue/utils/searcher.py:390-405 and in get_info_result_category(tmp)?
Is it serving its purpose?
The text was updated successfully, but these errors were encountered: