Collabora online open document expired token

Steps to reproduce

  1. Open a richdocument
  2. Keep on open 30 minutes
  3. Then you can not do anything and an error message apears

Expected behaviour

to keep a richdocument opened more than 30 minutes

Actual behaviour

After 30 minutes, you can not work with the document, even save it

Server configuration

Operating system: ubuntu 16.04

Web server: apache 2.4

Database: mariadb 10.1

PHP version: 7.2

ownCloud version: (see ownCloud admin page) 10.5.0.10

Updated from an older ownCloud or fresh install: updated

Where did you install ownCloud from: tar.gz packet code

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

“No error have been found”

The content of config/config.php:

<?php $CONFIG = array ( 'instanceid' => 'ocde02dfcbf8', 'passwordsalt' => '12ecc3db264455356548e26301263b', 'datadirectory' => '/var/www/owncloud/data', 'dbtype' => 'mysql', 'version' => '10.5.0.10', 'dbname' => 'owncloud', 'dbhost' => '************', 'dbtableprefix' => 'oc_', 'dbuser' => '**********', 'dbpassword' => '************', 'installed' => true, 'ldapUserCleanupInterval' => 51, 'theme' => 'sict', 'maintenance' => false, 'trusted_domains' => array ( 0 => '***************************', ), 'mail_smtpmode' => 'smtp', 'mail_smtphost' => '*****************', 'mail_smtpport' => '25', 'mail_smtptimeout' => 10, 'memcache.local' => '\\OC\\Memcache\\Redis', 'filelocking.enabled' => 'true', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'redis' => array ( 'host' => '/tmp/redis.sock', 'port' => 0, ), 'share_folder' => '/Shared', 'overwritewebroot' => '/owncloud', 'loglevel' => 0, 'log_rotate_size' => 104857600, 'preview_libreoffice_path' => '/usr/bin/libreoffice', 'mail_from_address' => 'owncloud.terrassa', 'mail_domain' => 'ct.upc.edu', 'secret' => 'b76126bb72f1ab011163a2d0eb15ff9f0ac31f82405b1826c4421ebf57cfe0c42c828d5af89374d61b9a942bf911b6e8', 'overwrite.cli.url' => '/owncloud', 'trashbin_retention_obligation' => 'auto', 'activity_expire_days' => '180', 'updatechecker' => false, 'ldapIgnoreNamingRules' => false, 'singleuser' => false, ); ``` Log in to the web-UI with an administrator account and click on 'admin' -> 'Generate Config Report' -> 'Download ownCloud config report' This report includes the config.php settings, the list of activated apps and other details in a well sanitized form. or If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your ownCloud installation folder *ATTENTION:* Do not post your config.php file in public as is. Please use one of the above methods whenever possible. Both, the generated reports from the web-ui and from occ config:list consistently remove sensitive data. You still may want to review the report before sending. If done manually then it is critical for your own privacy to dilligently remove *all* host names, passwords, usernames, salts and other credentials before posting. You should assume that attackers find such information and will use them against your systems. ``` { "system": { "instanceid": "ocde02dfcbf8", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "datadirectory": "\/var\/www\/owncloud\/data", "dbtype": "mysql", "version": "10.5.0.10", "dbname": "owncloud", "dbhost": "172.16.1.27", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "ldapUserCleanupInterval": 51, "theme": "sict", "maintenance": false, "trusted_domains": [ "nuvol.terrassa.upc.edu" ], "mail_smtpmode": "smtp", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "25", "mail_smtptimeout": 10, "memcache.local": "\\OC\\Memcache\\Redis", "filelocking.enabled": "true", "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "\/tmp\/redis.sock", "port": 0 }, "share_folder": "\/Shared", "overwritewebroot": "\/owncloud", "loglevel": 0, "log_rotate_size": 104857600, "preview_libreoffice_path": "\/usr\/bin\/libreoffice", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "overwrite.cli.url": "\/owncloud", "trashbin_retention_obligation": "auto", "activity_expire_days": "180", "updatechecker": false, "ldapIgnoreNamingRules": false, "singleuser": false } } **List of activated apps:** ``` - activity: 2.6.0 - announcementcenter: 1.2.1 - bookmarks: 0.10.6 - calendar: 1.6.4 - comments: 0.3.0 - configreport: 0.2.0 - contacts: 1.5.5 - dav: 0.6.0 - federatedfilesharing: 0.5.0 - federation: 0.1.0 - files: 1.5.2 - files_external: 0.7.1 - files_mediaviewer: 1.0.3 - files_pdfviewer: 0.11.2 - files_sharing: 0.13.0 - files_texteditor: 2.3.0 - files_trashbin: 0.9.1 - files_versions: 1.3.0 - firstrunwizard: 1.2.0 - gallery: 16.1.1 - impersonate: 0.5.0 - market: 0.6.0 - notes: 2.0.6 - notifications: 0.5.2 - provisioning_api: 0.5.0 - qownnotesapi: 19.1.0 - richdocuments: 2.4.1 - systemtags: 0.3.0 - tasks: 0.9.7 - templateeditor: 0.4.0 - updatenotification: 0.2.1 - user_ldap: 0.15.2 If you have access to your command line run e.g.: sudo -u www-data php occ app:list from within your ownCloud installation folder. ``` **Are you using external storage, if yes which one:** local/smb/sftp/... NO **Are you using encryption:** yes/no NO **Are you using an external user-backend, if yes which one:** LDAP/ActiveDirectory/Webdav/... LDAP #### LDAP configuration (delete this part if not used) +-------------------------------+--------------------------------------------------------------------------------------------------------+ | Configuration | | +-------------------------------+--------------------------------------------------------------------------------------------------------+ | hasMemberOfFilterSupport | | | hasPagedResultSupport | | | homeFolderNamingRule | | | lastJpegPhotoLookup | 0 | | ldapAgentName | cn=smbldap-tools,ou=DSA,dc=ct,dc=upc,dc=es | | ldapAgentPassword | *** | | ldapAttributesForGroupSearch | cn | | ldapAttributesForUserSearch | uid;displayname | | ldapBackupHost | ldaps://ldapsec-ct.upc.edu | | ldapBackupPort | 636 | | ldapBase | dc=ct,dc=upc,dc=es | | ldapBaseGroups | ou=Groups,dc=ct,dc=upc,dc=es | | ldapBaseUsers | ou=Users,dc=ct,dc=upc,dc=es | | ldapCacheTTL | 600 | | ldapConfigurationActive | 1 | | ldapDynamicGroupMemberURL | | | ldapEmailAttribute | mail | | ldapExperiencedAdmin | 0 | | ldapExpertUUIDGroupAttr | | | ldapExpertUUIDUserAttr | entryuuid | | ldapExpertUsernameAttr | | | ldapGroupDisplayName | cn | | ldapGroupFilter | (&(objectClass=ownCloudGroup)(ownCloudEnabled=1)) | | ldapGroupFilterGroups | cd6;plataforma;sbasics;sict;sict220;sict320;sict370;sictserveis;som;som170;telematica;telesom;ugct;ugt | | ldapGroupFilterMode | 1 | | ldapGroupFilterObjectclass | | | ldapGroupMemberAssocAttr | memberUid | | ldapHost | ldaps://ldap-ct.upc.edu | | ldapIgnoreNamingRules | | | ldapLoginFilter | (&(objectclass=inetOrgPerson)(|(uid=%uid)(|(uid=%uid)))) | | ldapLoginFilterAttributes | uid | | ldapLoginFilterEmail | 0 | | ldapLoginFilterMode | 1 | | ldapLoginFilterUsername | 1 | | ldapNestedGroups | 0 | | ldapNetworkTimeout | 2 | | ldapOverrideMainServer | 0 | | ldapPagingSize | 0 | | ldapPort | 636 | | ldapQuotaAttribute | ownCloudQuota | | ldapQuotaDefault | 25 GB | | ldapTLS | 0 | | ldapUserDisplayName | uid | | ldapUserDisplayName2 | | | ldapUserFilter | (&(objectclass=inetOrgPerson)(!(sambaAcctFlags=[DUX]))(!(gidNumber=1079))) | | ldapUserFilterGroups | | | ldapUserFilterMode | 1 | | ldapUserFilterObjectclass | inetOrgPerson | | ldapUserName | samaccountname | | ldapUuidGroupAttribute | auto | | ldapUuidUserAttribute | auto | | turnOffCertCheck | 0 | | useMemberOfToDetectMembership | 1 | +-------------------------------+--------------------------------------------------------------------------------------------------------+ ``` With access to your command line run e.g.: sudo -u www-data php occ ldap:show-config from within your ownCloud installation folder Without access to your command line download the data/owncloud.db to your local computer or access your SQL server remotely and run the select query: SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap'; Eventually replace sensitive data as the name/IP-address of your LDAP server or groups. ``` ### Client configuration **Browser:** Chrome **Operating system:** Windows ### Logs #### Web server error log ``` Insert your webserver log here ``` #### ownCloud log (data/owncloud.log) ``` Insert your ownCloud log here ``` #### Browser log ``` Insert your browser log here, this could for example include: Loolwsd Log (CODE Server): wsd-96311-81164 2020-11-27 07:40:51.725188 [ docbroker_01c ] ERR Cannot save docKey [/owncloud/index.php/apps/richdocuments/wopi/files/11670691_ocde02dfcbf8_0_0] to storage URI [https://nuvol.terrassa.upc.edu/owncloud/index.php/apps/richdocuments/wopi/files/11670691_ocde02dfcbf8_0_0?access_token=X7dF8wHs89DGKQGgSGgHtn9InGlsxZYB&access_token_ttl=0&reuse_cookies=_ga%3DGA1.2.1899751546.1599542935%3A_gid%3DGA1.2.736714189.1606301780]. Invalid or expired access token. Notifying client.| wsd/DocumentBroker.cpp:1157 wsd-96311-81164 2020-11-27 07:40:51.725221 [ docbroker_01c ] ERR error: cmd=storage kind=saveunauthorized| ./common/Session.hpp:137 wsd-96311-81164 2020-11-27 07:41:08.894329 [ docbroker_01c ] ERR Cannot save docKey [/owncloud/index.php/apps/richdocuments/wopi/files/11670691_ocde02dfcbf8_0_0] to storage URI [https://nuvol.terrassa.upc.edu/owncloud/index.php/apps/richdocuments/wopi/files/11670691_ocde02dfcbf8_0_0?access_token=X7dF8wHs89DGKQGgSGgHtn9InGlsxZYB&access_token_ttl=0&reuse_cookies=_ga%3DGA1.2.1899751546.1599542935%3A_gid%3DGA1.2.736714189.1606301780]. Invalid or expired access token. Notifying client.| wsd/DocumentBroker.cpp:1157 wsd-96311-81164 2020-11-27 07:41:08.894414 [ docbroker_01c ] ERR error: cmd=storage kind=saveunauthorized| ./common/Session.hpp:137 wsd-96311-81164 2020-11-27 07:41:08.895055 [ docbroker_01c ] ERR DocumentBroker stopping although modified Broker: 20201028Notes reunio coordinacio.odt pid: 48913 *** Marked to destroy ***

Hi @fbassas,

We solved the main problem by extending token life with this pull request:

In addition, we enhanced user experience of expired token, users will be notified before token about to expire:

These fixes will be in next release of richdocumets app. For now, you can apply https://github.com/owncloud/richdocuments/pull/360 as patch until the new version is released.

Thank you

2 Likes

Hi @karakayasemi,
thanks for your quick answer. I’m going to apply to patch right now.

Best regards.