Bug 50184 - [UDM HTTP API] cannot create shares/share object (HTTP 500)
[UDM HTTP API] cannot create shares/share object (HTTP 500)
Status: CLOSED DUPLICATE of bug 50047
Product: UCS
Classification: Unclassified
Component: UDM - REST API
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-09-12 11:09 CEST by Daniel Tröder
Modified: 2019-09-22 15:51 CEST (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):
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-12 11:09:21 CEST
curl -s -k -X POST -H "Accept:application/json" -H "Content-Type:application/json" -d '{
  "options": {
    "samba": true,
    "nfs": false
  },
  "policies": {},
  "position": "cn=shares,ou=DEMOSCHOOL,dc=uni,dc=dtr",
  "properties": {
    "group": 10426,
    "path": "/home/DEMOSCHOOL/groups/test01",
    "name": "test01"
  }
}' -u Administrator:univention 'https://m66.uni.dtr/univention/udm/shares/share/' | python -m json.tool
{
    "_links": {
        "curies": [
            {
                "href": "https://m66.uni.dtr/univention/udm/relation/{rel}",
                "name": "udm",
                "templated": true
            }
        ]
    },
    "error": {
        "code": 500,
        "error": {},
        "message": "expected string or buffer",
        "title": "",
        "traceback": "Traceback (most recent call last):\n  File \"/usr/lib/python2.7/dist-packages/tornado/web.py\", line 1469, in _execute\n    result = yield result\n  File \"/usr/lib/python2.7/dist-packages/tornado/gen.py\", line 1015, in run\n    value = future.result()\n  File \"/usr/lib/python2.7/dist-packages/tornado/concurrent.py\", line 237, in result\n    raise_exc_info(self._exc_info)\n  File \"/usr/lib/python2.7/dist-packages/tornado/gen.py\", line 1021, in run\n    yielded = self.gen.throw(*exc_info)\n  File \"/usr/lib/pymodules/python2.7/univention/management/modules/udm/module.py\", line 2430, in post\n    obj = yield obj.create(object_type)\n  File \"/usr/lib/python2.7/dist-packages/tornado/gen.py\", line 1015, in run\n    value = future.result()\n  File \"/usr/lib/python2.7/dist-packages/tornado/concurrent.py\", line 237, in result\n    raise_exc_info(self._exc_info)\n  File \"/usr/lib/python2.7/dist-packages/tornado/gen.py\", line 285, in wrapper\n    yielded = next(result)\n  File \"/usr/lib/pymodules/python2.7/univention/management/modules/udm/module.py\", line 2774, in create\n    self.set_properties(module, obj)\n  File \"/usr/lib/pymodules/python2.7/univention/management/modules/udm/module.py\", line 2841, in set_properties\n    self.sanitize_arguments(PropertiesSanitizer(), self, module=module, obj=obj)\n  File \"/usr/lib/pymodules/python2.7/univention/management/modules/udm/module.py\", line 497, in sanitize_arguments\n    return sanitizer.sanitize(*args, **kwargs)\n  File \"/usr/lib/pymodules/python2.7/univention/management/modules/udm/module.py\", line 241, in sanitize\n    properties = super(PropertiesSanitizer, self).sanitize('properties', {'properties': properties})\n  File \"/usr/lib/pymodules/python2.7/univention/management/console/modules/sanitizers.py\", line 186, in sanitize\n    new_value = self._sanitize(value, name, further_arguments)\n  File \"/usr/lib/pymodules/python2.7/univention/management/modules/udm/module.py\", line 190, in _sanitize\n    altered_value[attr] = sanitizer.sanitize(attr, value)\n  File \"/usr/lib/pymodules/python2.7/univention/management/console/modules/sanitizers.py\", line 186, in sanitize\n    new_value = self._sanitize(value, name, further_arguments)\n  File \"/usr/lib/pymodules/python2.7/univention/management/modules/udm/module.py\", line 300, in _sanitize\n    return codec.encode_json(value)\n  File \"/usr/lib/pymodules/python2.7/univention/admin/types.py\", line 133, in encode_json\n    return self.encode(self.from_json_type(value))\n  File \"/usr/lib/pymodules/python2.7/univention/admin/types.py\", line 127, in encode\n    return self.encode_value(value)\n  File \"/usr/lib/pymodules/python2.7/univention/admin/types.py\", line 178, in encode_value\n    return self.syntax.parse(value)\n  File \"/usr/lib/pymodules/python2.7/univention/admin/syntax.py\", line 475, in parse\n    if not text or not self.regex or self.regex.match(text) is not None:\nTypeError: expected string or buffer\n"
    }
}
Comment 1 Florian Best univentionstaff 2019-09-16 16:32:38 CEST
The syntax class UserID and GroupID were missing to parse integers when they use the admin.types.IntegerType.

univention-directory-manager-modules (14.0.13-16)
c79a46098309 | Bug #50047: Bug #50184: parse integer values in UserID and GroupID syntax class

*** This bug has been marked as a duplicate of bug 50047 ***
Comment 2 Florian Best univentionstaff 2019-09-18 14:54:30 CEST
<http://errata.software-univention.de/ucs/4.4/282.html>