Bug 27850 - Traceback im UMC-web-server bei GET requests
Traceback im UMC-web-server bei GET requests
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 3.0
Other Linux
: P4 normal (vote)
: UCS 3.1
Assigned To: Florian Best
Alexander Kläser
: interim-1
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-09 10:24 CEST by Florian Best
Modified: 2012-12-12 21:08 CET (History)
1 user (show)

See Also:
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): Cleanup
Max CVSS v3 score:
best: Patch_Available+


Attachments
univention-management-console-web-server.patch (11.42 KB, patch)
2012-07-28 15:13 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2012-07-09 10:24:21 CEST
Momentan sind 3 verschiedene Arten von GET Requests erlaubt, die alle fehlschlagen, da die übergabe des json parameters ein string ist und kein json-dict: 

GET /umcp/get/categories/list

HTTP Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/cherrypy/_cprequest.py", line 606, in respond
    cherrypy.response.body = self.handler()
  File "/usr/lib/pymodules/python2.6/cherrypy/_cpdispatch.py", line 25, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/sbin/univention-management-console-web-server", line 358, in default
    req = self.get_request( cherrypy.request, json )
  File "/usr/sbin/univention-management-console-web-server", line 405, in get_request
    req = umcp.Request( 'GET', arguments = [ args ], options = json.get( 'options', {} ) )
AttributeError: 'str' object has no attribute 'get'
Comment 1 Florian Best univentionstaff 2012-07-09 17:11:21 CEST
wget -O - --header 'Cookie: UMCSessionId=foobar;' http://master/umcp/get/modules/list
--2012-07-07 04:10:43--  http://master/umcp/get/modules/list
Auflösen des Hostnamen master.ucs.test... 10.200.27.100
Verbindungsaufbau zu master.ucs.test|10.200.27.100|:80... verbunden.
HTTP-Anforderung gesendet, warte auf Antwort... 500 Internal Server Error
2012-07-07 04:10:43 FEHLER 500: Internal Server Error.
Comment 2 Florian Best univentionstaff 2012-07-12 10:43:30 CEST
Das tritt auf, wenn Content-Type != application/json oder der Content-Length header nicht gesetzt ist, da json dann ein leerer string ist.
Das könnte eventuell durch josn = simplejson.loads('{}') ersetzt werden.
Comment 3 Florian Best univentionstaff 2012-07-28 15:13:21 CEST
Created attachment 4566 [details]
univention-management-console-web-server.patch

patch + allgemeiner cleanup vom web-server
Comment 4 Alexander Kläser univentionstaff 2012-08-06 13:29:29 CEST
Code-Review des Patches → OK mit den besprochenen Änderungen.

Ich habe den Bug auf 3.1 getaggt, da die vorgeschlagenen Vereinfachungen sehr hilfreich sind.
Comment 5 Florian Best univentionstaff 2012-08-06 15:54:15 CEST
(In reply to comment #4)
> Code-Review des Patches → OK mit den besprochenen Änderungen.
OK, patch mit besprochenen Änderungen eingespielt.
univention-management-console-frontend (2.0.3-1) unstable; urgency=low
   * univention-management-conosole-web-server cleanup (Bug #27850)
Comment 6 Alexander Kläser univentionstaff 2012-09-17 14:11:00 CEST
QA: GET-Befehle funktionieren soweit. Die Änderungen wurden bereits gereviewed. Es fehlt nur noch ein Changelog-Eintrag.
Comment 7 Florian Best univentionstaff 2012-09-17 14:45:16 CEST
Changelog erstellt
Comment 8 Alexander Kläser univentionstaff 2012-09-17 15:07:24 CEST
(In reply to comment #7)
> Changelog erstellt

QA: OK.
Comment 9 Stefan Gohmann univentionstaff 2012-12-12 21:08:05 CET
UCS 3.1-0 has been released: 
 http://forum.univention.de/viewtopic.php?f=54&t=2125

If this error occurs again, please use "Clone This Bug".