nextcloud / spreed

🗨️ Nextcloud Talk – chat, video & audio calls for Nextcloud
https://nextcloud.com/talk
GNU Affero General Public License v3.0
1.63k stars 436 forks source link

Talk matterbridge failing to start gateway. Maybe due to missing "OCS-APIRequest: true" header #4967

Closed RobertWi closed 3 years ago

RobertWi commented 3 years ago

Steps to reproduce

  1. download enable Talk 10.0.5
  2. download enable Talk Matterbridge 1.21.0
  3. Enable Matterbrige integration in Talk admin setting- > Matterbridge integration Beta -> Installed version: version: 1.21.0 cf13fff7
  4. add conversation in talk
  5. add bridged channel of type IRC and fill details IRC
  6. save
  7. set bridge to enabled

Talk

Talk app version: 10.0.5 on Nextcloud 20.0.5

Custom Signaling server configured: no

Custom TURN server configured: yes

Custom STUN server configured: yes

Browser

Microphone available: yes

Camera available: no

Operating system: Ubuntu 2004

Browser name: Firefox

Browser version: 84.0.2

Expected behaviour

Successful start of gateway

adress obfuscated

accessing with browser https://cus199.nl.tabdigital.eu/ocs/v2.php/cloud/capabilities led to Access forbidden / CSRF check failed

curl -k https://cus199.nl.tabdigital.eu/ocs/v2.php/cloud/capabilities
{"message":"CSRF check failed"}

curl -k -H "OCS-APIRequest: true"  https://cus199.nl.tabdigital.eu/ocs/v2.php/cloud/capabilities
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>200</statuscode>
  <message>OK</message>
 </meta>
 <data>
  <version>
   <major>18</major>
   <minor>0</minor>
   <micro>3</micro>
   <string>18.0.3</string>
   <edition></edition>
   <extendedSupport></extendedSupport>
  </version>
  <capabilities>
   <bruteforce>
    <delay>0</delay>
   </bruteforce>
   <spreed>
    <features>
     <element>audio</element>
     <element>video</element>
     <element>chat-v2</element>
     <element>guest-signaling</element>
     <element>empty-group-room</element>
     <element>guest-display-names</element>
     <element>multi-room-users</element>
     <element>favorites</element>
     <element>last-room-activity</element>
     <element>no-ping</element>
     <element>system-messages</element>
     <element>mention-flag</element>
     <element>in-call-flags</element>
     <element>notification-levels</element>
     <element>invite-groups-and-mails</element>
     <element>locked-one-to-one-rooms</element>
     <element>read-only-rooms</element>
     <element>chat-read-marker</element>
     <element>webinary-lobby</element>
     <element>start-call-flag</element>
     <element>chat-replies</element>
     <element>circles-support</element>
    </features>
    <config>
     <chat>
      <max-length>32000</max-length>
     </chat>
    </config>
   </spreed>
   <theming>
    <name>Nextcloud</name>
    <url>https://nextcloud.com</url>
    <slogan>a safe home for all your data</slogan>
    <color>#0082c9</color>
    <color-text>#ffffff</color-text>
    <color-element>#0082c9</color-element>
    <logo>https://cus199.nl.tabdigital.eu/core/img/logo/logo.svg?v=0</logo>
    <background>https://cus199.nl.tabdigital.eu/core/img/background.png?v=0</background>
    <background-plain></background-plain>
    <background-default>1</background-default>
    <logoheader>https://cus199.nl.tabdigital.eu/core/img/logo/logo.svg?v=0</logoheader>
    <favicon>https://cus199.nl.tabdigital.eu/core/img/logo/logo.svg?v=0</favicon>
   </theming>
  </capabilities>
 </data>
</ocs>`
curl -k -H "OCS-APIRequest: true"  https://cus199.nl.tabdigital.eu/ocs/v2.php/cloud/capabilities
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>200</statuscode>
  <message>OK</message>
 </meta>
 <data>
  <version>
   <major>18</major>
   <minor>0</minor>
   <micro>3</micro>
   <string>18.0.3</string>
   <edition></edition>
   <extendedSupport></extendedSupport>
  </version>
  <capabilities>
   <bruteforce>
    <delay>0</delay>
   </bruteforce>
   <spreed>
    <features>
     <element>audio</element>
     <element>video</element>
     <element>chat-v2</element>
     <element>guest-signaling</element>
     <element>empty-group-room</element>
     <element>guest-display-names</element>
     <element>multi-room-users</element>
     <element>favorites</element>
     <element>last-room-activity</element>
     <element>no-ping</element>
     <element>system-messages</element>
     <element>mention-flag</element>
     <element>in-call-flags</element>
     <element>notification-levels</element>
     <element>invite-groups-and-mails</element>
     <element>locked-one-to-one-rooms</element>
     <element>read-only-rooms</element>
     <element>chat-read-marker</element>
     <element>webinary-lobby</element>
     <element>start-call-flag</element>
     <element>chat-replies</element>
     <element>circles-support</element>
    </features>
    <config>
     <chat>
      <max-length>32000</max-length>
     </chat>
    </config>
   </spreed>
   <theming>
    <name>Nextcloud</name>
    <url>https://nextcloud.com</url>
    <slogan>a safe home for all your data</slogan>
    <color>#0082c9</color>
    <color-text>#ffffff</color-text>
    <color-element>#0082c9</color-element>
    <logo>https://cus199.nl.tabdigital.eu/core/img/logo/logo.svg?v=0</logo>
    <background>https://cus199.nl.tabdigital.eu/core/img/background.png?v=0</background>
    <background-plain></background-plain>
    <background-default>1</background-default>
    <logoheader>https://cus199.nl.tabdigital.eu/core/img/logo/logo.svg?v=0</logoheader>
    <favicon>https://cus199.nl.tabdigital.eu/core/img/logo/logo.svg?v=0</favicon>
   </theming>
  </capabilities>
 </data>
</ocs>

reference: (https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-share-api.html)

Actual behaviour

in " show matterbridge log" connect: connection refused on https://cus199.nl.tabdigital.eu/ocs/v2.php/cloud/capabilities

time="2021-01-18T06:05:55Z" level=info msg="Running version 1.21.0 cf13fff7" prefix=main
time="2021-01-18T06:05:55Z" level=info msg="Parsing gateway myGateway" prefix=router
time="2021-01-18T06:05:55Z" level=info msg="Starting bridge: irc.0 " prefix=router
time="2021-01-18T06:05:55Z" level=info msg="Connecting chat.freenode.net:6667" prefix=irc
time="2021-01-18T06:06:01Z" level=info msg="Connection succeeded" prefix=irc
time="2021-01-18T06:06:01Z" level=info msg="irc.0: joining #nextcloud (ID: #nextcloudirc.0)" prefix=irc
time="2021-01-18T06:06:01Z" level=info msg="Starting bridge: nctalk.1 " prefix=router
time="2021-01-18T06:06:01Z" level=info msg=Connecting prefix=nctalk
time="2021-01-18T06:06:01Z" level=error msg="Cannot Connect" prefix=nctalk
time="2021-01-18T06:06:01Z" level=fatal msg="Starting gateway failed: Bridge nctalk.1 failed to start: Get "https://cus199.nl.tabdigital.eu/ocs/v2.php/cloud/capabilities": dial tcp 10.12.35.28:443: connect: connection refused" prefix=main

Server configuration detail

Operating system: Linux 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64

Webserver: nginx/1.14.0 (fpm-fcgi)

Database: mysql 5.7.31

PHP version:

7.3.22-1+ubuntu18.04.1+deb.sury.org+1 Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, sodium, session, standard, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, intl, json, exif, mysqli, pdo_mysql, apc, posix, readline, shmop, SimpleXML, soap, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, Phar, Zend OPcache

Nextcloud version: 20.0.5 - 20.0.5.2

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

List of activated apps ``` Enabled: - accessibility: 1.6.0 - activity: 2.13.4 - admin_audit: 1.10.0 - apporder: 0.11.0 - audioplayer: 2.13.1 - bookmarks: 3.4.9 - breezedark: 20.0.2 - calendar: 2.1.3 - cloud_federation_api: 1.3.0 - comments: 1.10.0 - contacts: 3.4.3 - contactsinteraction: 1.1.0 - dashboard: 7.0.0 - dav: 1.16.2 - deck: 1.2.3 - drawio: 0.9.8 - encryption: 2.8.1 - federatedfilesharing: 1.10.2 - federation: 1.10.1 - files: 1.15.0 - files_external: 1.11.1 - files_markdown: 2.3.1 - files_pdfviewer: 2.0.1 - files_rightclick: 0.17.0 - files_sharing: 1.12.2 - files_trashbin: 1.10.1 - files_versions: 1.13.0 - files_videoplayer: 1.9.0 - firstrunwizard: 2.9.0 - gpxmotion: 0.1.0 - gpxpod: 4.2.4 - groupfolders: 8.2.0 - issuetemplate: 0.7.0 - logreader: 2.5.0 - lookup_server_connector: 1.8.0 - mail: 1.4.2 - metadata: 0.12.0 - nextcloud_announcements: 1.9.0 - notes: 3.6.4 - notifications: 2.8.0 - oauth2: 1.8.0 - occweb: 0.0.7 - onlyoffice: 6.2.0 - password_policy: 1.10.1 - photos: 1.2.3 - podcast: 0.0.1 - privacy: 1.4.0 - provisioning_api: 1.10.0 - radio: 1.0.1 - recommendations: 0.8.0 - serverinfo: 1.10.0 - settings: 1.2.0 - sharebymail: 1.10.0 - spreed: 10.0.5 - support: 1.3.0 - survey_client: 1.8.0 - systemtags: 1.10.0 - talk_matterbridge: 1.21.0 - tasks: 0.13.6 - text: 3.1.0 - theming: 1.11.0 - twofactor_backupcodes: 1.9.0 - twofactor_totp: 5.0.0 - updatenotification: 1.10.0 - user_status: 1.0.1 - viewer: 1.4.0 - weather_status: 1.0.0 - workflowengine: 2.2.0 Disabled: - circles - gpxedit - user_ldap ```
Configuration (config/config.php) ``` { "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "cus199.nl.tabdigital.eu" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "20.0.5.2", "overwrite.cli.url": "http:\/\/localhost", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "instanceid": "***REMOVED SENSITIVE VALUE***", "trusted_proxies": "***REMOVED SENSITIVE VALUE***", "onlyoffice": { "verify_peer_off": true, "DocumentServerUrl": "https:\/\/office.tabdigital.eu" }, "memcache.local": "\\OC\\Memcache\\APCu", "mail_smtpmode": "smtp", "mail_smtpsecure": "ssl", "mail_sendmailmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "LOGIN", "mail_smtpauth": "1", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "465", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "overwriteprotocol": "https", "maintenance": false, "theme": "", "loglevel": 1, "app_install_overwrite": [ "occweb", "audioplayer" ], "encryption.legacy_format_support": true, "encryption.key_storage_migrated": false } ```

Are you using external storage, if yes which one: local/nextcloud/S3

Are you using encryption: 1

Client configuration

Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0

Operating system: unbuntu 20.04

nickvergessen commented 3 years ago

Your overwrite.cli.url is invalid. Not sure that's enough to fix it, but it's a start

RobertWi commented 3 years ago

It reads "overwrite.cli.url": "http:\/\/localhost",

config:list ``` { "system": { "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "cus199.nl.tabdigital.eu" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "20.0.5.2", "overwrite.cli.url": "http:\/\/localhost", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "instanceid": "***REMOVED SENSITIVE VALUE***", "trusted_proxies": "***REMOVED SENSITIVE VALUE***", "onlyoffice": { "verify_peer_off": true, "DocumentServerUrl": "https:\/\/office.tabdigital.eu" }, "memcache.local": "\\OC\\Memcache\\APCu", "mail_smtpmode": "smtp", "mail_smtpsecure": "ssl", "mail_sendmailmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "LOGIN", "mail_smtpauth": "1", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "465", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "overwriteprotocol": "https", "maintenance": false, "theme": "", "loglevel": 1, "app_install_overwrite": [ "occweb", "audioplayer" ], "encryption.legacy_format_support": true, "encryption.key_storage_migrated": false }, "apps": { "accessibility": { "enabled": "yes", "installed_version": "1.6.0", "types": "" }, "activity": { "enabled": "yes", "installed_version": "2.13.4", "types": "filesystem" }, "admin_audit": { "enabled": "yes", "installed_version": "1.10.0", "types": "logging" }, "appointments": { "enabled": "no", "hk": "4450775d5c3513de94ccbece301f554996d361788d62dfd1b429c9b5d3555aeb", "installed_version": "1.7.14", "tiv": "4db82fac6640c907324c5d9258ad5359", "types": "dav" }, "apporder": { "enabled": "yes", "installed_version": "0.11.0", "types": "" }, "audioplayer": { "enabled": "yes", "installed_version": "2.13.1", "types": "filesystem" }, "backgroundjob": { "lastjob": "987" }, "bookmarks": { "enabled": "yes", "installed_version": "3.4.9", "types": "" }, "breezedark": { "enabled": "yes", "installed_version": "20.0.2", "theme_enabled": "0", "types": "" }, "calendar": { "enabled": "yes", "installed_version": "2.1.3", "types": "" }, "circles": { "enabled": "no", "installed_version": "0.20.6", "types": "filesystem,dav" }, "cloud_federation_api": { "enabled": "yes", "installed_version": "1.3.0", "types": "filesystem" }, "comments": { "enabled": "yes", "installed_version": "1.10.0", "types": "logging" }, "contacts": { "enabled": "yes", "installed_version": "3.4.3", "types": "dav" }, "contactsinteraction": { "enabled": "yes", "installed_version": "1.1.0", "types": "dav" }, "core": { "backgroundjobs_mode": "cron", "default_encryption_module": "OC_DEFAULT_MODULE", "encryption_enabled": "yes", "installedat": "1598260555.0345", "lastcron": "1610955304", "lastupdateResult": "[]", "lastupdatedat": "1610917152", "moveavatarsdone": "yes", "oc.integritycheck.checker": "[]", "previewsCleanedUp": "1", "public_files": "files_sharing\/public.php", "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php", "theming.variables": "b92d206521717ac032f8aa58d3c7ff2f", "updater.secret.created": "obfuscated, "vendor": "nextcloud" }, "dashboard": { "enabled": "yes", "installed_version": "7.0.0", "types": "" }, "dav": { "buildCalendarReminderIndex": "yes", "buildCalendarSearchIndex": "yes", "chunks_migrated": "1", "enabled": "yes", "installed_version": "1.16.2", "regeneratedBirthdayCalendarsForYearFix": "yes", "types": "filesystem" }, "deck": { "enabled": "yes", "installed_version": "1.2.3", "types": "dav" }, "drawio": { "enabled": "yes", "installed_version": "0.9.8", "types": "filesystem" }, "duplicatefinder": { "enabled": "no", "installed_version": "0.0.4", "types": "" }, "encryption": { "enabled": "yes", "installed_version": "2.8.1", "masterKeyId": "master_obfuscated", "publicShareKeyId": "pubShare_obfuscated", "recoveryKeyId": "recoveryKey_obfuscated", "types": "filesystem" }, "federatedfilesharing": { "enabled": "yes", "installed_version": "1.10.2", "types": "" }, "federation": { "enabled": "yes", "installed_version": "1.10.1", "types": "authentication" }, "files": { "cronjob_scan_files": "500", "enabled": "yes", "installed_version": "1.15.0", "types": "filesystem" }, "files_external": { "enabled": "yes", "installed_version": "1.11.1", "types": "filesystem" }, "files_markdown": { "enabled": "yes", "installed_version": "2.3.1", "types": "" }, "files_pdfviewer": { "enabled": "yes", "installed_version": "2.0.1", "types": "" }, "files_rightclick": { "enabled": "yes", "installed_version": "0.17.0", "types": "" }, "files_sharing": { "enabled": "yes", "installed_version": "1.12.2", "types": "filesystem" }, "files_trashbin": { "enabled": "yes", "installed_version": "1.10.1", "types": "filesystem,dav" }, "files_versions": { "enabled": "yes", "installed_version": "1.13.0", "types": "filesystem,dav" }, "files_videoplayer": { "enabled": "yes", "installed_version": "1.9.0", "types": "" }, "firstrunwizard": { "enabled": "yes", "installed_version": "2.9.0", "types": "logging" }, "forms": { "enabled": "no", "installed_version": "2.0.4", "types": "" }, "gpxedit": { "enabled": "no", "installed_version": "0.0.13", "types": "" }, "gpxmotion": { "enabled": "yes", "installed_version": "0.1.0", "types": "" }, "gpxpod": { "enabled": "yes", "installed_version": "4.2.4", "reset304": "1", "resetPics404": "1", "types": "" }, "groupfolders": { "enabled": "yes", "installed_version": "8.2.0", "types": "filesystem,dav" }, "health": { "enabled": "no", "installed_version": "0.1.3", "types": "" }, "issuetemplate": { "enabled": "yes", "installed_version": "0.7.0", "types": "" }, "logreader": { "enabled": "yes", "installed_version": "2.5.0", "types": "" }, "lookup_server_connector": { "enabled": "yes", "installed_version": "1.8.0", "types": "authentication" }, "mail": { "enabled": "yes", "installed_version": "1.4.2", "types": "" }, "metadata": { "enabled": "yes", "installed_version": "0.12.0", "types": "" }, "nextcloud_announcements": { "enabled": "yes", "installed_version": "1.9.0", "pub_date": "Thu, 24 Oct 2019 00:00:00 +0200", "types": "logging" }, "notes": { "enabled": "yes", "installed_version": "3.6.4", "types": "" }, "notifications": { "enabled": "yes", "installed_version": "2.8.0", "types": "logging" }, "oauth2": { "enabled": "yes", "installed_version": "1.8.0", "types": "authentication" }, "occweb": { "enabled": "yes", "installed_version": "0.0.7", "types": "" }, "onlyoffice": { "enabled": "yes", "installed_version": "6.2.0", "types": "filesystem" }, "password_policy": { "enabled": "yes", "installed_version": "1.10.1", "maximumLoginAttempts": "0", "types": "authentication" }, "photos": { "enabled": "yes", "installed_version": "1.2.3", "types": "" }, "podcast": { "enabled": "yes", "installed_version": "0.0.1", "types": "" }, "privacy": { "enabled": "yes", "installed_version": "1.4.0", "types": "" }, "provisioning_api": { "enabled": "yes", "installed_version": "1.10.0", "types": "prevent_group_restriction" }, "radio": { "enabled": "yes", "installed_version": "1.0.1", "types": "" }, "recommendations": { "enabled": "yes", "installed_version": "0.8.0", "types": "" }, "serverinfo": { "enabled": "yes", "installed_version": "1.10.0", "types": "" }, "settings": { "enabled": "yes", "installed_version": "1.2.0", "types": "" }, "sharebymail": { "enabled": "yes", "installed_version": "1.10.0", "types": "filesystem" }, "spreed": { "bridge_bot_password": "***REMOVED SENSITIVE VALUE***", "enable_matterbridge": "1", "enabled": "yes", "has_reference_id": "yes", "installed_version": "10.0.5", "matterbridge_binary": "\/var\/www\/nextcloud\/apps\/talk_matterbridge\/bin\/matterbridge-1.21.0-linux-64bit", "project_access_invalidated": "1", "stun_servers": "***REMOVED SENSITIVE VALUE***", "turn_servers": "***REMOVED SENSITIVE VALUE***", "types": "prevent_group_restriction" }, "support": { "SwitchUpdaterServerHasRun": "yes", "enabled": "yes", "installed_version": "1.3.0", "types": "session" }, "survey_client": { "enabled": "yes", "installed_version": "1.8.0", "types": "" }, "systemtags": { "enabled": "yes", "installed_version": "1.10.0", "types": "logging" }, "talk_matterbridge": { "enabled": "yes", "installed_version": "1.21.0", "types": "prevent_group_restriction" }, "tasks": { "enabled": "yes", "installed_version": "0.13.6", "types": "" }, "text": { "enabled": "yes", "installed_version": "3.1.0", "types": "dav" }, "theming": { "enabled": "yes", "installed_version": "1.11.0", "types": "logging" }, "twofactor_backupcodes": { "enabled": "yes", "installed_version": "1.9.0", "types": "" }, "twofactor_totp": { "enabled": "yes", "installed_version": "5.0.0", "types": "" }, "updatenotification": { "apporder": "0.11.0", "bookmarks": "3.4.9", "breezedark": "20.0.3", "contacts": "3.4.3", "core": "19.0.7.1", "deck": "1.2.3", "drawio": "0.9.8", "enabled": "yes", "files_markdown": "2.3.1", "groupfolders": "7.1.1", "installed_version": "1.10.0", "mail": "1.4.2", "notes": "3.6.3", "onlyoffice": "6.2.0", "tasks": "0.13.6", "types": "", "update_check_errors": "0" }, "user_status": { "enabled": "yes", "installed_version": "1.0.1", "types": "" }, "viewer": { "enabled": "yes", "installed_version": "1.4.0", "types": "" }, "weather_status": { "enabled": "yes", "installed_version": "1.0.0", "types": "" }, "workflowengine": { "enabled": "yes", "installed_version": "2.2.0", "types": "filesystem" } } ```

Probably has to set to FQDN then? Need to contact nextcloud SP to align.

nickvergessen commented 3 years ago

yeah, should be mostlikely cus199.nl.tabdigital.eu

RobertWi commented 3 years ago

Had set it too "overwrite.cli.url": "https:\/\/cus199nl.tabdigital.eu", and
"overwrite.cli.url": "https:\/\/10.12.35.48", and the same error messages as initially reported

why 10.12.35.48, this internal ip is logged as dial to tcp address in error message

time="2021-01-18T13:41:28Z" level=info msg="Running version 1.21.0 cf13fff7" prefix=main time="2021-01-18T13:41:28Z" level=info msg="Parsing gateway myGateway" prefix=router time="2021-01-18T13:41:28Z" level=info msg="Starting bridge: nctalk.1 " prefix=router time="2021-01-18T13:41:28Z" level=info msg=Connecting prefix=nctalk time="2021-01-18T13:41:28Z" level=error msg="Cannot Connect" prefix=nctalk time="2021-01-18T13:41:28Z" level=fatal msg="Starting gateway failed: Bridge nctalk.1 failed to start: Get "https://cus199.nl.tabdigital.eu/ocs/v2.php/cloud/capabilities": dial tcp 10.12.35.48:443: connect: connection refused" prefix=main

Not clear how things should work or is designed or how i should read this error message. Need a flow diagram I think to clarify. While starting gw bridging nctalk fails getting server capabilities, which fails for me as well unless I add the "OCS-APIRequest: true" header. then dial tcp to 10.12.35.28:443 resulting in connection refused which can be:

  1. nothing is listening on the IP:Port trying to connect to. But what should be listening. ?
  2. The port is blocked by a firewall.
julien-nc commented 3 years ago

@RobertWi Is cus199nl.tabdigital.eu or cus199.nl.tabdigital.eu really the domain where your Nextcloud is accessible? Or did you change it for privacy reasons in this issue? Both names don't resolve on my side.

First supposition, your Nextcloud is not aware of its own address and it writes an incorrect address in Matterbridge config. Make sure overwrite.cli.url is set to the address with which you access your Nextcloud.

The way things work is not very complex. Your Nextcloud server executes Matterbridge binary which acts as a client and connects to all the bridge parts. So, Matterbridge runs on the same system as your webserver and tries to connect (and makes some OCS requests) to your Nextcloud server via its domain name. I guess one possible reason for your problem would be that your server can't contact itself via cus199.nl.tabdigital.eu. You can check that by running

curl -k -H "OCS-APIRequest: true"  https://cus199.nl.tabdigital.eu/ocs/v2.php/cloud/capabilities

on your server's system. Maybe that's already what you did, I can't tell where you have run it. If it fails, there is your problem. Your connection loopback might not work or there is some firewall blocking you somewhere.

If this works, then we need to investigate further...

RobertWi commented 3 years ago

Mentioned addresses were obfuscated, and I rather keep it that way, pardon, for the typo while obfuscating.

Also mentioned that

"overwrite.cli.url": "https://cus199.nl.tabdigital.eu",

was set and error thrown is reproducible

Curl command output previously reported was not executed on the server as I don't have shell acces on that server but TAB DIGITAL support was willing to execute cmd on the server system and the result was succesfull as well. Received below output. So no routing issue or firewall it seems.

curl -k -H "OCS-APIRequest: true" https://cus199.nl.tabdigital.eu/ocs/v2.php/cloud/capabilities

?xml version="1.0"?>
<ocs>
<meta>
<status>ok</status>
<statuscode>200</statuscode>
<message>OK</message>
</meta>
<data>
<version>
<major>20</major>
<minor>0</minor>
<micro>5</micro>
<string>20.0.5</string>
<edition></edition>
<extendedSupport></extendedSupport>
</version>
<capabilities>
<bruteforce>
<delay>0</delay>
</bruteforce>
<spreed>
<features>
<element>audio</element>
<element>video</element>
<element>chat-v2</element>
<element>conversation-v2</element>
<element>guest-signaling</element>
<element>empty-group-room</element>
<element>guest-display-names</element>
<element>multi-room-users</element>
<element>favorites</element>
<element>last-room-activity</element>
<element>no-ping</element>
<element>system-messages</element>
<element>mention-flag</element>
<element>in-call-flags</element>
<element>notification-levels</element>
<element>invite-groups-and-mails</element>
<element>locked-one-to-one-rooms</element>
<element>read-only-rooms</element>
<element>chat-read-marker</element>
<element>webinary-lobby</element>
<element>start-call-flag</element>
<element>chat-replies</element>
<element>circles-support</element>
<element>force-mute</element>
<element>chat-reference-id</element>
</features>
<config>
<attachments>
<allowed></allowed>
</attachments>
<chat>
<max-length>32000</max-length>
</chat>
<conversations>
<can-create></can-create>
</conversations>
</config>
</spreed>
<theming>
<name>Nextcloud</name>
<url>https://nextcloud.com</url>
<slogan>a safe home for all your data</slogan>
<color>#0082c9</color>
<color-text>#ffffff</color-text>
<color-element>#0082c9</color-element>
<color-element-bright>#0082c9</color-element-bright>
<color-element-dark>#0082c9</color-element-dark>
<logo>https://cus199.nl.tabdigital.eu/core/img/logo/logo.svg?v=0</logo>
<background>https://cus199.nl.tabdigital.eu/core/img/background.png?v=0</background>
<background-plain></background-plain>
<background-default>1</background-default>
<logoheader>https://cus199.nl.tabdigital.eu/core/img/logo/logo.svg?v=0</logoheader>
<favicon>https://cus199.nl.tabdigital.eu/core/img/logo/logo.svg?v=0</favicon>
</theming>
</capabilities>
</data>
</ocs> 
julien-nc commented 3 years ago

Let's sum up what happens.

Now the only difference between the CURL request and the one done by Matterbridge could be the Unix user doing it. Maybe the server's firewall is restricting what the webserver user can do and the support person is calling CURL as a user without restrictions...

I can't think of another reason right now.

RobertWi commented 3 years ago

It works now! SP tab digital changed two things so don't know what really fixed it. I've set one of my own domains the A record to their public ip adress hosting my nextcloud instance.

1) They have set trusted domain to my domain. 2) They configured have set High Performance Backend signaling server for my domain

Nevertheless it works, sorry for the interrupt. Please go on with writing an maintaining beautiful code with added value. Much appreciated.