Univention Bugzilla – Full Text Bug Listing |
Summary: | UMC printer quota: displaying the quota takes very long if there are many users | ||
---|---|---|---|
Product: | UCS | Reporter: | Felix Botner <botner> |
Component: | UMC - Printer administration | Assignee: | Felix Botner <botner> |
Status: | CLOSED FIXED | QA Contact: | Florian Best <best> |
Severity: | normal | ||
Priority: | P5 | CC: | gohmann, grandjean, klaeser, scheinig, walkenhorst |
Version: | UCS 4.0 | ||
Target Milestone: | UCS 4.1-1-errata | ||
Hardware: | Other | ||
OS: | Linux | ||
What kind of report is it?: | --- | What type of bug is this?: | --- |
Who will be affected by this bug?: | --- | How will those affected feel about the bug?: | --- |
User Pain: | Enterprise Customer affected?: | ||
School Customer affected?: | ISV affected?: | ||
Waiting Support: | Flags outvoted (downgraded) after PO Review: | ||
Ticket number: | Bug group (optional): | Large environments | |
Max CVSS v3 score: | |||
Attachments: |
umc-printers.patch
suggestions umc-printers.patch |
Description
Felix Botner
2013-12-20 10:19:59 CET
Ticket: #2013121721002391 Happened now again, in a UCS@School environment. Ticket#2016041521000208 AFAIK there is no real version "UNSTABLE". Setting Version to 4.0 because that's what is used in the last mentioned ticket (probably also valid for 4.1, but I didn't test that). first we need a patch for the customer, that fixes the long access time in the UMC module Created attachment 7607 [details]
umc-printers.patch
apply patch with:
-> patch -p1 /usr/share/pyshared/univention/management/console/modules/printers/__init__.py umc-printers.patch
-> /etc/init.d/univention-management-console-server restart
Modified list_quota() in printers/__init__.py. repykota can't be used here (truncates usernames after 15 characters). Instead the PyKotaTool and pykota.reporter python libs are used to generate a html report (with full usernames, repykota does not support html reports). lxml.html is used to parse the html ouput. univention-printserver: r68843 YAML: univention-printserver.yaml The patch works and is much faster. But in case postgres is down the error message is the following: """ Die Anfrage konnte nicht ausgeführt werden. Fehlernachricht des Servers: Die Verbindung zur Print-Quota Postgres Datenbank konnte nicht hergestellt werden: konnte nicht mit dem Server verbinden: Verbindungsaufbau abgelehnt Läuft der Server auf dem Host »localhost« (::1) und akzeptiert er TCP/IP-Verbindungen auf Port 5432? konnte nicht mit dem Server verbinden: Verbindungsaufbau abgelehnt Läuft der Server auf dem Host »localhost« (127.0.0.1) und akzeptiert er TCP/IP-Verbindungen auf Port 5432? --- the most probable cause of your problem is that PostgreSQL is down, or doesn't accept incoming connections because you didn't configure it as explained in PyKota's documentation. """ → The message contains duplicated sentences and blames the user, that's not good. Please only log the exception to MODULE.error() but don't expose it to the user. The first sentence is enough. Maybe add 'Please make sure the postgres service is running and reachable.'. Created attachment 7617 [details]
suggestions
(In reply to Florian Best from comment #8) > Created attachment 7617 [details] > suggestions OK, And another thing, reportTool.deferredInit() calls os.seteuid(pykota), so after opening the quota page the umc process is owned by the pykota user, this is not good. Added a "finally: reportTool.regainPriv()" after the pykota stuff. Created attachment 7624 [details]
umc-printers.patch
new version of the patch with fixed pykota call (reportTool.regainPriv())
(In reply to Felix Botner from comment #10) > Created attachment 7624 [details] > umc-printers.patch OK > new version of the patch with fixed pykota call (reportTool.regainPriv()) OK: owner of the process is set back to "0". |