Univention Bugzilla – Bug 53549
Renaming school class to existing class throws Internal server error
Last modified: 2022-07-04 11:55:57 CEST
If you try to rename a school class to a class that already exists, you get a 500 error code. The 400 error from udm rest api is not handled well in kelvin: 2021-07-05 15:30:53 INFO Modifying SchoolClass(name='BREMEN-School1-2b', school='BREMEN-School1', dn='cn=BREMEN-School1-2b,cn=klassen,cn=schueler,cn=groups,ou=BREMEN-School1,dc=realm1,dc=intranet', old_dn='cn=BREMEN-School1-5c,cn=klassen,cn=schueler,cn=groups,ou=BREMEN-School1,dc=realm1,dc=intranet') 2021-07-05 15:30:53 INFO 172.17.42.1:41324 - "PUT /ucsschool/kelvin/v1/classes/BREMEN-School1/5c HTTP/1.1" 500 2021-07-05 15:30:53 ERROR Exception in ASGI application Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 369, in run_asgi result = await app(self.scope, self.receive, self.send) File "/usr/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 59, in __call__ return await self.app(scope, receive, send) File "/usr/lib/python3.8/site-packages/fastapi/applications.py", line 199, in __call__ await super().__call__(scope, receive, send) File "/usr/lib/python3.8/site-packages/starlette/applications.py", line 111, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__ raise exc from None File "/usr/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__ await self.app(scope, receive, _send) File "/usr/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__ raise exc from None File "/usr/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__ await self.app(scope, receive, sender) File "/usr/lib/python3.8/site-packages/starlette/routing.py", line 566, in __call__ await route.handle(scope, receive, send) File "/usr/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle await self.app(scope, receive, send) File "/usr/lib/python3.8/site-packages/starlette/routing.py", line 41, in app response = await func(request) File "/usr/lib/python3.8/site-packages/fastapi/routing.py", line 201, in app raw_response = await run_endpoint_function( File "/usr/lib/python3.8/site-packages/fastapi/routing.py", line 148, in run_endpoint_function return await dependant.call(**values) File "/kelvin/kelvin-api/ucsschool/kelvin/routers/school_class.py", line 342, in complete_update await sc_current.modify(udm) File "/kelvin/ucs-school-lib/modules/ucsschool/lib/models/base.py", line 621, in modify success = await self.modify_without_hooks(lo, validate, move_if_necessary) File "/kelvin/ucs-school-lib/modules/ucsschool/lib/models/group.py", line 254, in modify_without_hooks success = await super(SchoolClass, self).modify_without_hooks(lo, validate, move_if_necessary) File "/kelvin/ucs-school-lib/modules/ucsschool/lib/models/base.py", line 649, in modify_without_hooks await self.do_modify(udm_obj, lo) File "/kelvin/ucs-school-lib/modules/ucsschool/lib/models/base.py", line 684, in do_modify await udm_obj.save() File "/usr/lib/python3.8/site-packages/udm_rest_client/base_http.py", line 683, in save _, status, header = await self._udm_module.session.call_openapi(**kwargs) File "/usr/lib/python3.8/site-packages/udm_rest_client/base_http.py", line 477, in call_openapi raise APICommunicationError( udm_rest_client.exceptions.APICommunicationError: [HTTP 400]: for operation 'update' on 'groups/group' with arguments {'groups_group': {'options': {'ucsschoolAdministratorGroup': False, 'samba': True, 'posix': True, 'ucsschoolImportGroup': False}, 'position': 'cn=klassen,cn=schueler,cn=groups,ou=BREMEN-School1,dc=realm1,dc=intranet', 'properties': {'name': 'BREMEN-School1-2b'}}, 'dn': 'cn=BREMEN-School1-5c,cn=klassen,cn=schueler,cn=groups,ou=BREMEN-School1,dc=realm1,dc=intranet'}: Bad Request: {}