Bug 49016 - AdminDiary: NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:None
AdminDiary: NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:None
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Admin Diary
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 5.0-2-errata
Assigned To: Peter Stoll
Dirk Wiesenthal
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-03-17 12:20 CET by Florian Best
Modified: 2022-09-21 17:07 CEST (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.257
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2019031721000273, 2021011921000858
Bug group (optional): Error handling, External feedback
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2019-03-17 12:20:38 CET
Internal server error during "admindiary/options".
Request: admindiary/options

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 253, in execute
    function.__func__(self, request, *args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 318, in _response
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 440, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 286, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/admindiary/__init__.py", line 105, in options
    with get_client(version=1) as client:
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "%PY2.7%/univention/admindiary/backend.py", line 324, in get_client
    with get_session() as session:
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "%PY2.7%/univention/admindiary/backend.py", line 73, in get_session
    session = make_session_class()()
  File "%PY2.7%/univention/admindiary/backend.py", line 66, in make_session_class
    engine = get_engine()
  File "%PY2.7%/univention/admindiary/backend.py", line 62, in get_engine
    return sqlalchemy.create_engine(db_url)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/__init__.py", line 386, in create_engine
    return strategy.create(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 51, in create
    entrypoint = u._get_entrypoint()
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/url.py", line 131, in _get_entrypoint
    cls = registry.load(name)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 212, in load
    (self.group, name))
NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:None

Role: domaincontroller_backup
Comment 1 Florian Best univentionstaff 2019-03-17 12:21:00 CET
Maybe a missing dependency?
Comment 2 Arvid Requate univentionstaff 2019-03-18 12:48:26 CET
Probably admin/diary/dbms ist not initialized, no idea why. One possibility would be apt install univention-admin-diary-backend --no-recommends
Comment 3 Christian Castens univentionstaff 2021-01-26 10:19:25 CET
reported again:
Version: 4.4-7 errata870 (Blumenthal)

Remark: Trying to setup the Admin Diary Frontend. The backend is already installed on another server.
Comment 4 Peter Stoll univentionstaff 2022-05-13 16:32:48 CEST
Error reproduced!

Solution:
When running the Admin Diary Frontend not on the same system the Admin Diary Backend is running on, the following instruction have to be followed:
https://help.univention.com/t/admin-diary-how-to-seperate-frontend-and-backend/11331
This description is linked in the installation instruction of the Admin Diary.
Unfortunately, after executing all the instruction, starting the Admin Diary Client will generate now present a different error message, that the connection to the DB server cannot be established.
The problem is, that there is an error in these instructions. For a postgres DB the command to allow access has to be changed from 
ucr set postgres9/pg_hba/config/01="host admindiary admindiary 10.11.12.13/32 md5"
to
ucr set postgres11/pg_hba/config/01="host admindiary admindiary 10.11.12.13/32 md5"
With all the changes applied, the Admin Diary Frontend will work as expected.
Comment 5 Peter Stoll univentionstaff 2022-05-13 16:41:14 CEST
The above statement concerning the wrong ucr variable for setting the postgres access is true for UCS 5. For UCS 4 the description might be correct.
Comment 6 Peter Stoll univentionstaff 2022-09-16 10:59:11 CEST
MR: https://git.knut.univention.de/univention/ucs/-/merge_requests/508
Commit: 24077ebab7
Comment 7 Dirk Wiesenthal univentionstaff 2022-09-19 21:22:41 CEST
I fixed a little typo and also adjusted the help article. The error most probably originates from splitting diary frontend and backend. But more generally, the problem is a "None://" at the start of the DB uri as indicated by "Can't load plugin: sqlalchemy.dialects:None".

BTW: A `dbms = ucr.get('admin/diary/dbms', 'postgresql')` would have helped, too. In that case, I assume this error message would be shown:


Die Verbindung zum Admin Diary Backend ist fehlgeschlagen.
Das Datenbank-Managementsystem ist "postgresql". Läuft der Dienst und reagiert er auf TCP/IP-Verbindungen?
Stellen Sie sicher, dass Ihre Firewall Verbindungen zu 10.200.4.80 erlaubt.
Überprüfen Sie das Passwort in /etc/admin-diary.secret. Ist es das gleiche auf replica82 wie auf 10.200.4.80?
Darf sich replica82 mit dem Datenbank-Dienst auf 10.200.4.80 verbinden?


This is basically covered in the help article. And as this should be the original problem, I think the new error message is fine.