Seafile 8 OCM api error

Hi,
please help me with the problem. In my configuration, there are 2 servers running on a VPN wireguard network. One server has an ip of 10.0.0.5 and another is 10.0.0.6. I need to share a library from one server to another, but I keep getting an error:
POST /api/v2.1/ocm/shares-prepare/ 500

seahub_settings.py:
FILE_SERVER_ROOT = 'https://wgbox.xyz/seafhttp'

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'seahub-db',
    'USER': 'seafile',
    'PASSWORD': '',
    'HOST': '127.0.0.1',
    'PORT': '3306'
}

}

ENABLE_OCM = True
#OCM_PROVIDER_ID = '2d9a96da-de38-44bf-b899-71db349731e3' # the unique id of this server
OCM_REMOTE_SERVERS = [
{
    "server_name": "main",
    "server_url": "https://warehouse.com/", # should ends with '/'
},

]

OCM_PROVIDER_ID was commented out, for tests, don’t know if this is needed and where to get id. I tried to write the one that is listed on the site, I tried to generate it through uuidgen, with no results. (Address warehouse .com is resolved by unbound + pihole local dns). Second server has the same config only another address.
nginx configuration is standard and the same on both servers except for the address:

server {
    listen       80;
    server_name  warehouse.com;
    rewrite ^https://warehouse.com$request_uri? permanent;
    server_tokens off;
}
server {
    listen 443 ssl http2;
    server_name warehouse.com;

    ssl_certificate /etc/nginx/ssl/warehouse.com/cert.pem;
    ssl_certificate_key /etc/nginx/ssl/warehouse.com/cert.key;
    ssl_dhparam /etc/nginx/ssl/warehouse.com/dhparam.pem;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:5m;


# secure settings (A+ at SSL Labs ssltest at time of writing)
# see https://wiki.mozilla.org/Security/Server_Side_TLS#Nginx
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-SEED-SHA:DHE-RSA-CAMELLIA128-SHA:HIGH:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS';
ssl_prefer_server_ciphers on;

proxy_set_header X-Forwarded-For $remote_addr;

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
server_tokens off;

location / {
    proxy_pass         http://127.0.0.1:8000;
    proxy_set_header   Host $host;
    proxy_set_header   X-Real-IP $remote_addr;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Host $server_name;
    proxy_set_header   X-Forwarded-Proto https;

    access_log      /var/log/nginx/seahub.access.log;
    error_log       /var/log/nginx/seahub.error.log;

    proxy_read_timeout  1200s;

    client_max_body_size 0;
}

location /seafhttp {
    rewrite ^/seafhttp(.*)$ $1 break;
    proxy_pass http://127.0.0.1:8082;
    client_max_body_size 0;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_connect_timeout  36000s;
    proxy_read_timeout  36000s;
    proxy_send_timeout  36000s;
    send_timeout  36000s;
}
location /media {
    root /opt/seafile/seafile-server-latest/seahub;
}

}

Can you add DEBUG = True to seahub_settings.py, restart the server? Then use Chrome’s debug mode to check the details of the network request with 500 errior.

xhr.js:160 POST https://wgbox.xyz/api/v2.1/ocm/shares-prepare/ 500
(anonymous) @ xhr.js:160
e.exports @ xhr.js:11
e.exports @ dispatchRequest.js:57
Promise.then (async)
s.request @ Axios.js:51
i.forEach.s.<computed> @ Axios.js:71
(anonymous) @ bind.js:9
value @ seafile-api.js:2626
OCMShare @ share-to-other-server.js:147
value @ Button.js:40
m @ react-dom.production.min.js:15
E @ react-dom.production.min.js:15
(anonymous) @ react-dom.production.min.js:16
k @ react-dom.production.min.js:16
L @ react-dom.production.min.js:17
O @ react-dom.production.min.js:17
A @ react-dom.production.min.js:17
vn @ react-dom.production.min.js:79
ue @ react-dom.production.min.js:285
wn @ react-dom.production.min.js:81
kn @ react-dom.production.min.js:83
Sn @ react-dom.production.min.js:82
t.unstable_runWithPriority @ scheduler.production.min.js:18
Bi @ react-dom.production.min.js:119
Ks @ react-dom.production.min.js:221
En @ react-dom.production.min.js:80

{"ocm_share_list":[{"id":1,"shared_secret":"vd1fjnwtlrd7704u97ozro2","from_user":"cloudguard.project@protonmail.com","to_user":"dsfsdfds","to_server_url":"https://wgbox.xyz/","repo_id":"34f9cfad-adf5-455d-8582-ec68093b032e","repo_name":"\u041c\u043e\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430","path":"/","permission":"rw","ctime":"2021-03-04T07:57:45+00:00","to_server_name":null}]}

image

Second server send only: {"ocm_share_list":[]}

log from nginx:
10.0.0.3 - - [05/Mar/2021:19:38:02 +0000] “GET /api/v2.1/notifications/ HTTP/2.0” 200 51 “https://warehouse.com/my-libs/” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”
10.0.0.3 - - [05/Mar/2021:19:38:05 +0000] “GET /api/v2.1/repos/dd983532-da08-4903-b26f-34cc4495e0fc/ HTTP/2.0” 200 443 “https://warehouse.com/my-libs/” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”
10.0.0.3 - - [05/Mar/2021:19:38:05 +0000] “GET /api2/repos/dd983532-da08-4903-b26f-34cc4495e0fc/dir/shared_items/?p=%2F&share_type=user HTTP/2.0” 200 2 “https://warehouse.com/my-libs/” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”
10.0.0.3 - - [05/Mar/2021:19:38:06 +0000] “GET /api/v2.1/ocm/shares-prepare/?repo_id=dd983532-da08-4903-b26f-34cc4495e0fc HTTP/2.0” 200 21 “https://warehouse.com/my-libs/” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”
10.0.0.3 - - [05/Mar/2021:19:38:11 +0000] “POST /api/v2.1/ocm/shares-prepare/ HTTP/2.0” 500 285 “https://warehouse.com/my-libs/” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”
~

I found a solution. OCM and Django doesn’t work with self signed certificates and an error occurs. In my case, I disabled one self-signed certificate on the server, which is inside the wireguard. On the second server, I have a letsencrypt certificate, and this server, as I wanted, now quietly shares its folder on the internal server without ssl.

Yes, and one more thing, now that everything is working, I was disappointed with the functionality, because the maximum that can be done with a shared library is to download files and upload files to it. Initially, I assumed that it would be possible, as in all libraries, to move files from one library to another, this would close the need to think about the issue of synchronizing two servers.