Bug 50174 - [UDM HTTP API] settings/data objects cannot be accessed, because Base64Bzip2BinaryProperty(data) is not JSON serializable
[UDM HTTP API] settings/data objects cannot be accessed, because Base64Bzip2B...
Status: CLOSED INVALID
Product: UCS
Classification: Unclassified
Component: UDM - REST API
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: Florian Best
Daniel Tröder
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-09-11 00:03 CEST by Daniel Tröder
Modified: 2019-09-22 15:51 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
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):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2019-09-11 00:03:28 CEST
When accessing a settings/data object (https://m66.uni.dtr/univention/udm/settings/data/cn%3Ducsschool-join-hook.py%2Ccn%3Ddata%2Ccn%3Dunivention%2Cdc%3Duni%2Cdc%3Ddtr) a HTTP 500 happens:

--------------------------------------------------------------

HTTP-Error 500:
Base64Bzip2BinaryProperty(data) is not JSON serializable

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/tornado/web.py", line 1469, in _execute
    result = yield result
  File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 1015, in run
    value = future.result()
  File "/usr/lib/python2.7/dist-packages/tornado/concurrent.py", line 237, in result
    raise_exc_info(self._exc_info)
  File "/usr/lib/python2.7/dist-packages/tornado/gen.py", line 1024, in run
    yielded = self.gen.send(value)
  File "/usr/lib/pymodules/python2.7/univention/management/modules/udm/module.py", line 2594, in get
    self.content_negotiation(props)
  File "/usr/lib/pymodules/python2.7/univention/management/modules/udm/module.py", line 507, in content_negotiation
    self.finish(codec(formatter(response)))
  File "/usr/lib/pymodules/python2.7/univention/management/modules/udm/module.py", line 627, in get_html
    pre.text = json.dumps(r, indent=4)
  File "/usr/lib/python2.7/json/__init__.py", line 251, in dumps
    sort_keys=sort_keys, **kw).encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 209, in encode
    chunks = list(chunks)
  File "/usr/lib/python2.7/json/encoder.py", line 434, in _iterencode
    for chunk in _iterencode_dict(o, _current_indent_level):
  File "/usr/lib/python2.7/json/encoder.py", line 408, in _iterencode_dict
    for chunk in chunks:
  File "/usr/lib/python2.7/json/encoder.py", line 408, in _iterencode_dict
    for chunk in chunks:
  File "/usr/lib/python2.7/json/encoder.py", line 442, in _iterencode
    o = _default(o)
  File "/usr/lib/python2.7/json/encoder.py", line 184, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: Base64Bzip2BinaryProperty(data) is not JSON serializable
Comment 1 Florian Best univentionstaff 2019-09-11 09:29:52 CEST
You tested this with the old version?!
There is no "Base64Bzip2BinaryProperty" in the lastest code anymore!
It works with the latest code on my machine.
Comment 2 Daniel Tröder univentionstaff 2019-09-12 11:16:18 CEST
OK: settings/data objects canbe accessed and show the "data" property as a base64 encoded string.
Comment 3 Florian Best univentionstaff 2019-09-18 14:53:31 CEST
<http://errata.software-univention.de/ucs/4.4/282.html>