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

Chat loads forever sometimes #9493

Closed
centerionware opened this issue May 8, 2023 · 6 comments · Fixed by #9495
Closed

Chat loads forever sometimes #9493

centerionware opened this issue May 8, 2023 · 6 comments · Fixed by #9495
Labels
Milestone

Comments

@centerionware
Copy link

centerionware commented May 8, 2023

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Install Nextcloud+talk behind Authentik
    2. Use authentik's user id # for nextcloud's UID * I no longer believe this has anything to do with it, it just happened to be at a function call that gets the user id so I thought maybe it has something to do with it
  2. Chat with people

Expected behaviour

Old chats should load

Actual behaviour

One chat I have with one user only loads up around 1/50 times refreshing the page. It doesn't load on the mobile app either. The other conversations I'm having work fine. the only clue i have is the 500 server error and the nextcloud.log log is related to the UID being interpreted as int's(loop variable $i is int but this version of? php expects str for index into (this?)map) instead of strings but they're required to be strings, also is strange(to me! Probably not to the program) that the log shows "no app in context" instead of "spreed" . The messages clearly send since the "last message" (right under the other users username) does always show the last thing sent in that conversation, even though the conversation itself will never load.

In this conversation we had exchanged text messages, tested Video chat (Pre- signaling server but post installing and configuring coturn) that worked well, I uploaded a screenshot from my android phone using the talk app to the conversation, and was switching between my PC and my phone with the app frequently.

Talk app

**Talk app version: 16.0.3

Custom Signaling server configured: yes / github main branch from yesterday

Custom TURN server configured: yes - coturn:latest docker image

Custom STUN server configured: yes

Browser

Microphone available: yes

Camera available: yes

Operating system: Windows/Android

Browser name: Firefox/Chrome/Android Talk App...

Browser version: 85/96/...

Browser log

![image](https://user-images.githubusercontent.com/76805/236880317-c4f9383d-5f48-4cc2-a177-918050efe75a.png)

Server configuration

Operating system: Ubuntu 22.04

Web server: OpenLiteSpeed

Database: PostgreSQL

PHP version: 8.1.2-1ubuntu2.11

Nextcloud Version: Nextcloud Hub 4 (26.0.1)

List of activated apps:

audioplayer cadviewer calendar contacts cookbook deck dicomviewer files_3dmodelviewer forms groupfolders impersonate money notes recognize richdocuments snappymail spreed tasks user_saml

activity cloud_federation_api dav files files_sharing logreader oauth2 provisioning_api settings suspicious_login twofactor_backupcodes user_status
admin_audit comments encryption files_external files_trashbin lookup_server_connector password_policy recommendations sharebymail systemtags twofactor_totp viewer
bruteforcesettings contactsinteraction federatedfilesharing files_pdfviewer files_versions nextcloud_announcements photos related_resources support text updatenotification weather_status
circles dashboard federation files_rightclick firstrunwizard notifications privacy serverinfo survey_client theming user_ldap workflowengine

Nextcloud configuration:

``` '/', 'memcache.local' => '\\OC\\Memcache\\APCu', 'apps_paths' => array ( 0 => array ( 'path' => '/home/files/public_html/apps', 'url' => '/apps', 'writable' => false, ), 1 => array ( 'path' => '/home/files/public_html/custom_apps', 'url' => '/custom_apps', 'writable' => true, ), ), 'overwritehost' => 'nextcloud.REDACTED.com', 'overwriteprotocol' => 'https', 'overwrite.cli.url' => 'https://nextcloud.REDACTED.com', 'trusted_proxies' => array ( 0 => '127.0.0.1', 1 => '192.168.0.0/16', ), 'passwordsalt' => 'REDACTED', 'secret' => 'REDACTED', 'trusted_domains' => array ( 0 => 'localhost', 1 => 'nextcloud.REDACTED.com', ), 'datadirectory' => '/home/files/public_html/data', 'dbtype' => 'pgsql', 'version' => '26.0.1.1', 'dbname' => 'nextcloud', 'dbhost' => 'postgres.REDACTED.com:5432', 'dbport' => '', 'dbtableprefix' => 'oc_', 'dbuser' => 'oc_admin', 'dbpassword' => 'REDACTED', 'default_phone_region' => 'US', 'installed' => true, 'memcache.distributed' => '\\OC\\Memcache\\Redis', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'redis' => array ( 'host' => '/run/redis/redis-server.sock', 'port' => 0, 'dbindex' => 0, ), 'instanceid' => 'REDACTED', 'mail_smtpmode' => 'smtp', 'mail_smtpsecure' => 'ssl', 'mail_sendmailmode' => 'smtp', 'mail_from_address' => 'nextcloud', 'mail_domain' => 'REDACTED', 'mail_smtpauth' => 1, 'mail_smtphost' => 'REDACTED', 'mail_smtpport' => 'REDACTED', 'mail_smtpname' => 'REDACTED', 'mail_smtppassword' => 'REDACTED', 'loglevel' => 2, 'maintenance' => false, 'theme' => '', ); ```

Server log (data/nextcloud.log)

``` {"reqId":"wwFs2MX6NIwkEuWw3hk1","level":3,"time":"2023-05-08T16:25:03+00:00","remoteAddr":"192.168.1.75","user":"4","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/spreed/api/v1/chat/44b6ovv7/462/context?limit=100","message":"OCA\\Talk\\Chat\\Parser\\SystemMessage::getUser(): Argument #1 ($uid) must be of type string, int given, called in /home/files/public_html/custom_apps/spreed/lib/Chat/Parser/SystemMessage.php on line 1008 in file '/home/files/public_html/custom_apps/spreed/lib/Chat/Parser/SystemMessage.php' line 729","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0","version":"26.0.1.1","exception":{"Exception":"Exception","Message":"OCA\\Talk\\Chat\\Parser\\SystemMessage::getUser(): Argument #1 ($uid) must be of type string, int given, called in /home/files/public_html/custom_apps/spreed/lib/Chat/Parser/SystemMessage.php on line 1008 in file '/home/files/public_html/custom_apps/spreed/lib/Chat/Parser/SystemMessage.php' line 729","Code":0,"Trace":[{"file":"/home/files/public_html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/files/public_html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/home/files/public_html/ocs/v1.php","line":64,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/files/public_html/ocs/v2.php","line":23,"args":["/home/files/public_html/ocs/v1.php"],"function":"require_once"}],"File":"/home/files/public_html/lib/private/AppFramework/Http/Dispatcher.php","Line":169,"Previous":{"Exception":"TypeError","Message":"OCA\\Talk\\Chat\\Parser\\SystemMessage::getUser(): Argument #1 ($uid) must be of type string, int given, called in /home/files/public_html/custom_apps/spreed/lib/Chat/Parser/SystemMessage.php on line 1008","Code":0,"Trace":[{"file":"/home/files/public_html/custom_apps/spreed/lib/Chat/Parser/SystemMessage.php","line":1008,"function":"getUser","class":"OCA\\Talk\\Chat\\Parser\\SystemMessage","type":"->"},{"file":"/home/files/public_html/custom_apps/spreed/lib/Chat/Parser/SystemMessage.php","line":181,"function":"parseCall","class":"OCA\\Talk\\Chat\\Parser\\SystemMessage","type":"->"},{"file":"/home/files/public_html/custom_apps/spreed/lib/Chat/Parser/Listener.php","line":88,"function":"parseMessage","class":"OCA\\Talk\\Chat\\Parser\\SystemMessage","type":"->"},{"file":"/home/files/public_html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"parseSystemMessage","class":"OCA\\Talk\\Chat\\Parser\\Listener","type":"::"},{"file":"/home/files/public_html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/home/files/public_html/lib/private/EventDispatcher/EventDispatcher.php","line":87,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/home/files/public_html/custom_apps/spreed/lib/Chat/MessageParser.php","line":77,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/home/files/public_html/custom_apps/spreed/lib/Controller/ChatController.php","line":482,"function":"parseMessage","class":"OCA\\Talk\\Chat\\MessageParser","type":"->"},{"file":"/home/files/public_html/custom_apps/spreed/lib/Controller/ChatController.php","line":606,"function":"prepareCommentsAsDataResponse","class":"OCA\\Talk\\Controller\\ChatController","type":"->"},{"file":"/home/files/public_html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getMessageContext","class":"OCA\\Talk\\Controller\\ChatController","type":"->"},{"file":"/home/files/public_html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/files/public_html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/files/public_html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/home/files/public_html/ocs/v1.php","line":64,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/files/public_html/ocs/v2.php","line":23,"args":["/home/files/public_html/ocs/v1.php"],"function":"require_once"}],"File":"/home/files/public_html/custom_apps/spreed/lib/Chat/Parser/SystemMessage.php","Line":729},"CustomMessage":"--"}} ```
@centerionware
Copy link
Author

I have already (I think) fixed the issue locally, opening the file SystemMessage.php I modified the failing function, simply adding "". before the $i to ensure it's a string when looking up in the paramaters['users'][RIGHT_HERE] and the chat loads again.

@nickvergessen
Copy link
Member

Did you by chance had a call with a user that only has numbers as user id?

@centerionware
Copy link
Author

We did manage a video call, that when ended says @username ended the call with {user1} (Duration 1:29) in this, both user id's should be only numbers as assigned by authentik in my setup

@nickvergessen
Copy link
Member

I managed to create the problem in a test

@nickvergessen
Copy link
Member

In case you want to test the patch:
https://github.com/nextcloud/spreed/pull/9495/files

@centerionware
Copy link
Author

Reverted back to original, applied your patch, confirming the chat is still loading. Thank you!

@nickvergessen nickvergessen added this to the 💘 Next Patch (26) milestone May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants