Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not get capabilities #124

Closed
solracsf opened this issue Jun 17, 2021 · 9 comments
Closed

Could not get capabilities #124

solracsf opened this issue Jun 17, 2021 · 9 comments

Comments

@solracsf
Copy link
Contributor

solracsf commented Jun 17, 2021

With latest master, syslog is flooded with these messages (NC 21.0.2, Talk 11.2.2).

backend_client.go:422: Could not get capabilities for https://example/ocs/v2.php/apps/spreed/api/v1/signaling/backend: unsupported_content_type
backend_client.go:512: Received unsupported content-type from https://example/ocs/v2.php/apps/spreed/api/v1/signaling/backend: text/xml; charset=UTF-8 (503 Service Unavailable)

Output of /standalone-signaling/api/v1/welcome

{"nextcloud-spreed-signaling":"Welcome","version":"b091db000e4ec9d9a65a9d2021ffb3780c08848a"}

Secret verified and it is OK (it matches from the server.conf and the NC Settings).

@fancycode
Copy link
Member

Just above that should be a line like this:

2021-06-17 09:54:15.095365 I | backend_client.go:344: Capabilities expired for https://example/ocs/v2.php/cloud/capabilities, updating

How does the URL for this look like? Is it a valid URL to your Nextcloud?

@fancycode
Copy link
Member

Btw, the capabilities code was introduced for #117.

@solracsf
Copy link
Contributor Author

Yes, it is:

backend_client.go:344: Capabilities expired for https://example/ocs/v2.php/cloud/capabilities, updating

When i curl it, i get a 503 but i believe this is normal as i'm not authenticated, but all headers are outputed.

curl -I https://example/ocs/v2.php/cloud/capabilities
HTTP/2 503
server: nginx
date: Thu, 17 Jun 2021 07:59:16 GMT
content-type: text/xml; charset=UTF-8
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate
pragma: no-cache
content-security-policy: default-src 'self'; script-src 'self' 'nonce-YU9DOHdXWlFWR3FXa2lZRkdoc0x1cGtnR1B6TnNGNUhzTXVzRXFYTWRPZz06WFlxT2tEY3pKemlpb3hWUlgxYzc0dTRQVUphTTRoSU0vS3IvUmVTaVFhQT0='; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *; object-src 'none'; base-uri 'self';
set-cookie: oc_sessionPassphrase=dbg3lNtedRD8DUXxSqSMqrHKvjGHnvIajOjzGQmf16HMHyx3JSusfeg%2F%2BXQShvYTDDnsd3mVUyu2SxCeK6euj9H28glys%2BQxSD4dZzh; path=/; secure; HttpOnly; SameSite=Lax
set-cookie: ocfy7puzlad7=hDVWujfsqjW-07KpkJpKjXG2xe; path=/; secure; HttpOnly; SameSite=Lax
set-cookie: __Host-nc_sameSiteCookielax=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax
set-cookie: __Host-nc_sameSiteCookiestrict=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict
permissions-policy: interest-cohort=()
strict-transport-security: max-age=31536000; includeSubDomains; preload
expect-ct: max-age=7776000, enforce
referrer-policy: no-referrer
x-content-type-options: nosniff
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-robots-tag: none
x-xss-protection: 1; mode=block

@fancycode
Copy link
Member

That URL should be publicly accessible without authentication:

curl -H "OCS-APIRequest: true" https://example/ocs/v2.php/cloud/capabilities
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>200</statuscode>
  <message>OK</message>
 </meta>
 <data>
  <version>
...
  </version>
  <capabilities>
...
  </capabilities>
 </data>
</ocs>

Do you see an error in your nextcloud.log when you load it?

@solracsf
Copy link
Contributor Author

solracsf commented Jun 17, 2021

Hum. Not it is not.

curl -H "OCS-APIRequest: true" https://example/ocs/v2.php/cloud/capabilities
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>failure</status>
  <statuscode>503</statuscode>
  <message>Service unavailable</message>
 </meta>
 <data/>
</ocs>

but no errors on nextcloud.log or nginx error.log

@fancycode
Copy link
Member

Well, that's more a problem of Nextcloud then, maybe @nickvergessen has an idea? Otherwise you should probably open an issue at https://github.com/nextcloud/server.

@solracsf
Copy link
Contributor Author

Thnsk for pointing me in the right direction, it was just a firewal thing. 👍

@elhananjair
Copy link

elhananjair commented Jun 18, 2022

Hello @fancycode, @solracsf
I am facing the problem now.
image

● signaling.service - Nextcloud Talk signaling server
     Loaded: loaded (/etc/systemd/system/signaling.service; enabled; vendor preset: disabled)
     Active: active (running) since Sat 2022-06-18 17:46:47 EAT; 49min ago
   Main PID: 926 (signaling)
      Tasks: 15 (limit: 19154)
     Memory: 22.3M
        CPU: 47.832s
     CGroup: /system.slice/signaling.service
             └─ 926 /opt/nextcloud-spreed-signaling-v0.5.0/bin/signaling --config /etc/signaling/server.conf
 
Jun 18 18:35:25 talk-hpb signaling[926]: client.go:282: Client from 192.168.195.71 has RTT of 29 ms (29.344845ms)
Jun 18 18:35:25 talk-hpb signaling[926]: capabilities.go:126: Capabilities expired for https://nextcloud-domain/ocs/v2.php/cloud/capabilities, updating
Jun 18 18:35:35 talk-hpb signaling[926]: capabilities.go:191: Could not get capabilities for https://nextcloud-domain/ocs/v2.php/apps/spreed/api/v3/signaling/backend: Get "https://nextcloud-domain/ocs/v2.php/cloud/capabilities": context deadline exceeded
Jun 18 18:35:35 talk-hpb signaling[926]: backend_client.go:131: Could not get client for host nextcloud-domain: context deadline exceeded
Jun 18 18:35:36 talk-hpb signaling[926]: client.go:282: Client from 192.168.195.71 has RTT of 29 ms (29.564952ms)
Jun 18 18:35:36 talk-hpb signaling[926]: capabilities.go:126: Capabilities expired for https://nextcloud-domain/ocs/v2.php/cloud/capabilities, updating
Jun 18 18:35:46 talk-hpb signaling[926]: capabilities.go:191: Could not get capabilities for https://nextcloud-domain/ocs/v2.php/apps/spreed/api/v3/signaling/backend: Get "https://nextcloud-domain/ocs/v2.php/cloud/capabilities": context deadline exceeded
Jun 18 18:35:46 talk-hpb signaling[926]: backend_client.go:131: Could not get client for host nextcloud-domain: context deadline exceeded
Jun 18 18:35:47 talk-hpb signaling[926]: client.go:282: Client from 192.168.195.71 has RTT of 147 ms (147.546256ms)
Jun 18 18:35:47 talk-hpb signaling[926]: capabilities.go:126: Capabilities expired for https://nextcloud-domain/ocs/v2.php/cloud/capabilities, updating

What am not getting is I can send messages from Talk Mobile App, but I can't from a browser (Currently testing from Firefox), here is the log from browser:
image
image

And I have tried the following but it shows timeout:
curl -H "OCS-APIRequest: true" https://nextcloud-domain/ocs/v2.php/cloud/capabilities

Can you give me a hint on where the problem might be, please? Thank you.

@solracsf
Copy link
Contributor Author

solracsf commented Jun 18, 2022

If you cant get curl -H "OCS-APIRequest: true" https://example.com/ocs/v2.php/cloud/capabilities than you have something wrong with your setup. It can be a firewall, a thing like mod_security, a WAF, your reverse proxy, your webserver rules, etc.

This endpoint /ocs/v2.php/cloud/capabilities is a Nextcloud endpoint, nothing to do with Signaling here (at this stage).

Fix your setup so you can reach that endpoint, debug it from there then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants