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

No connection to signaling server possible, Logs show incomplete OCS response #380

Closed
drudgede opened this issue Dec 18, 2022 · 9 comments
Closed

Comments

@drudgede
Copy link

Today I upgraded Nextcloud Spreed Signaling to the latest version since I had the message in the Nextcloud backend that the old version is not supported anymore. Nextcloud and nextcloud-spreed-signaling run on two different servers. I run Nextcloud 25.0.2 and nextcloud-spreed-signaling version b4d957f/go1.17.13.

The update (pulled with git and executed make build afterwards) was successful. however, I have the problem that I cannot connect to the signaling server in any Talk room and the "make call" button is grayed out . In the Nextcloud admin panel/Talk settings, it shows me that the connection to the Nextcloud high performance backed is successful and also shows me the current version, so the general connection seems.

The signaling server runs as a service on my server and the logs show the following periodically:

> journalctl -u signaling -xn --no-pager
Dec 18 14:03:39 v2202102118567143789 signaling[1150]: capabilities.go:248: Could not get capabilities for https://URL-REDACTED/ocs/v2.php/apps/spreed/api/v3/signaling/backend: incomplete OCS response
Dec 18 14:03:47 v2202102118567143789 signaling[1150]: client.go:282: Client from 109.40.241.60 has RTT of 52 ms (52.270455ms)
Dec 18 14:03:47 v2202102118567143789 signaling[1150]: capabilities.go:151: Capabilities expired for https://URL-REDACTED/ocs/v2.php/cloud/capabilities, updating
Dec 18 14:03:47 v2202102118567143789 signaling[1150]: client.go:303: Error reading from 109.40.241.60: websocket: close 1006 (abnormal closure): unexpected EOF
Dec 18 14:03:47 v2202102118567143789 signaling[1150]: capabilities.go:192: Incomplete OCS response {"ocs":{"meta":{"status":"ok","statuscode":200,"message":"OK"},"data":{"version":{"major":25,"minor":0,"micro":2,"string":"25.0.2","edition":"","extendedSupport":false},"capabilities":{"bruteforce":{"delay":0},"metadataAvailable":{"size":["\/image\\\/.*\/"],"gps":["\/image\\\/.*\/"]},"spreed":{"features":["audio","video","chat-v2","conversation-v4","guest-signaling","empty-group-room","guest-display-names","multi-room-users","favorites","last-room-activity","no-ping","system-messages","delete-messages","mention-flag","in-call-flags","conversation-call-flags","notification-levels","invite-groups-and-mails","locked-one-to-one-rooms","read-only-rooms","listable-rooms","chat-read-marker","chat-unread","webinary-lobby","start-call-flag","chat-replies","circles-support","force-mute","sip-support","sip-support-nopin","chat-read-status","phonebook-search","raise-hand","room-description","rich-object-sharing","temp-user-avatar-api","geo-location-sharing","voice-message-sharing","signaling-v3","publishing-permissions","clear-history","direct-mention-flag","notification-calls","conversation-permissions","rich-object-list-media","rich-object-delete","unified-search","chat-permission","silent-send","silent-call","send-call-notification","talk-polls","message-expiration","reactions","chat-reference-id"],"config":{"attachments":{"allowed":false},"call":{"enabled":true},"chat":{"max-length":32000,"read-privacy":0},"conversations":{"can-create":false},"previews":{"max-gif-size":3145728},"signaling":{"session-ping-limit":200,"hello-v2-token-key":"-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE+WZlEAx\/wMjLlJAaoRFOwP6N3Ijg\n5Mo5eJX7TeRU\/B5wvuDxH9ziDNlzBOZNMUFDeDO0phTdoCUtGFuHybbEeg==\n-----END PUBLIC KEY-----\n"}},"version":"15.0.2"},"theming":{"name":"CLOUDNAME","url":"https:\/\/URL-REDACTED","slogan":"SLOGAN","color":"#1A30C9","color-text":"#ffffff","color-element":"#1A30C9","color-element-bright":"#1A30C9","color-element-dark":"#1A30C9","logo":"https:\/\/URL-REDACTED\/apps\/theming\/image\/logo?useSvg=1&v=31","background":"#1A30C9","background-plain":true,"background-default":true,"logoheader":"https:\/\/URL-REDACTED\/apps\/theming\/image\/logo?useSvg=1&v=31","favicon":"https:\/\/URL-REDACTED\/apps\/theming\/image\/logo?useSvg=1&v=31"}}}}} from https://URL-REDACTED/ocs/v2.php/apps/spreed/api/v3/signaling/backend
Dec 18 14:03:47 v2202102118567143789 signaling[1150]: capabilities.go:222: Could not get capabilities for https://URL-REDACTED/ocs/v2.php/apps/spreed/api/v3/signaling/backend: incomplete OCS response
Dec 18 14:03:47 v2202102118567143789 signaling[1150]: backend_client.go:142: Could not marshal request &{Marshaler:<nil> Unmarshaler:<nil> Type:auth Auth:0xc000171980 Room:<nil> Ping:<nil> Session:<nil>}: json: error calling MarshalJSON for type *signaling.BackendClientRequest: unexpected end of JSON input

On the Nextcloud side, I can find the following in the logs:

GuzzleHttp\Exception\ClientException: Client error: `POST https://URL-TO-SIGNALING-SERVER:8081/standalone-signaling/api/v1/room/pw5nu5qs` resulted in a `400 Bad Request` response: Unsupported request type:

(followed by a stacktrace)

I'm not sure if this is a configuration error on my side or a software bug since there is an unexpected end of the JSON input.
For now, I disabled the high performance backend in the Nextcloud settings to have a working instance for now.

Can you help me fixing this problem? If there are any information required, please let me know. I don't know where this error might come from and which information (from Nextcloud server, from the high performance backup server) might be required at this time. I'll try to provide them ASAP.

Thanks and best regards
Mark

@drudgede
Copy link
Author

drudgede commented Dec 18, 2022

I tried to find out what may be the cause of my problem and found out that I get the same (un)marshaling error message when I try to run the benchmark:

root@coturn:/etc/signaling# ./bin/client -addr localhost:8080
Using a maximum of 1 CPUs
Backend server running on http://MY-PUBLIC-IP-ADDRESS:39871
Connecting to [ws://localhost:8080/spreed]
Starting 100 clients
Unsupported message type: {Marshaler:<nil> Unmarshaler:<nil> Id: Type:welcome Error:<nil> Welcome:0xc000163780 Hello:<nil> Bye:<nil> Room:<nil> Message:<nil> Control:<nil> Event:null TransientData:<nil>}
Received error: json: error calling MarshalJSON for type *signaling.BackendClientRequest: unexpected end of JSON input
Unsupported message type: {Marshaler:<nil> Unmarshaler:<nil> Id: Type:welcome Error:<nil> Welcome:0xc000163ac0 Hello:<nil> Bye:<nil> Room:<nil> Message:<nil> Control:<nil> Event:null TransientData:<nil>}
Received error: json: error calling MarshalJSON for type *signaling.BackendClientRequest: unexpected end of JSON input
Unsupported message type: {Marshaler:<nil> Unmarshaler:<nil> Id: Type:welcome Error:<nil> Welcome:0xc000163d40 Hello:<nil> Bye:<nil> Room:<nil> Message:<nil> Control:<nil> Event:null TransientData:<nil>}
...

So I guess it is a problem with a JSON library on my side. I redownloaded the git repo and built it from scratch but I always get the same error. Can you tell me which part might be broken here and how to fix it?
If there are any further information required, please let me know!

Edit:
I just found out about Bug #180 which seems to be related to this problem. I did not relate this to the JSON bug in the first place. However, the suggested workaround to run make clean followed by make build did not work for me. The error still persists.

@nelo-digitalagentur
Copy link

Some here with uptodate signaling server and nextcloud CE when starting the signaling server I get:

capabilities.go:248: Could not get capabilities for https://nextcloud.****.de/ocs/v2.php/apps/spreed/api/v3/signaling/backend: incomplete OCS response

Opening a talk room show the following error message in the console:

error: {code: 'invalid_token', message: 'The passed token is invalid.'}

I tripped checked any set secret but I can not figure out if this is a configuration issue or something else... any idea on how to solves this issue would be appreciated...

@nelo-digitalagentur
Copy link

PS: Just checkout out commit b68ced9 (wild guess) and rebuild it and it works again....

@fancycode
Copy link
Member

@drudgede I could successfully use the capabilities response from your log output in my tests, so it should work in general.

How are you building the signaling server? Just by calling make? There should be some generated _easyjson.go files after you have built the server. Please check the file api_backend_easyjson.go which should contain various methods for the types OcsResponse and OcsMeta and OcsBody.

@drudgede
Copy link
Author

@fancycode I built the signaling server using make build. There are a couple of _easyjson.go files in the signaling directory:

find /etc/signaling/ -name "*easyjson*"
/etc/signaling/api_async_easyjson.go
/etc/signaling/api_backend_easyjson.go
/etc/signaling/api_proxy_easyjson.go
/etc/signaling/api_grpc_easyjson.go
/etc/signaling/api_signaling_easyjson.go

And api_backend_easyjson.go contains functions which takes your three given types such as OcsResponse as parameters, such as

easyjson4354c623EncodeGithubComStrukturagNextcloudSpreedSignaling(out *jwriter.Writer, in TurnCredentials) {
  // ...
}

however, I cannot find definitions or something else for those three classes in this file. Would it be helpful if I provide those files to you?

@mkrajacic
Copy link

mkrajacic commented May 25, 2023

I'm struggling with almost the exact same problem @drudgede

Only in my case, the benchmark errors are:

Unsupported message type: {Marshaler:<nil> Unmarshaler:<nil> Id: Type:welcome Error:<nil> Welcome:0xc0001c6100 Hello:<nil> Bye:<nil> Room:<nil> Message:<nil> Control:<nil> Event:null TransientData:<nil>}
Unsupported message type: {Marshaler:<nil> Unmarshaler:<nil> Id: Type:welcome Error:<nil> Welcome:0xc00024d300 Hello:<nil> Bye:<nil> Room:<nil> Message:<nil> Control:<nil> Event:null TransientData:<nil>}
Received error: The backend URL is not supported.
Received error: The backend URL is not supported.
Unsupported message type: {Marshaler:<nil> Unmarshaler:<nil> Id: Type:welcome Error:<nil> Welcome:0xc0004ae080 Hello:<nil> Bye:<nil> Room:<nil> Message:<nil> Control:<nil> Event:null TransientData:<nil>}
Received error: The backend URL is not supported.
...

Were you maybe able to fix it?

@drudgede
Copy link
Author

drudgede commented Jun 2, 2023

Hey @mkrajacic, I was not able to fix it yet.

@brendan-pike
Copy link

brendan-pike commented Jun 15, 2023

Last night I updated Nextcloud from 24 to 26.0.2 and now also found myself with a dead Talk install.
*edit: After reading the make clean I tried that and it now works for me thankfully!

@fancycode
Copy link
Member

If make clean before building helped, this seems to be the same as #180.

@fancycode fancycode closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
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

5 participants