Error when trying to share with remote server

I’ve got error when trying to share library with remote server, both are community dockerized version 9.0.4 :

2022-05-04 11:33:21,732 [ERROR] django.request:224 log_response Internal Server Error: /api/v2.1/ocm/shares-prepare/
Traceback (most recent call last):
File "/opt/seafile/seafile-server-9.0.4/seahub/thirdpart/django/core/handlers/", line 47, in inner
response = get_response(request)
  File "/opt/seafile/seafile-server-9.0.4/seahub/thirdpart/django/core/handlers/", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/seafile/seafile-server-9.0.4/seahub/thirdpart/django/views/decorators/", line 54, in wrapped_view
return view_func(*args, **kwargs)
  File "/opt/seafile/seafile-server-9.0.4/seahub/thirdpart/django/views/generic/", line 70, in view
return self.dispatch(request, *args, **kwargs)
  File "/opt/seafile/seafile-server-9.0.4/seahub/thirdpart/rest_framework/", line 505, in dispatch
response = self.handle_exception(exc)
  File "/opt/seafile/seafile-server-9.0.4/seahub/thirdpart/rest_framework/", line 465, in handle_exception
  File "/opt/seafile/seafile-server-9.0.4/seahub/thirdpart/rest_framework/", line 476, in raise_uncaught_exception
raise exc
  File "/opt/seafile/seafile-server-9.0.4/seahub/thirdpart/rest_framework/", line 502, in dispatch
response = handler(request, *args, **kwargs)
  File "/opt/seafile/seafile-server-9.0.4/seahub/seahub/api2/endpoints/", line 364, in post
consumer_protocol = get_remote_protocol(to_server_url + OCM_PROTOCOL_URL)
  File "/opt/seafile/seafile-server-9.0.4/seahub/seahub/api2/endpoints/", line 51, in get_remote_protocol
return json.loads(response.text)
  File "/usr/lib/python3.8/json/", line 357, in loads
return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/json/", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I’m also having the same problem, with both servers 9.0.5 and dockerized.

Same issue with Seafile Community 9.0.6 and Pro 9.0.6.

Changelog from 9.0.8:

  • Fix a bug in OCM sharing

I updated two servers to 9.0.8 today, one is community and one is pro, OCM is still broken with same error as OP has.