Unable to share calendar
Steps to reproduce
- Create random calendar in web gui
- Import some events
- Try to share the calendar with another user
Expected behaviour
When typing the user's name, auto-completition helps to find the user. When user name is completely entered, a window opens and a click on the remote user's name should activate calendar sharing.
Actual behaviour
No users to share can be found. Even when user names are entered completely and text was confirmed by pressing enter.
Calendar app
1.7.2
CalDAV-clients used: Thunderbird Lightning, DAVx5
Client configuration
Browser: Firefox 71.0.1
Operating system: MX Linux
Server configuration
Operating system: CentOS 7
Web server: Apache
Database: MySQL
PHP version: 7.2
Nextcloud Version: 17.0.2
Updated from an older installed version or fresh install: Fresh installation. Calendar were imported as *.ics files via the Web UI
List of activated apps:
Enabled:
- accessibility: 1.3.0
- activity: 2.10.1
- bruteforcesettings: 1.4.0
- calendar: 1.7.2
- cloud_federation_api: 1.0.0
- comments: 1.7.0
- contacts: 3.1.6
- dav: 1.13.0
- deck: 0.7.0
- federatedfilesharing: 1.7.0
- federation: 1.7.0
- files: 1.12.0
- files_external: 1.8.0
- files_pdfviewer: 1.6.0
- files_rightclick: 0.15.1
- files_sharing: 1.9.0
- files_trashbin: 1.7.0
- files_versions: 1.10.0
- files_videoplayer: 1.6.0
- firstrunwizard: 2.6.0
- gallery: 18.4.0
- issuetemplate: 0.6.0
- logreader: 2.2.0
- lookup_server_connector: 1.5.0
- nextcloud_announcements: 1.6.0
- notifications: 2.5.0
- oauth2: 1.5.0
- password_policy: 1.7.0
- privacy: 1.1.0
- provisioning_api: 1.7.0
- recommendations: 0.5.0
- serverinfo: 1.7.0
- sharebymail: 1.7.0
- support: 1.0.1
- survey_client: 1.5.0
- systemtags: 1.7.0
- text: 1.1.1
- theming: 1.8.0
- twofactor_backupcodes: 1.6.0
- updatenotification: 1.7.0
- viewer: 1.2.0
- workflowengine: 1.7.0
Disabled:
- admin_audit
- encryption
- user_ldap
Nextcloud configuration:
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"domain.com"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "17.0.2.1",
"overwrite.cli.url": "https:\/\/domain.com\/cloud",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"memcache.local": "\\OC\\Memcache\\APCu",
"maintenance": false,
"mail_smtpmode": "smtp",
"mail_sendmailmode": "smtp",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtpauthtype": "LOGIN",
"mail_smtpauth": 1,
"mail_smtpport": "587",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"mail_smtpsecure": "tls"
}
}
Browser log
JQMIGRATE: Migrate is installed, version 1.4.1 jquery-migrate.min.js:2:551
This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”. injectStylesIntoStyleTag.js:201:10
oc_config is deprecated: use OC.config instead globals.js:26:15
oc_requesttoken is deprecated: use OC.requestToken instead globals.js:26:15
Content Security Policy: The page’s settings blocked the loading of a resource at eval (“script-src”). vendor.js:574
oc_current_user is deprecated: use OC.getCurrentUser().uid instead globals.js:26:15
The escapeHTML library is deprecated! It will be removed in nextcloud 19. globals.js:26:15
Attempting to call a FullCalendar method on an element with no calendar. 2 vendor.js:23906:28
The escapeHTML library is deprecated! It will be removed in nextcloud 19. globals.js:26:15
TypeError: r.ocs.data.exact is undefined 18 app.js:1465:15
findSharee app.js:1465
Source map error: Error: NetworkError when attempting to fetch resource.
Resource URL: moz-extension://a131a630-db15-45d5-9b77-b02b05511948/content/js/purify.min.js
Source Map URL: purify.min.js.map
-- Browser console --
XHRGEThttps://domain.com/cloud/ocs/v1.php/apps/files_sharing/api/v1/sharees?format=json&search=L&perPage=200&itemType=principals
[HTTP/2 200 OK 113ms]
TypeError: r.ocs.data.exact is undefined app.min.js:1:25183
XHRGEThttps://domain.com/cloud/ocs/v1.php/apps/files_sharing/api/v1/sharees?format=json&search=Le&perPage=200&itemType=principals
[HTTP/2 200 OK 91ms]
TypeError: r.ocs.data.exact is undefined app.min.js:1:25183
XHRGEThttps://domain.com/cloud/ocs/v1.php/apps/files_sharing/api/v1/sharees?format=json&search=Leo&perPage=200&itemType=principals
[HTTP/2 200 OK 96ms]
TypeError: r.ocs.data.exact is undefined app.min.js:1:25183
XHRGEThttps://domain.com/cloud/ocs/v1.php/apps/files_sharing/api/v1/sharees?format=json&search=Leon&perPage=200&itemType=principals
[HTTP/2 200 OK 94ms]
TypeError: r.ocs.data.exact is undefined app.min.js:1:25183
XHRGEThttps://domain.com/cloud/ocs/v1.php/apps/files_sharing/api/v1/sharees?format=json&search=Leoni&perPage=200&itemType=principals
[HTTP/2 200 OK 80ms]
TypeError: r.ocs.data.exact is undefined app.min.js:1:25183
XHRGEThttps://domain.com/cloud/ocs/v1.php/apps/files_sharing/api/v1/sharees?format=json&search=Leonie&perPage=200&itemType=principals
[HTTP/2 200 OK 81ms]
TypeError: r.ocs.data.exact is undefined app.min.js:1:25183
XHRGEThttps://domain.com/cloud/ocs/v2.php/apps/notifications/api/v2/notifications
[HTTP/2 200 OK 85ms]
XHRGEThttps://domain.com/cloud/ocs/v2.php/apps/notifications/api/v2/notifications
[HTTP/2 200 OK 197ms]
After inspecting the network console, I maybe have an addition, but no solution. On the HTTP GET request to https://domain.com/cloud/ocs/v1.php/apps/files_sharing/api/v1/sharees?format=json&search=L&perPage=200&itemType=principals I see an error 998: Invalid query, please check the syntax. API specifications are here: http://www.freedesktop.org/wiki/Specifications/open-collaboration-services.
Mmh, but how to resolve..?
Please double check that the File sharing app is enabled? Also inspect and post contents of nextcloud.log, an exception may be logged.
You may also inspect sharing settings in /settings/admin/sharing.
Thank you for your reply.
- File sharing is activated (checked in the admin panel: "Allow using Share-API")
- /data/nextcloud.log is empty
- Sharing in contacts app seems to work, however an error
Contact not foundis raised
I found this error message in the error log (via admin panel):
[no app in context] Error: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'SELECT `c`.`carddata`, `c`.`uri` FROM `oc_cards` `c` WHERE `c`.`id` IN (SELECT DISTINCT `cp`.`cardid` FROM `oc_cards_properties` `cp` WHERE (`cp`.`addressbookid` = ?) AND ((`cp`.`name` = ?) OR (`cp`.`name` = ?)) AND (`cp`.`value` COLLATE utf8mb4_general_ci LIKE ?))' with params ["15", "EMAIL", "FN", "%Le%"]:
SQLSTATE[42000]: Syntax error or access violation: 1253 COLLATION 'utf8mb4_general_ci' is not valid for CHARACTER SET 'utf8' at <<closure>>
0. /var/www/virtual/user/cloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 169
Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException("An exception oc ... '", Doctrine\DBAL\Dr ... ]})
1. /var/www/virtual/user/cloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 145
Doctrine\DBAL\DBALException::wrapException(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "An exception oc ... '")
2. /var/www/virtual/user/cloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 911
Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "SELECT `c`.`car ... )", {1: "15",2: "EMA ... "})
3. /var/www/virtual/user/cloud/lib/private/DB/Connection.php line 195
Doctrine\DBAL\Connection->executeQuery("SELECT `c`.`car ... )", ["15","EMAIL","FN","%Le%"], [2,2,2,2], null)
4. /var/www/virtual/user/cloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php line 200
OC\DB\Connection->executeQuery("SELECT `c`.`car ... )", {dcValue1: "15", ... "}, {dcValue1: 2,dcV ... 2})
5. /var/www/virtual/user/cloud/lib/private/DB/QueryBuilder/QueryBuilder.php line 214
Doctrine\DBAL\Query\QueryBuilder->execute()
6. /var/www/virtual/user/cloud/apps/dav/lib/CardDAV/CardDavBackend.php line 934
OC\DB\QueryBuilder\QueryBuilder->execute()
7. /var/www/virtual/user/cloud/apps/dav/lib/CardDAV/AddressBookImpl.php line 113
OCA\DAV\CardDAV\CardDavBackend->search("15", "Le", ["EMAIL","FN"], [])
8. /var/www/virtual/user/cloud/lib/private/ContactsManager.php line 46
OCA\DAV\CardDAV\AddressBookImpl->search("Le", ["EMAIL","FN"], [])
9. /var/www/virtual/user/cloud/lib/private/Collaboration/Collaborators/MailPlugin.php line 82
OC\ContactsManager->search("Le", ["EMAIL","FN"])
10. /var/www/virtual/user/cloud/lib/private/Collaboration/Collaborators/Search.php line 65
OC\Collaboration\Collaborators\MailPlugin->search("Le", 200, 0, OC\Collaboration ... {})
11. /var/www/virtual/user/cloud/apps/files_sharing/lib/Controller/ShareesAPIController.php line 217
OC\Collaboration\Collaborators\Search->search("Le", [0,1,4], true, 200, 0)
12. /var/www/virtual/user/cloud/lib/private/AppFramework/Http/Dispatcher.php line 170
OCA\Files_Sharing\Controller\ShareesAPIController->search("Le", "principals", 1, 200, null, true)
13. /var/www/virtual/user/cloud/lib/private/AppFramework/Http/Dispatcher.php line 99
OC\AppFramework\Http\Dispatcher->executeController(OCA\Files_Sharin ... {}, "search")
14. /var/www/virtual/user/cloud/lib/private/AppFramework/App.php line 126
OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files_Sharin ... {}, "search")
15. /var/www/virtual/user/cloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
OC\AppFramework\App::main("OCA\\Files_Shar ... r", "search", OC\AppFramework\ ... {}, {_route: "ocs.fi ... "})
16. <<closure>>
OC\AppFramework\Routing\RouteActionHandler->__invoke({_route: "ocs.fi ... "})
17. /var/www/virtual/user/cloud/lib/private/Route/Router.php line 297
undefinedundefinedcall_user_func(OC\AppFramework\ ... {}, {_route: "ocs.fi ... "})
18. /var/www/virtual/user/cloud/ocs/v1.php line 82
OC\Route\Router->match("/ocsapp/apps/fi ... s")
GET /cloud/ocs/v1.php/apps/files_sharing/api/v1/sharees?format=json&search=Le&perPage=200&itemType=principals
I resolved the issue. Importing some tables from my old nextcloud instance manually messed up the database as these tables were encoding using utf8_bin instead of utf8mb4_bin. I changed the collation manually in my database (using phpmyadmin). Now it is working again.
Background
What I learned now. In case somebody runs into similiar problems:
The MySQL collation utf8 seems not to use standard 4 byte encoding but 3 bytes instead. This bug was solved by creating the new collation utf8mb4_bin. NextCloud by default switched to that new standard in one of the latest versions. SQL queries on both of these tables are not compatible.
https://help.nextcloud.com/t/nextcloud-14-upgrade-users-database-not-working-properly/36987/5 https://help.nextcloud.com/t/sql-errors-utf8mb4-general-ci-is-not-valid-for-character-set-utf8/51675/2