"Internal server error: The module process died unexpectedly." after adding users using udm

A few weeks ago, I added two users using udm (specific command see below) and since then I always get

Internal server error: The module process died unexpectedly.

In /var/log/univention/management-console-server.log I see these lines:

12.07.21 12:46:49.653  MAIN        ( PROCESS ) : running: ['/usr/bin/python2.7', '/usr/sbin/univention-management-console-module', '-m', 'udm', '-s', '/var/run/univention-management-console/2766-1626086809653.socket', '-d', '2', '-l', 'en_US.UTF-8']
12.07.21 12:46:49.667  MAIN        ( PROCESS ) : LDAP bind for user 'uid=Administrator,cn=users,dc=example,dc=com'.
12.07.21 12:47:01.449  MAIN        ( WARN    ) : Socket died (module=udm)
12.07.21 12:47:01.449  MAIN        ( WARN    ) : Module process udm died (pid: 15758, exit status: -1, signal: -1, status: -1)
12.07.21 12:47:01.449  MAIN        ( WARN    ) : Cleaning up requests
12.07.21 12:47:01.449  MAIN        ( WARN    ) : Invalidating all pending requests 162608682093190-160
12.07.21 12:47:01.449  MAIN        ( WARN    ) : Remove inactivity timer
12.07.21 12:47:01.449  MAIN        ( PROCESS ) : ModuleProcess: stopping 15758
12.07.21 12:47:01.449  MAIN        ( WARN    ) : Socket died (module=udm)

12.07.21 12:47:56.505  MAIN        ( PROCESS ) : running: ['/usr/bin/python2.7', '/usr/sbin/univention-management-console-module', '-m', 'udm', '-s', '/var/run/univention-management-console/2766-1626086876504.socket', '-d', '2', '-l', 'en_US.UTF-8']
12.07.21 12:47:57.786  MAIN        ( WARN    ) : Socket died (module=udm)
12.07.21 12:47:57.786  MAIN        ( WARN    ) : Module process udm died (pid: 15900, exit status: -1, signal: -1, status: -1)
12.07.21 12:47:57.786  MAIN        ( WARN    ) : Cleaning up requests
12.07.21 12:47:57.786  MAIN        ( WARN    ) : Invalidating all pending requests 162608687648812-161
12.07.21 12:47:57.787  MAIN        ( WARN    ) : Remove inactivity timer
12.07.21 12:47:57.787  MAIN        ( PROCESS ) : ModuleProcess: stopping 15900
12.07.21 12:47:57.787  MAIN        ( WARN    ) : Socket died (module=udm)

As I said, there were two new accounts. When scrolling the user account list, the error appears twice, each time on querying the server for fetching the next few accounts. The first account is in the first batch of entries to be fetched, the second one in the second batch.

udm users/user create --set username="first.last" --set firstname="First" --set lastname="Last" \ 
    --set displayName="First Last" --position "cn=Kollegium,cn=users,dc=example,dc=com" \ 
    --set password='^T@/KNX;QC{2PrJ+hwGn{lF&' --set description="Job Title" --set department="Team Service" \ 
    --set secretary="uid=superior_first.superior_last,cn=Kollegium,cn=users,dc=example,dc=com" \ 
    --set groups="cn=Team Service,cn=Organisation,cn=groups,dc=example,dc=com" \ 
    --set mailPrimaryAddress="first.last@example.com" --set e-mail="first.last@example.com" \ 
    --set PasswordRecoveryEmail="first.last@example.com" --set PasswordRecoveryEmailVerified=TRUE \ 
    --set phone="+49<redacted>"

The password has already been changed, so I won’t redact it. Maybe the problem is in there. The command executed without error message (disclaimer: it did. I am just not sure if this is the correct entry from the history, but it’s the first one found using Ctrl+r, so it should be the last one used, which completed successfully).

In /var/log/univention/management-console-module-udm.log I get:

12.07.21 13:03:57.547  DEBUG_INIT
12.07.21 13:03:58.035  MODULE      ( PROCESS ) : Loading python module.
12.07.21 13:03:58.185  MODULE      ( PROCESS ) : Imported python module.
12.07.21 13:03:58.185  MODULE      ( PROCESS ) : Module instance created.
12.07.21 13:03:58.185  MODULE      ( PROCESS ) : Module socket initialized.
12.07.21 13:03:58.203  MODULE      ( PROCESS ) : Setting auth type to None
12.07.21 13:03:58.203  MODULE      ( PROCESS ) : Setting auth type to None
12.07.21 13:03:58.204  MODULE      ( PROCESS ) : Setting auth type to None
12.07.21 13:03:58.204  MODULE      ( PROCESS ) : Setting auth type to None
12.07.21 13:03:58.206  MODULE      ( PROCESS ) : Setting user LDAP DN u'uid=Administrator,cn=users,dc=secuinfra,dc=com'
12.07.21 13:03:58.206  MODULE      ( PROCESS ) : Setting auth type to None
12.07.21 13:03:58.209  MODULE      ( PROCESS ) : Initializing module.
12.07.21 13:03:58.222  MAIN        ( PROCESS ) : LDAP bind for user u'uid=Administrator,cn=users,dc=secuinfra,dc=com'.
12.07.21 13:04:03.150  MAIN        ( WARN    ) : Shutting down all open connections
12.07.21 13:04:03.156  MODULE      ( ERROR   ) : Traceback (most recent call last):
  File "/usr/sbin/univention-management-console-module", line 120, in <module>
    notifier.loop()
  File "/usr/lib/python2.7/dist-packages/notifier/nf_generic.py", line 304, in loop
    step()
  File "/usr/lib/python2.7/dist-packages/notifier/nf_generic.py", line 295, in step
    __min_timer = dispatch.dispatcher_run()
  File "/usr/lib/python2.7/dist-packages/notifier/dispatch.py", line 75, in dispatcher_run
    if not disp():
  File "/usr/lib/python2.7/dist-packages/notifier/threads.py", line 161, in _simple_threads_dispatcher
    task.announce()
  File "/usr/lib/python2.7/dist-packages/notifier/threads.py", line 139, in announce
    self._callback(self, self._result)
  File "/usr/lib/python2.7/dist-packages/notifier/__init__.py", line 104, in __call__
    return self._function(*tmp, **self._kwargs)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 298, in thread_finished_callback
    self.finished(request.id, result)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 490, in finished
    self.result(res)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 494, in result
    self.signal_emit('success', response)
  File "/usr/lib/python2.7/dist-packages/notifier/signals.py", line 84, in signal_emit
    self.__signals[signal].emit(*args)
  File "/usr/lib/python2.7/dist-packages/notifier/signals.py", line 49, in emit
    cb(*args)
  File "/usr/lib/python2.7/dist-packages/notifier/__init__.py", line 104, in __call__
    return self._function(*tmp, **self._kwargs)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/protocol/modserver.py", line 141, in _reply
    self.response(msg)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/protocol/modserver.py", line 378, in response
    self.__queue += bytes(msg)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/protocol/message.py", line 140, in __str__
    return self.__bytes__()
  File "/usr/lib/python2.7/dist-packages/univention/management/console/protocol/message.py", line 342, in __bytes__
    return Message._formattedMessage(self._id, self._type, self.mimetype, self.command, body, self.arguments)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/protocol/message.py", line 122, in _formattedMessage
    data = json.dumps(body)
  File "/usr/lib/python2.7/json/__init__.py", line 244, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
    return _iterencode(o, 0)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x82 in position 1: invalid start byte

Same error message in both cases. I guess, it would be helpful to know the string that causes that error. Is there a way to switch on debugging?

Further investigation revealed that I’m an idiot. But writing down all those information helped at least.

The problem wasn’t caused by those two new user accounts but by two accounts I used for experimenting with S/MIME certificates. Because the LDAP attribute SMIMECertificate contained binary data the udm module users/user failed on reading these accounts. It was just a coincidence that these two test accounts happened to be in the same batches as the two new accounts.

And of course I didn’t use any of Univention’s tools to get those binary certificates into the LDAP but Apache Directory Studio.

I close my case.