NC behind loadbalancer, trying to connect to Signaling server

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 23.0.5.1
Operating system and version (eg, Ubuntu 20.04): CentOS8
Apache or nginx version (eg, Apache 2.4.25): Apache: httpd-2.4.37-47
PHP version (eg, 7.4): 8.0.20

The issue you are facing:
Nextcloud instance can successfully connect to self-installed,open-source version of HPB for Talk on a VPS, but calls cannot be established.
Followed How to Install Nextcloud Talk High Performance Backend with Stun/Turnserver on Ubuntu – Markus' Blog with minor tweaks to allow for newer go-lang packages etc.

Is this the first time you’ve seen this error? (Y/N):
Y
Steps to replicate it:

  1. install Nextcloud Instance and run it behind HAProxy
  2. Install HPB according to above tutorial on VPS
  3. Try and establish a call, any call, in NC Talk

The output of your Nextcloud log in Admin > Logging:

Nothing relevant. As i said, the connection under Settings shows success for everything.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => 'redacted',
  'secret' => 'redacted',
  'trusted_domains' => 
  array (
    0 => '192.168.10.6',
    1 => '192.168.10.4',
    2 => 'nextcloud.domain.com',
  ),
  'datadirectory' => '/var/www/html/data/',
  'dbtype' => 'mysql',
  'version' => '23.0.5.1',
  'overwrite.cli.url' => 'http://nextcloud.domain.com',
  'htaccess.RewriteBase' => '/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'pass',
  'installed' => true,
  'instanceid' => 'ociu92qehwsl',
  'logtimezone' => 'Africa/Johannesburg',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '127.0.0.1',
    'port' => 6379,
  ),
  'mail_domain' => 'my.domain.com',
  'mail_from_address' => 'nextcloud',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'HOST',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'USER',
  'mail_smtppassword' => 'PASS',
  'mail_smtpsecure' => 'ssl',
  'maintenance' => false,
  'onlyoffice' => 
  array (
    'verify_peer_off' => true,
  ),
  'allow_local_remote_servers' => true,
  'trusted_proxies' => 
  array (
    0 => '192.168.10.11',
    1 => '127.0.0.1',
  ),
  'theme' => '',
  'loglevel' => 0,
  'app_install_overwrite' => 
  array (
    0 => 'breezedark',
    1 => 'drawio',
    2 => 'fulltextsearch',
    3 => 'fulltextsearch_elasticsearch',
    4 => 'files_fulltextsearch',
    5 => 'onlyoffice',
    6 => 'groupfolders',
    7 => 'ransomware_protection',
  ),
  'default_phone_region' => 'ISO 3166-2:ZA',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
);

None of the log files on Nextcloud gives me anything relevant. I had a turn server installed on my local network, and allowed firewall through, then NC Talk connects and all is going splendidly. So I know at least my NC Talk works. But the moment I try to use the external VPS as a signaling server, then it breaks.

My setup:

nextcloud on apache <-------------> HAProxy<-------->Internet<-------> HPB on VPS.

Is there anything funky I should do on HAProxy for this to work?
EDIT: Just tried now. If I only do a "TURN" server on the VPS, is works correctly and flawlessly. So it seems the issue comes in with the STUN part of the setup. The moment I add the STUN server, it all goes to hell.

Any help will be appreciated a lot!
Thanks
Hans

Got this figured out. Changed the STUN server to use nextcloud’s, rather this built in one. All is working now.