How to connect cluster nextcloud to MSOffice/CODE

Please help me…

I have 2 nextcloud servers in front of them is a reverse proxy. I tried both Haproxy and traefik2.

I’m trying to put together a structure like this

3 server sql-> 2 nextcloud → reversproxy + loadbalance (DNS test-nextcloud.exp.com)
CODE or MSOffice → reversproxy + loadbalance (DNS nxcode.exp.com)

When balancing is disabled, everything works.
When turning on/adding a server, connecting to the office service fails.

likely your load balancer doesn’t send connections from same endpoint/session to the same office instance. but such advanced setup is out of scope of this forum focused on SOHO topics. especially you don’t even ind to provide good logs and required troubleshooting info.

I use HAProxy with the following configuration:

backend_office
    balance url_param WOPISrc check_post
    hash-type consistent
    server srv-1 10.10.100.1:9980 check
    server srv-2 10.10.100.2:9980 check

frontend tcp or http ?

no mode is defined in the frontend, I do that in the backend.

mode http

HAproxy.conf

frontend sni
        bind *:443 ssl crt /etc/ssl/sss.pem
        mode http
        option forwardfor
        use_backend nxoos if { hdr(Host) -i nxoos.ss.ru }
        use_backend nextcloud if { hdr(Host) -i test-nextcloud.ss.ru }



backend nextcloud
       balance roundrobin
        cookie be_test-nextcloud.jedihome.ru insert indirect nocache
        acl url_discovery path /.well-known/caldav /.well-known/carddav
        server nx01 192.168.150.194:443 ssl cookie nx1
        server nx02 192.168.150.193:443 ssl cookie nx2

backend nxoos
        stick-table type ip size 50k expire 30m
        stick on src
        server nxoos 192.168.150.201:443 ssl

Nextcloud.conf

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'sql.test.lab',
    'password' => 'test',
    'port' => 6379,
  ),
  'overwriteprotocol' => 'https',
  'overwrite.cli.url' => 'https://test-nextcloud.ss.ru',
  'trusted_proxies' =>
  array (
    0 => 'traefik',
    1 => '192.168.150.191',
  ),
  'passwordsalt' => 's+',
  'secret' => 'Gkc8x117Wr/s',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'test-nextcloud.ss.ru',
  ),
  'datadirectory' => '/service/nextcloud/data/',
  'dbtype' => 'mysql',
  'version' => '25.0.13.2',
  'dbname' => 'nextcloud',
  'dbhost' => 'sql.test.lab',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nxcloud',
  'dbpassword' => 'nxcloud',
  'installed' => true,
  'instanceid' => 'ssssss',
);

HAProxy.log

fications HTTP/1.1"
May 16 18:42:09 TestHAProxy01 haproxy[14010]: 192.168.108.122:51384 [16/May/2024:18:42:09.173] sni~ nextcloud/nx01 0/0/1/50/51 401 1355 - - ---- 4/4/3/2/0 0/0 "PUT /ocs/v2.php/apps/user_status/api/v1/heartbeat?format=json HTTP/1.1"
May 16 18:42:09 TestHAProxy01 haproxy[14010]: 192.168.108.122:51385 [16/May/2024:18:42:09.182] sni~ nextcloud/nx01 0/0/1/49/50 401 1355 - - ---- 5/5/3/3/0 0/0 "PUT /ocs/v2.php/apps/user_status/api/v1/heartbeat?format=json HTTP/1.1"
May 16 18:42:09 TestHAProxy01 haproxy[14010]: 192.168.108.122:51383 [16/May/2024:18:42:09.210] sni~ nextcloud/nx01 0/0/2/43/45 304 782 - - ---- 5/5/3/3/0 0/0 "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1"
May 16 18:42:09 TestHAProxy01 haproxy[14010]: 192.168.108.122:51386 [16/May/2024:18:42:09.224] sni~ nextcloud/nx01 0/0/1/40/41 412 811 - - ---- 5/5/2/2/0 0/0 "PUT /ocs/v2.php/apps/user_status/api/v1/heartbeat?format=json HTTP/1.1"
May 16 18:42:09 TestHAProxy01 haproxy[14010]: 192.168.108.122:51387 [16/May/2024:18:42:09.239] sni~ nextcloud/nx01 0/0/1/26/27 412 811 - - ---- 5/5/1/1/0 0/0 "PUT /ocs/v2.php/apps/user_status/api/v1/heartbeat?format=json HTTP/1.1"
May 16 18:42:09 TestHAProxy01 haproxy[14010]: 192.168.108.122:51384 [16/May/2024:18:42:09.231] sni~ nextcloud/nx01 0/0/2/85/87 200 1401 - - ---- 5/5/0/0/0 0/0 "GET /index.php/csrftoken HTTP/1.1"
May 16 18:42:10 TestHAProxy01 haproxy[14010]: 192.168.108.122:51383 [16/May/2024:18:42:10.029] sni~ nextcloud/nx01 0/0/2/51/53 207 1501 - - ---- 5/5/0/0/0 0/0 "PROPFIND /remote.php/dav/files/test/1111.xlsx HTTP/1.1"
May 16 18:42:10 TestHAProxy01 haproxy[14010]: 192.168.108.122:51383 [16/May/2024:18:42:10.242] sni~ nextcloud/nx01 0/0/2/54/57 200 23045 - - ---- 2/2/0/0/0 0/0 "GET /index.php/apps/officeonline/index?fileId=626&requesttoken=AdUVCb8NUOsIWj3g3BSkbtZD3mdoQkK7FJNMeLGtUGo%3D%3AVLdcOcxZNp5JAHOM71LoP7ouiFIpbSDZUtwgTNLdPwk%3D&path=%2F1111.xlsx HTTP/1.1"
May 16 18:42:10 TestHAProxy01 haproxy[14010]: 192.168.108.122:51383 [16/May/2024:18:42:10.357] sni~ nextcloud/nx01 0/0/1/1/2 200 1536 - - ---- 1/1/0/0/0 0/0 "GET /apps/theming/css/default.css?v=47354877-0 HTTP/1.1"
May 16 18:42:10 TestHAProxy01 haproxy[14010]: 192.168.108.122:51383 [16/May/2024:18:42:10.419] sni~ nextcloud/nx01 0/0/2/4/7 200 36785 - - ---- 1/1/0/0/0 0/0 "GET /custom_apps/officeonline/js/document.js?v=69740904-0 HTTP/1.1"
May 16 18:42:10 TestHAProxy01 haproxy[14010]: 192.168.108.122:51383 [16/May/2024:18:42:10.754] sni~ nextcloud/nx01 0/0/2/34/36 200 885 - - ---- 1/1/0/0/0 0/0 "GET /cron.php HTTP/1.1"
May 16 18:42:11 TestHAProxy01 haproxy[14010]: 192.168.108.122:51392 [16/May/2024:18:42:11.268] sni~ nextcloud/nx01 0/0/2/26/28 302 928 - - ---- 3/3/0/0/0 0/0 "GET /index.php/apps/files/preview-service-worker.js HTTP/1.1"
May 16 18:42:12 TestHAProxy01 haproxy[14010]: 192.168.150.201:55772 [16/May/2024:18:42:12.792] sni/1: SSL handshake failure
May 16 18:42:13 TestHAProxy01 haproxy[14010]: 192.168.108.122:51391 [16/May/2024:18:42:10.842] sni~ nxoos/nxoos 0/0/2/1798/2517 200 36608 - - ---- 1/1/0/0/0 0/0 "POST /x/_layouts/xlviewerinternal.aspx?edit=1&ui=ru-Ru&WOPISrc=https%3A%2F%2Ftest-nextcloud.jedihome.ru%2Findex.php%2Fapps%2Fofficeonline%2Fwopi%2Ffiles%2F626_ocpb8rkf20ir&title=1111.xlsx&lang=ru&closebutton=1&revisionhistory=1 HTTP/1.1"
May 16 18:42:13 TestHAProxy01 haproxy[14010]: 192.168.108.122:51391 [16/May/2024:18:42:13.411] sni~ nxoos/nxoos 0/0/1/3/4 404 1708 - - ---- 1/1/0/0/0 0/0 "GET /x/_layouts/calibri.woff HTTP/1.1"
May 16 18:42:13 TestHAProxy01 haproxy[14010]: 192.168.108.122:51391 [16/May/2024:18:42:13.442] sni~ nxoos/nxoos 0/0/2/2/4 404 1708 - - ---- 1/1/0/0/0 0/0 "GET /x/_layouts/app_scripts/Ewa.tmcore.js?bn=421878040 HTTP/1.1"
May 16 18:42:13 TestHAProxy01 haproxy[14010]: 192.168.108.122:51402 [16/May/2024:18:42:13.456] sni~ nxoos/nxoos 0/0/2/2/4 404 1708 - - ---- 2/2/0/0/0 0/0 "GET /x/_layouts/calibri.ttf HTTP/1.1"
May 16 18:42:13 TestHAProxy01 haproxy[14010]: 192.168.108.122:51391 [16/May/2024:18:42:13.463] sni~ nxoos/nxoos 0/0/2/1/3 404 1708 - - ---- 2/2/0/0/0 0/0 "GET /x/_layouts/app_scripts/Ewa.tmcore.js?bn=421878040&retries=1 HTTP/1.1"
May 16 18:42:13 TestHAProxy01 haproxy[14010]: 192.168.108.122:51391 [16/May/2024:18:42:13.492] sni~ nxoos/nxoos 0/0/2/2/4 404 1708 - - ---- 2/2/0/0/0 0/0 "GET /x/_layouts/app_scripts/Ewa.tmcore.js?bn=421878040&retries=2 HTTP/1.1"

Nextcloud.log

{"reqId":"EzKA8Xgd5DZcyIGI2VOF","level":3,"time":"2024-05-14T10:22:39+00:00","remoteAddr":"172.18.0.2","user":"test","app":"officeonline","method":"GET","url":"/apps/officeonline/index?fileId=368&requesttoken=F%2FtweBFbk7qamBiaWAgVN1%2BkdjO4fF93oKmmMsMeWZ0%3D%3AT5oKLGE9p%2FSq%2B3b2M21ERAjDQgv3NRsz7ez1BrQnC7I%3D&path=%2Fdfsdf.xlsx","message":"cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://nxoos.jedihome.ru/hosting/discovery","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 OPR/109.0.0.0 (Edition Yx 05)","version":"25.0.13.2","exception":{"Exception":"GuzzleHttp\\Exception\\RequestException","Message":"cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://nxoos.jedihome.ru/hosting/discovery","Code":0,"Trace":[{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","line":158,"function":"createRejection","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::","args":[["GuzzleHttp\\Handler\\EasyHandle",["GuzzleHttp\\Psr7\\Stream"],[],null,"*** sensitive parameters replaced ***","*** sensitive parameters replaced ***",60,null,null],[60,"SSL certificate problem: unable to get local issuer certificate",0,"https://nxoos.jedihome.ru/hosting/discovery",null,"And 36 more entries, set log level to debug to see all entries"]]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","line":110,"function":"finishError","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::","args":[["GuzzleHttp\\Handler\\CurlHandler"],["GuzzleHttp\\Handler\\EasyHandle",["GuzzleHttp\\Psr7\\Stream"],[],null,"*** sensitive parameters replaced ***","*** sensitive parameters replaced ***",60,null,null],["GuzzleHttp\\Handler\\CurlFactory"]]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php","line":47,"function":"finish","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::","args":[["GuzzleHttp\\Handler\\CurlHandler"],["GuzzleHttp\\Handler\\EasyHandle",["GuzzleHttp\\Psr7\\Stream"],[],null,"*** sensitive parameters replaced ***","*** sensitive parameters replaced ***",60,null,null],["GuzzleHttp\\Handler\\CurlFactory"]]},{"file":"/var/www/html/lib/private/Http/Client/DnsPinMiddleware.php","line":114,"function":"__invoke","class":"GuzzleHttp\\Handler\\CurlHandler","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\\Http\\Client\\{closure}","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->","args":["get",["GuzzleHttp\\Psr7\\Uri"],["/service/nextcloud/data/files_external/rootcerts.crt",45,[true],true,["GuzzleHttp\\HandlerStack"],"And 6 more entries, set log level to debug to see all entries"]]},{"file":"/var/www/html/lib/private/Http/Client/Client.php","line":218,"function":"request","class":"GuzzleHttp\\Client","type":"->","args":["get","https://nxoos.jedihome.ru/hosting/discovery",["/service/nextcloud/data/files_external/rootcerts.crt",45,[true],["Nextcloud Server Crawler","gzip"],true]]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/DiscoveryManager.php","line":106,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["https://nxoos.jedihome.ru/hosting/discovery",[45,[true]]]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/DiscoveryManager.php","line":78,"function":"fetchFromRemote","class":"OCA\\Officeonline\\WOPI\\DiscoveryManager","type":"->","args":[]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/Parser.php","line":160,"function":"get","class":"OCA\\Officeonline\\WOPI\\DiscoveryManager","type":"->","args":[]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/Parser.php","line":217,"function":"getParsed","class":"OCA\\Officeonline\\WOPI\\Parser","type":"->","args":[]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/Parser.php","line":199,"function":"getUrlSrcByExtension","class":"OCA\\Officeonline\\WOPI\\Parser","type":"->","args":["external-https","xlsx","editnew"]},{"file":"/var/www/html/custom_apps/officeonline/lib/TokenManager.php","line":208,"function":"getUrlSrcForFile","class":"OCA\\Officeonline\\WOPI\\Parser","type":"->","args":[["OC\\Files\\Node\\File"],true]},{"file":"/var/www/html/custom_apps/officeonline/lib/Controller/DocumentController.php","line":241,"function":"getToken","class":"OCA\\Officeonline\\TokenManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"index","class":"OCA\\Officeonline\\Controller\\DocumentController","type":"->","args":["*** sensitive parameters replaced ***","/dfsdf.xlsx"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Officeonline\\Controller\\DocumentController"],"index"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Officeonline\\Controller\\DocumentController"],"index"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Officeonline\\Controller\\DocumentController","index",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["officeonline.document.index"]]},{"file":"/var/www/html/lib/base.php","line":1053,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/officeonline/index"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","Line":211,"CustomMessage":"--"}}
{"reqId":"xBrqU73HsDqEJA3G05E4","level":3,"time":"2024-05-14T10:22:42+00:00","remoteAddr":"172.18.0.2","user":"test","app":"officeonline","method":"GET","url":"/apps/officeonline/index?fileId=368&requesttoken=dGl5a77cZkTY9B2ptp1aWYWkFSYEKBdEs6rUca6xdW4%3D%3ALAgDP866Ugrol3PF3fgLKtLDIR5LYVMA%2Fu%2BHRdmIJ0E%3D&path=%2Fdfsdf.xlsx","message":"cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://nxoos.jedihome.ru/hosting/discovery","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 OPR/109.0.0.0 (Edition Yx 05)","version":"25.0.13.2","exception":{"Exception":"GuzzleHttp\\Exception\\RequestException","Message":"cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://nxoos.jedihome.ru/hosting/discovery","Code":0,"Trace":[{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","line":158,"function":"createRejection","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::","args":[["GuzzleHttp\\Handler\\EasyHandle",["GuzzleHttp\\Psr7\\Stream"],[],null,"*** sensitive parameters replaced ***","*** sensitive parameters replaced ***",60,null,null],[60,"SSL certificate problem: unable to get local issuer certificate",0,"https://nxoos.jedihome.ru/hosting/discovery",null,"And 36 more entries, set log level to debug to see all entries"]]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","line":110,"function":"finishError","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::","args":[["GuzzleHttp\\Handler\\CurlHandler"],["GuzzleHttp\\Handler\\EasyHandle",["GuzzleHttp\\Psr7\\Stream"],[],null,"*** sensitive parameters replaced ***","*** sensitive parameters replaced ***",60,null,null],["GuzzleHttp\\Handler\\CurlFactory"]]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php","line":47,"function":"finish","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::","args":[["GuzzleHttp\\Handler\\CurlHandler"],["GuzzleHttp\\Handler\\EasyHandle",["GuzzleHttp\\Psr7\\Stream"],[],null,"*** sensitive parameters replaced ***","*** sensitive parameters replaced ***",60,null,null],["GuzzleHttp\\Handler\\CurlFactory"]]},{"file":"/var/www/html/lib/private/Http/Client/DnsPinMiddleware.php","line":114,"function":"__invoke","class":"GuzzleHttp\\Handler\\CurlHandler","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\\Http\\Client\\{closure}","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->","args":["get",["GuzzleHttp\\Psr7\\Uri"],["/service/nextcloud/data/files_external/rootcerts.crt",45,[true],true,["GuzzleHttp\\HandlerStack"],"And 6 more entries, set log level to debug to see all entries"]]},{"file":"/var/www/html/lib/private/Http/Client/Client.php","line":218,"function":"request","class":"GuzzleHttp\\Client","type":"->","args":["get","https://nxoos.jedihome.ru/hosting/discovery",["/service/nextcloud/data/files_external/rootcerts.crt",45,[true],["Nextcloud Server Crawler","gzip"],true]]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/DiscoveryManager.php","line":106,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["https://nxoos.jedihome.ru/hosting/discovery",[45,[true]]]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/DiscoveryManager.php","line":78,"function":"fetchFromRemote","class":"OCA\\Officeonline\\WOPI\\DiscoveryManager","type":"->","args":[]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/Parser.php","line":160,"function":"get","class":"OCA\\Officeonline\\WOPI\\DiscoveryManager","type":"->","args":[]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/Parser.php","line":217,"function":"getParsed","class":"OCA\\Officeonline\\WOPI\\Parser","type":"->","args":[]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/Parser.php","line":199,"function":"getUrlSrcByExtension","class":"OCA\\Officeonline\\WOPI\\Parser","type":"->","args":["external-https","xlsx","editnew"]},{"file":"/var/www/html/custom_apps/officeonline/lib/TokenManager.php","line":208,"function":"getUrlSrcForFile","class":"OCA\\Officeonline\\WOPI\\Parser","type":"->","args":[["OC\\Files\\Node\\File"],true]},{"file":"/var/www/html/custom_apps/officeonline/lib/Controller/DocumentController.php","line":241,"function":"getToken","class":"OCA\\Officeonline\\TokenManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"index","class":"OCA\\Officeonline\\Controller\\DocumentController","type":"->","args":["*** sensitive parameters replaced ***","/dfsdf.xlsx"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Officeonline\\Controller\\DocumentController"],"index"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Officeonline\\Controller\\DocumentController"],"index"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Officeonline\\Controller\\DocumentController","index",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["officeonline.document.index"]]},{"file":"/var/www/html/lib/base.php","line":1053,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/officeonline/index"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","Line":211,"CustomMessage":"--"}}
{"reqId":"3m30XcnittcUSI9aI7RM","level":3,"time":"2024-05-14T13:38:44+00:00","remoteAddr":"172.18.0.2","user":"test","app":"officeonline","method":"GET","url":"/apps/officeonline/index?fileId=629&requesttoken=PHVR4ZHZ2APEcPO4zXHdFg2XH4Gt9dEhZdHAuk8YG%2Fg%3D%3AezgbmPuav2%2FrN4fTuDrtWT7xT%2B%2FOlL9jCoaiyyNhc5U%3D&path=%2F2222.docx","message":"Server error: `GET https://nxoos.jedihome.ru/hosting/discovery` resulted in a `503 Service Unavailable` response:\n<html><body><h1>503 Service Unavailable</h1>\nNo server is available to handle this request.\n</body></html>\n\n","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15","version":"25.0.13.2","exception":{"Exception":"GuzzleHttp\\Exception\\ServerException","Message":"Server error: `GET https://nxoos.jedihome.ru/hosting/discovery` resulted in a `503 Service Unavailable` response:\n<html><body><h1>503 Service Unavailable</h1>\nNo server is available to handle this request.\n</body></html>\n\n","Code":503,"Trace":[{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":69,"function":"create","class":"GuzzleHttp\\Exception\\RequestException","type":"::","args":[["GuzzleHttp\\Psr7\\Request"],"*** sensitive parameters replaced ***",null,[],null]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":204,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":153,"function":"callHandler","class":"GuzzleHttp\\Promise\\Promise","type":"::","args":[1,"*** sensitive parameters replaced ***",null]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/TaskQueue.php","line":48,"function":"GuzzleHttp\\Promise\\{closure}","class":"GuzzleHttp\\Promise\\Promise","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":248,"function":"run","class":"GuzzleHttp\\Promise\\TaskQueue","type":"->","args":[true]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":224,"function":"invokeWaitFn","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":269,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":226,"function":"invokeWaitList","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php","line":62,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"wait","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/var/www/html/lib/private/Http/Client/Client.php","line":218,"function":"request","class":"GuzzleHttp\\Client","type":"->","args":["get","https://nxoos.jedihome.ru/hosting/discovery",[false,45,[true],["Nextcloud Server Crawler","gzip"],true]]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/DiscoveryManager.php","line":106,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["https://nxoos.jedihome.ru/hosting/discovery",[45,[true],false]]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/DiscoveryManager.php","line":78,"function":"fetchFromRemote","class":"OCA\\Officeonline\\WOPI\\DiscoveryManager","type":"->","args":[]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/Parser.php","line":160,"function":"get","class":"OCA\\Officeonline\\WOPI\\DiscoveryManager","type":"->","args":[]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/Parser.php","line":217,"function":"getParsed","class":"OCA\\Officeonline\\WOPI\\Parser","type":"->","args":[]},{"file":"/var/www/html/custom_apps/officeonline/lib/WOPI/Parser.php","line":199,"function":"getUrlSrcByExtension","class":"OCA\\Officeonline\\WOPI\\Parser","type":"->","args":["external-https","docx","edit"]},{"file":"/var/www/html/custom_apps/officeonline/lib/TokenManager.php","line":208,"function":"getUrlSrcForFile","class":"OCA\\Officeonline\\WOPI\\Parser","type":"->","args":[["OC\\Files\\Node\\File"],true]},{"file":"/var/www/html/custom_apps/officeonline/lib/Controller/DocumentController.php","line":241,"function":"getToken","class":"OCA\\Officeonline\\TokenManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"index","class":"OCA\\Officeonline\\Controller\\DocumentController","type":"->","args":["*** sensitive parameters replaced ***","/2222.docx"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Officeonline\\Controller\\DocumentController"],"index"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Officeonline\\Controller\\DocumentController"],"index"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Officeonline\\Controller\\DocumentController","index",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["officeonline.document.index"]]},{"file":"/var/www/html/lib/base.php","line":1053,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/officeonline/index"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Exception/RequestException.php","Line":113,"CustomMessage":"--"}}

There are many issues in your system:

  • from the log it looks your haproxy talks to only one backend nx01 but there are still 401/412 error codes - at least in this snippet it happens for PUT method - maybe your backend is not setup correct. There are many 404 error on nxoos - which is not good as well.
  • your NC *can not connect with your CODE server (likely because of TLS issue).

I would recommend you start with basic single-node setup without haproxy, make it work according to Collabora integration guide

1 Like