prewikka error connecting to localhost:8000
Added by francesco francesco over 5 years ago
I installed prelude 4.1 on ubuntu 18.10.
when I start the browser with http://localhost:8000
I get the following error:
An unexpected condition happened while trying to load /
str returned non-string (type RuntimeError)
if isinstance(self._prewikka_initialized, Exception): env.log.log(self._prewikka_initialized.log_priority, text_type(self._prewikka_initialized)) raise self._prewikka_initialized
/usr/lib/python3/dist-packages/prewikka/main.py, line 133:
env.log.log(self._prewikka_initialized.log_priority, text_type(self._prewikka_initialized))
/usr/lib/python3/dist-packages/prewikka/main.py, line 244:
self._prewikka_init_if_needed()
/usr/lib/python3/dist-packages/prewikka/main.py, line 277:
response = self._process_static(webreq) or self._process_dynamic(webreq)
it's the problem connected to the python version?
could anyone give me suggestions?
Thanks
Francesco
Replies (5)
RE: prewikka error connecting to localhost:8000 - Added by Antoine LUONG over 5 years ago
Please apply the following patch in /usr/lib/python3/dist-packages/prewikka/error.py
:
--- a/prewikka/error.py
+++ b/prewikka/error.py
@@ -112,7 +112,7 @@ class PrewikkaError(PrewikkaException):
if details:
return "%s: %s" % (message, details)
- return message
+ return text_type(message)
def __str__(self):
return self._format_error(self.message, self.details)
Regards
RE: prewikka error connecting to localhost:8000 - Added by francesco francesco over 5 years ago
thanks a lot for your quick answer,
where I have to put the patch within the file?
at the and or where else?
francesco
RE: prewikka error connecting to localhost:8000 - Added by Antoine LUONG over 5 years ago
Please see https://en.wikipedia.org/wiki/Diff#Unified_format
You only need to change one line (for me, it's the line 115).
RE: prewikka error connecting to localhost:8000 - Added by francesco francesco over 5 years ago
antoine, i went ahead.
with your suggestion now it seems to work properly.
I hope the last problem:
wen I start the browser I get this message:
Access denied for user 'prelude'@'localhost' (using password: YES)
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/prewikka/main.py", line 123, in prewikka_init_if_needed
env.idmef_db = idmefdatabase.IDMEFDatabase(env.config.idmef_database)
File "/usr/lib/python3/dist-packages/prewikka/idmefdatabase.py", line 27, in init
preludedb.DB._init__(self, preludedb.SQL))
RuntimeError: Access denied for user 'prelude'@'localhost' (using password: YES)
Detail
def init(self, config): preludedb.DB.__init__(self, preludedb.SQL))
/usr/lib/python3/dist-packages/prewikka/idmefdatabase.py, line 27:
preludedb.DB.__init__(self, preludedb.SQL))
/usr/lib/python3/dist-packages/prewikka/main.py, line 123:
env.idmef_db = idmefdatabase.IDMEFDatabase(env.config.idmef_database)
Thanks in advance for suggestion.
By the way apache2 is a prerequisite?
RE: prewikka error connecting to localhost:8000 - Added by francesco francesco over 5 years ago
I succeded, I changed the passwd in prewikka.conf using the one specified in prelude-manager.conf.
now it works.
fantastic