server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: SQL syntax error when upgrading from NC 29.0.2 to 29.0.3

Open ChristianKaltenecker opened this issue 1 year ago • 11 comments

⚠️ This issue respects the following points: ⚠️

Bug description

I upgraded from Nextcloud 29.0.2 to 29.0.3 and afterwards, I wasn't able to change any files anymore because of an error in the SQL syntax. Then I rolled back to 29.0.2 and everything works again.

Note that the error from the log is from version 29.0.3 before the rollback. The data below regarding my configuration refers to version 29.0.2. For the upgrade, I have used the web-based updater.

I have not found any recent mentions of SQLState 42000, so I guess this problem is not already reported.

Steps to reproduce

  1. Update from 29.0.2 to 29.0.3
  2. Upload/Change any files with the Nextcloud client
  3. The next synchronization fails with the mentioned SQLState error. This way, Nextcloud cannot communicate with the database and no file changes will then be uploaded.

Expected behavior

After the update, the file synchronization should still work.

Installation method

Community Manual installation with Archive

Nextcloud Server version

29

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated from a MINOR version (ex. 22.1 to 22.2)

Are you using the Nextcloud Server Encryption module?

Encryption is Enabled

What user-backends are you using?

  • [X] Default user-backend (database)
  • [ ] LDAP/ Active Directory
  • [ ] SSO - SAML
  • [ ] Other

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "auth.bruteforce.protection.enabled": false,
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "29.0.2.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0
        },
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "maintenance_window_start": 20,
        "theme": "",
        "loglevel": 1,
        "updater.release.channel": "stable",
        "mysql.utf8mb4": true,
        "encryption.legacy_format_support": false,
        "encryption.key_storage_migrated": false,
        "default_phone_region": "DE",
        "app_install_overwrite": [
            "backup"
        ],
        "mail_sendmailmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

Enabled:
  - activity: 2.21.1
  - bruteforcesettings: 2.9.0
  - circles: 29.0.0-dev
  - cloud_federation_api: 1.12.0
  - comments: 1.19.0
  - contactsinteraction: 1.10.0
  - dashboard: 7.9.0
  - dav: 1.30.1
  - encryption: 2.17.0
  - federatedfilesharing: 1.19.0
  - federation: 1.19.0
  - files: 2.1.0
  - files_downloadlimit: 2.0.0
  - files_external: 1.21.0
  - files_pdfviewer: 2.10.0
  - files_reminders: 1.2.0
  - files_sharing: 1.21.0
  - files_trashbin: 1.19.0
  - files_versions: 1.22.0
  - firstrunwizard: 2.18.0
  - logreader: 2.14.0
  - lookup_server_connector: 1.17.0
  - notifications: 2.17.0
  - oauth2: 1.17.0
  - password_policy: 1.19.0
  - photos: 2.5.0
  - privacy: 1.13.0
  - provisioning_api: 1.19.0
  - related_resources: 1.4.0
  - serverinfo: 1.19.0
  - settings: 1.12.0
  - sharebymail: 1.19.0
  - support: 1.12.0
  - survey_client: 1.17.0
  - suspicious_login: 7.0.0
  - systemtags: 1.19.0
  - text: 3.10.0
  - theming: 2.4.0
  - twofactor_backupcodes: 1.18.0
  - twofactor_totp: 11.0.0-dev
  - updatenotification: 1.19.1
  - user_status: 1.9.0
  - viewer: 2.3.0
  - weather_status: 1.9.0
  - workflowengine: 2.11.0
Disabled:
  - admin_audit: 1.19.0
  - calendar: 4.7.0 (installed 4.7.0)
  - data_request: 1.15.0 (installed 1.15.0)
  - drop_account: 2.5.0 (installed 2.5.0)
  - files_markdown: 2.4.1 (installed 2.4.1)
  - nextcloud_announcements: 1.18.0 (installed 1.12.0)
  - onlyoffice: 9.1.2 (installed 9.1.2)
  - recommendations: 2.1.0 (installed 0.8.0)
  - spreed: 18.0.7 (installed 18.0.7)
  - talk_matterbridge: 1.26.0 (installed 1.26.0)
  - unsplash: 2.2.1 (installed 2.2.1)
  - user_ldap: 1.20.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"OG3n9NnsmTQjBZTHzweA","level":3,"time":"2024-06-28T14:43:11+00:00","remoteAddr":"**ommitted**","user":"**omitted**","app":"webdav","method":"PUT","url":"/nextcloud/remote.php/dav/files/**full path removed**","message":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) AND (`sh`.`parent` IS NULL)' at line 1","userAgent":"Mozilla/5.0 (Linux) mirall/3.13.0git (Nextcloud, arch-6.9.6-arch1-1 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"29.0.3.4","exception":{"Exception":"Sabre\\DAV\\Exception","Message":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) AND (`sh`.`parent` IS NULL)' at line 1","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":322,"function":"convertToSabreException","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1137,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":492,"function":"updateFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/Server.php","line":379,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/remote.php","line":172,"args":["/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/File.php","Line":765,"Previous":{"Exception":"Doctrine\\DBAL\\Exception\\SyntaxErrorException","Message":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) AND (`sh`.`parent` IS NULL)' at line 1","Code":1064,"Trace":[{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1943,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1885,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1106,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/DB/Connection.php","line":328,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":344,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":384,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":1046,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":942,"function":"getRows","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Db/ShareWrapperRequestBuilder.php","line":120,"function":"asItems","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Db/ShareWrapperRequest.php","line":294,"function":"getItemsFromRequest","class":"OCA\\Circles\\Db\\ShareWrapperRequestBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Service/ShareWrapperService.php","line":204,"function":"getSharesByFileIds","class":"OCA\\Circles\\Db\\ShareWrapperRequest","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/ShareByCircleProvider.php","line":664,"function":"getSharesByFileIds","class":"OCA\\Circles\\Service\\ShareWrapperService","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Share20/Manager.php","line":1691,"function":"getAccessList","class":"OCA\\Circles\\ShareByCircleProvider","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Encryption/File.php","line":100,"function":"getAccessList","class":"OC\\Share20\\Manager","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Stream/Encryption.php","line":282,"function":"getAccessList","class":"OC\\Encryption\\File","type":"->"},{"function":"stream_open","class":"OC\\Files\\Stream\\Encryption","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Stream/Encryption.php","line":212,"function":"fopen"},{"file":"/var/www/html/nextcloud/lib/private/Files/Stream/Encryption.php","line":187,"function":"wrapSource","class":"OC\\Files\\Stream\\Encryption","type":"::"},{"file":"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":489,"function":"wrap","class":"OC\\Files\\Stream\\Encryption","type":"::"},{"file":"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":1067,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":653,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":250,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1137,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":492,"function":"updateFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/Server.php","line":379,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/remote.php","line":172,"args":["/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":86,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) AND (`sh`.`parent` IS NULL)' at line 1","Code":1064,"Trace":[{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1099,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/DB/Connection.php","line":328,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":344,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":384,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":1046,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":942,"function":"getRows","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Db/ShareWrapperRequestBuilder.php","line":120,"function":"asItems","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Db/ShareWrapperRequest.php","line":294,"function":"getItemsFromRequest","class":"OCA\\Circles\\Db\\ShareWrapperRequestBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Service/ShareWrapperService.php","line":204,"function":"getSharesByFileIds","class":"OCA\\Circles\\Db\\ShareWrapperRequest","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/ShareByCircleProvider.php","line":664,"function":"getSharesByFileIds","class":"OCA\\Circles\\Service\\ShareWrapperService","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Share20/Manager.php","line":1691,"function":"getAccessList","class":"OCA\\Circles\\ShareByCircleProvider","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Encryption/File.php","line":100,"function":"getAccessList","class":"OC\\Share20\\Manager","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Stream/Encryption.php","line":282,"function":"getAccessList","class":"OC\\Encryption\\File","type":"->"},{"function":"stream_open","class":"OC\\Files\\Stream\\Encryption","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Stream/Encryption.php","line":212,"function":"fopen"},{"file":"/var/www/html/nextcloud/lib/private/Files/Stream/Encryption.php","line":187,"function":"wrapSource","class":"OC\\Files\\Stream\\Encryption","type":"::"},{"file":"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":489,"function":"wrap","class":"OC\\Files\\Stream\\Encryption","type":"::"},{"file":"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":1067,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":653,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":250,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1137,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":492,"function":"updateFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/Server.php","line":379,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/remote.php","line":172,"args":["/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":28,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) AND (`sh`.`parent` IS NULL)' at line 1","Code":"42000","Trace":[{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":130,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1099,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/DB/Connection.php","line":328,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":344,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":384,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":1046,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":942,"function":"getRows","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Db/ShareWrapperRequestBuilder.php","line":120,"function":"asItems","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Db/ShareWrapperRequest.php","line":294,"function":"getItemsFromRequest","class":"OCA\\Circles\\Db\\ShareWrapperRequestBuilder","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/Service/ShareWrapperService.php","line":204,"function":"getSharesByFileIds","class":"OCA\\Circles\\Db\\ShareWrapperRequest","type":"->"},{"file":"/var/www/html/nextcloud/apps/circles/lib/ShareByCircleProvider.php","line":664,"function":"getSharesByFileIds","class":"OCA\\Circles\\Service\\ShareWrapperService","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Share20/Manager.php","line":1691,"function":"getAccessList","class":"OCA\\Circles\\ShareByCircleProvider","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Encryption/File.php","line":100,"function":"getAccessList","class":"OC\\Share20\\Manager","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Stream/Encryption.php","line":282,"function":"getAccessList","class":"OC\\Encryption\\File","type":"->"},{"function":"stream_open","class":"OC\\Files\\Stream\\Encryption","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Stream/Encryption.php","line":212,"function":"fopen"},{"file":"/var/www/html/nextcloud/lib/private/Files/Stream/Encryption.php","line":187,"function":"wrapSource","class":"OC\\Files\\Stream\\Encryption","type":"::"},{"file":"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":489,"function":"wrap","class":"OC\\Files\\Stream\\Encryption","type":"::"},{"file":"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":1067,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":653,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":250,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1137,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":492,"function":"updateFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/Server.php","line":379,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/remote.php","line":172,"args":["/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":130}}},"message":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) AND (`sh`.`parent` IS NULL)' at line 1","exception":{},"CustomMessage":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) AND (`sh`.`parent` IS NULL)' at line 1"}}

Additional info

No response

ChristianKaltenecker avatar Jun 28 '24 15:06 ChristianKaltenecker

same here:

{"reqId":"TJtaAzfJNIBglj24SAcw","level":3,"time":"2024-06-28T18:13:49+00:00","remoteAddr":"172.17.22.6","user":"alka","app":"no app in context","method":"POST","url":"/","message":"Exception thrown: Doctrine\\DBAL\\Exception\\SyntaxErrorException","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:127.0) Gecko/20100101 Firefox/127.0","version":"29.0.3.4","exception":{"Exception":"Doctrine\\DBAL\\Exception\\SyntaxErrorException","Message":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) AND (`sh`.`parent` IS NULL)' at line 1","Code":1064,"Trace":[{"file":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Connection.php","line":1943,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},{"file":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Connection.php","line":1885,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Connection.php","line":1106,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/server/www/sms_cloud/lib/private/DB/Connection.php","line":328,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":344,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":384,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":1046,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":942,"function":"getRows","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Db/ShareWrapperRequestBuilder.php","line":120,"function":"asItems","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Db/ShareWrapperRequest.php","line":294,"function":"getItemsFromRequest","class":"OCA\\Circles\\Db\\ShareWrapperRequestBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Service/ShareWrapperService.php","line":204,"function":"getSharesByFileIds","class":"OCA\\Circles\\Db\\ShareWrapperRequest","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/ShareByCircleProvider.php","line":664,"function":"getSharesByFileIds","class":"OCA\\Circles\\Service\\ShareWrapperService","type":"->"},{"file":"/server/www/sms_cloud/lib/private/Share20/Manager.php","line":1691,"function":"getAccessList","class":"OCA\\Circles\\ShareByCircleProvider","type":"->"},{"file":"/server/www/sms_cloud/lib/private/Share20/ShareHelper.php","line":51,"function":"getAccessList","class":"OC\\Share20\\Manager","type":"->"},{"file":"/server/www/sms_cloud/apps/activity/lib/FilesHooks.php","line":598,"function":"getPathsForAccessList","class":"OC\\Share20\\ShareHelper","type":"->"},{"file":"/server/www/sms_cloud/apps/activity/lib/FilesHooks.php","line":351,"function":"getUserPathsFromPath","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/server/www/sms_cloud/apps/activity/lib/FilesHooks.php","line":321,"function":"fileRenaming","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/server/www/sms_cloud/apps/activity/lib/FilesHooksStatic.php","line":75,"function":"fileMovePost","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/server/www/sms_cloud/lib/private/legacy/OC_Hook.php","line":105,"function":"fileMovePost","class":"OCA\\Activity\\FilesHooksStatic","type":"::"},{"file":"/server/www/sms_cloud/lib/private/Files/View.php","line":847,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/server/www/sms_cloud/lib/private/Files/Node/Node.php","line":468,"function":"rename","class":"OC\\Files\\View","type":"->"},{"file":"/server/www/sms_cloud/lib/private/Files/Template/TemplateManager.php","line":297,"function":"move","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/server/www/sms_cloud/lib/private/legacy/OC_Util.php","line":222,"function":"initializeTemplateDirectory","class":"OC\\Files\\Template\\TemplateManager","type":"->"},{"file":"/server/www/sms_cloud/lib/private/User/Session.php","line":580,"function":"copySkeleton","class":"OC_Util","type":"::"},{"file":"/server/www/sms_cloud/lib/private/User/Session.php","line":416,"function":"prepareUserLogin","class":"OC\\User\\Session","type":"->"},{"file":"/server/www/sms_cloud/lib/private/User/Session.php","line":644,"function":"completeLogin","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/lib/private/User/Session.php","line":367,"function":"loginWithPassword","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/lib/private/Setup.php","line":431,"function":"login","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/core/Controller/SetupController.php","line":68,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/lib/base.php","line":998,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":86,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) AND (`sh`.`parent` IS NULL)' at line 1","Code":1064,"Trace":[{"file":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Connection.php","line":1099,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/server/www/sms_cloud/lib/private/DB/Connection.php","line":328,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":344,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":384,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":1046,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":942,"function":"getRows","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Db/ShareWrapperRequestBuilder.php","line":120,"function":"asItems","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Db/ShareWrapperRequest.php","line":294,"function":"getItemsFromRequest","class":"OCA\\Circles\\Db\\ShareWrapperRequestBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Service/ShareWrapperService.php","line":204,"function":"getSharesByFileIds","class":"OCA\\Circles\\Db\\ShareWrapperRequest","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/ShareByCircleProvider.php","line":664,"function":"getSharesByFileIds","class":"OCA\\Circles\\Service\\ShareWrapperService","type":"->"},{"file":"/server/www/sms_cloud/lib/private/Share20/Manager.php","line":1691,"function":"getAccessList","class":"OCA\\Circles\\ShareByCircleProvider","type":"->"},{"file":"/server/www/sms_cloud/lib/private/Share20/ShareHelper.php","line":51,"function":"getAccessList","class":"OC\\Share20\\Manager","type":"->"},{"file":"/server/www/sms_cloud/apps/activity/lib/FilesHooks.php","line":598,"function":"getPathsForAccessList","class":"OC\\Share20\\ShareHelper","type":"->"},{"file":"/server/www/sms_cloud/apps/activity/lib/FilesHooks.php","line":351,"function":"getUserPathsFromPath","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/server/www/sms_cloud/apps/activity/lib/FilesHooks.php","line":321,"function":"fileRenaming","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/server/www/sms_cloud/apps/activity/lib/FilesHooksStatic.php","line":75,"function":"fileMovePost","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/server/www/sms_cloud/lib/private/legacy/OC_Hook.php","line":105,"function":"fileMovePost","class":"OCA\\Activity\\FilesHooksStatic","type":"::"},{"file":"/server/www/sms_cloud/lib/private/Files/View.php","line":847,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/server/www/sms_cloud/lib/private/Files/Node/Node.php","line":468,"function":"rename","class":"OC\\Files\\View","type":"->"},{"file":"/server/www/sms_cloud/lib/private/Files/Template/TemplateManager.php","line":297,"function":"move","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/server/www/sms_cloud/lib/private/legacy/OC_Util.php","line":222,"function":"initializeTemplateDirectory","class":"OC\\Files\\Template\\TemplateManager","type":"->"},{"file":"/server/www/sms_cloud/lib/private/User/Session.php","line":580,"function":"copySkeleton","class":"OC_Util","type":"::"},{"file":"/server/www/sms_cloud/lib/private/User/Session.php","line":416,"function":"prepareUserLogin","class":"OC\\User\\Session","type":"->"},{"file":"/server/www/sms_cloud/lib/private/User/Session.php","line":644,"function":"completeLogin","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/lib/private/User/Session.php","line":367,"function":"loginWithPassword","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/lib/private/Setup.php","line":431,"function":"login","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/core/Controller/SetupController.php","line":68,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/lib/base.php","line":998,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":28,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) AND (`sh`.`parent` IS NULL)' at line 1","Code":"42000","Trace":[{"file":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":130,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Connection.php","line":1099,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/server/www/sms_cloud/lib/private/DB/Connection.php","line":328,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":344,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":384,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":1046,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":942,"function":"getRows","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Db/ShareWrapperRequestBuilder.php","line":120,"function":"asItems","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Db/ShareWrapperRequest.php","line":294,"function":"getItemsFromRequest","class":"OCA\\Circles\\Db\\ShareWrapperRequestBuilder","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/Service/ShareWrapperService.php","line":204,"function":"getSharesByFileIds","class":"OCA\\Circles\\Db\\ShareWrapperRequest","type":"->"},{"file":"/server/www/sms_cloud/apps/circles/lib/ShareByCircleProvider.php","line":664,"function":"getSharesByFileIds","class":"OCA\\Circles\\Service\\ShareWrapperService","type":"->"},{"file":"/server/www/sms_cloud/lib/private/Share20/Manager.php","line":1691,"function":"getAccessList","class":"OCA\\Circles\\ShareByCircleProvider","type":"->"},{"file":"/server/www/sms_cloud/lib/private/Share20/ShareHelper.php","line":51,"function":"getAccessList","class":"OC\\Share20\\Manager","type":"->"},{"file":"/server/www/sms_cloud/apps/activity/lib/FilesHooks.php","line":598,"function":"getPathsForAccessList","class":"OC\\Share20\\ShareHelper","type":"->"},{"file":"/server/www/sms_cloud/apps/activity/lib/FilesHooks.php","line":351,"function":"getUserPathsFromPath","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/server/www/sms_cloud/apps/activity/lib/FilesHooks.php","line":321,"function":"fileRenaming","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/server/www/sms_cloud/apps/activity/lib/FilesHooksStatic.php","line":75,"function":"fileMovePost","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/server/www/sms_cloud/lib/private/legacy/OC_Hook.php","line":105,"function":"fileMovePost","class":"OCA\\Activity\\FilesHooksStatic","type":"::"},{"file":"/server/www/sms_cloud/lib/private/Files/View.php","line":847,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/server/www/sms_cloud/lib/private/Files/Node/Node.php","line":468,"function":"rename","class":"OC\\Files\\View","type":"->"},{"file":"/server/www/sms_cloud/lib/private/Files/Template/TemplateManager.php","line":297,"function":"move","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/server/www/sms_cloud/lib/private/legacy/OC_Util.php","line":222,"function":"initializeTemplateDirectory","class":"OC\\Files\\Template\\TemplateManager","type":"->"},{"file":"/server/www/sms_cloud/lib/private/User/Session.php","line":580,"function":"copySkeleton","class":"OC_Util","type":"::"},{"file":"/server/www/sms_cloud/lib/private/User/Session.php","line":416,"function":"prepareUserLogin","class":"OC\\User\\Session","type":"->"},{"file":"/server/www/sms_cloud/lib/private/User/Session.php","line":644,"function":"completeLogin","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/lib/private/User/Session.php","line":367,"function":"loginWithPassword","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/lib/private/Setup.php","line":431,"function":"login","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/core/Controller/SetupController.php","line":68,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/lib/base.php","line":998,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/server/www/sms_cloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/server/www/sms_cloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":130}},"CustomMessage":"Exception thrown: Doctrine\\DBAL\\Exception\\SyntaxErrorException"},"id":"667f006091fa2"}
 SyntaxErrorException An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) AND (`sh`.`parent` IS NULL)' at line 1
Exception thrown: Doctrine\DBAL\Exception\SyntaxErrorException 
	POST /
	von 172.17.22.6 von alka um 28.06.2024, 20:13:49

Ramalama2 avatar Jun 28 '24 18:06 Ramalama2

Additional report on the forum: https://help.nextcloud.com/t/unable-to-upload-file-to-root-dir-atfer-update-to-29-0-3/196306

Looks like related to Circles/Teams and, specifically, this PR: nextcloud/circles#1601

Not sure why it didn't turn up in earlier testing though. Maybe it's 29 specific. Haven't taken much of a look yet.

joshtrichards avatar Jun 28 '24 18:06 joshtrichards

This might lead to files showing an empty list, which can be quite scary.

It indeed can be fixed by disabling the Circles/Teams app.

brotkastn avatar Jun 28 '24 19:06 brotkastn

This might lead to files showing an empty list, which can be quite scary.

It indeed can be fixed by disabling the Circles/Teams app.

Im sorry! Wrong alert! On my side i had a misconfiguration, after adding apcu/redis + opcache config fixes, it doesn't appear anymore. I did a ton, so i cant say exactly what fixed it, but definitively gone away now.

About the original autor, i cant say much. Maybe he has a misconfiguration either, or its really a bug.

Ramalama2 avatar Jun 28 '24 19:06 Ramalama2

Additional report on the forum: https://help.nextcloud.com/t/unable-to-upload-file-to-root-dir-atfer-update-to-29-0-3/196306

Looks like related to Circles/Teams and, specifically, this PR: nextcloud/circles#1601

Not sure why it didn't turn up in earlier testing though. Maybe it's 29 specific. Haven't taken much of a look yet.

Replyed to the wrong person sorry, i meant @joshtrichards (The reply above)

Ramalama2 avatar Jun 28 '24 19:06 Ramalama2

This might lead to files showing an empty list, which can be quite scary. It indeed can be fixed by disabling the Circles/Teams app. About the original autor, i cant say much. Maybe he has a misconfiguration either, or its really a bug.

I got said SQL ERRORS and had an empty "Files" view as a result. The only thing i did change was to disable Circles/Teams, and the files appeared again.

So yes, this seems to be a bug.

brotkastn avatar Jun 28 '24 19:06 brotkastn

Fix pending in nextcloud/circles#1615

joshtrichards avatar Jun 28 '24 19:06 joshtrichards

Thanks for all the responses and help! After disabling the Circles/Teams app as suggested, even version 29.0.3 does work.

ChristianKaltenecker avatar Jun 28 '24 20:06 ChristianKaltenecker

The same issue was encountered also on an instance that was updated to 27.1.11 (and I guess it also affected stable28 since /nextcloud/circles/pull/1591 was backported and merged on all currently supported versions).

Disabling Circles did helped.

BTW, from the admin I've understood that the issue occurs only when someones tries to upload a file within their root folder; uploading to a sub-folder was not triggering this issue (@joshtrichards, maybe that's why it didn't showed up in earlier testing). And I can confirm that after the update I was able to upload new files in some of the existing sub-directories.

floss4good avatar Jun 29 '24 14:06 floss4good

If anyone wishes to test the fix prior to the next release, the fix can either be manually applied or added as a patch as described in our docs.

As always, any feedback on your experience using the fix, is always appreciated.

Thanks for reporting!

joshtrichards avatar Jun 29 '24 15:06 joshtrichards

I tried to reproduce this issue on a test Nextcloud 27.1.11 instance (so that I can have where to test the fix) but it seems it's not that easy. I created a user, uploaded few folders and files and added a share link; also created a circle and a share to this circle. Meanwhile added other files within the root folder and all were uploaded without issues by the desktop client.

Maybe it is also related to caching, as @Ramalama2 suggested.

floss4good avatar Jun 30 '24 12:06 floss4good

For reference, the error can also be triggered when the activity app generates a new activity entry for a file moved from the root folder. That calls getPathsForAccessList in ShareHelper, which in turn calls getAccessList in ShareManager. As the file is in the root folder no nodes are added to get their access list, so the Circles app tries to get the shares for an empty list of file IDs, which in the end causes AND (()) to be added to the SQL query (getting from getSharesByFileIds to exprLimitArray is left as an exercise for the reader :-P ).

Error log example (note that this is with PostgreSQL, which is slightly different than MySQL/MariaDB):

{"reqId":"K6fQlCFI7KY5uVgaf5QS","level":3,"time":"2024-07-03T03:12:11+00:00","remoteAddr":"192.168.57.21","user":"admin","app":"no app in context","method":"MOVE","url":"/remote.php/dav/files/admin/welcome.txt","message":"Exception thrown: Doctrine\\DBAL\\Exception\\SyntaxErrorException","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0","version":"29.0.3.4","exception":{"Exception":"Doctrine\\DBAL\\Exception\\SyntaxErrorException","Message":"An exception occurred while executing a query: SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near \")\"\nLINE 1: ...level\" = $1) WHERE (\"sh\".\"share_type\" = $2) AND (()) AND (\"s...\n                                                             ^","Code":7,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1943,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1885,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1106,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/html/lib/private/DB/Connection.php","line":328,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":344,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":384,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":1046,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":942,"function":"getRows","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Db/ShareWrapperRequestBuilder.php","line":120,"function":"asItems","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Db/ShareWrapperRequest.php","line":294,"function":"getItemsFromRequest","class":"OCA\\Circles\\Db\\ShareWrapperRequestBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Service/ShareWrapperService.php","line":204,"function":"getSharesByFileIds","class":"OCA\\Circles\\Db\\ShareWrapperRequest","type":"->"},{"file":"/var/www/html/apps/circles/lib/ShareByCircleProvider.php","line":664,"function":"getSharesByFileIds","class":"OCA\\Circles\\Service\\ShareWrapperService","type":"->"},{"file":"/var/www/html/lib/private/Share20/Manager.php","line":1691,"function":"getAccessList","class":"OCA\\Circles\\ShareByCircleProvider","type":"->"},{"file":"/var/www/html/lib/private/Share20/ShareHelper.php","line":51,"function":"getAccessList","class":"OC\\Share20\\Manager","type":"->"},{"file":"/var/www/html/apps/activity/lib/FilesHooks.php","line":598,"function":"getPathsForAccessList","class":"OC\\Share20\\ShareHelper","type":"->"},{"file":"/var/www/html/apps/activity/lib/FilesHooks.php","line":295,"function":"getUserPathsFromPath","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/var/www/html/apps/activity/lib/FilesHooksStatic.php","line":67,"function":"fileMove","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/var/www/html/lib/private/legacy/OC_Hook.php","line":105,"function":"fileMove","class":"OCA\\Activity\\FilesHooksStatic","type":"::"},{"file":"/var/www/html/lib/private/Files/View.php","line":770,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php","line":454,"function":"rename","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php","line":178,"function":"moveInto","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":612,"function":"move","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/apps/dav/lib/Server.php","line":379,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/remote.php","line":172,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php","Line":62,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near \")\"\nLINE 1: ...level\" = $1) WHERE (\"sh\".\"share_type\" = $2) AND (()) AND (\"s...\n                                                             ^","Code":7,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1099,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/html/lib/private/DB/Connection.php","line":328,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":344,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":384,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":1046,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":942,"function":"getRows","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Db/ShareWrapperRequestBuilder.php","line":120,"function":"asItems","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Db/ShareWrapperRequest.php","line":294,"function":"getItemsFromRequest","class":"OCA\\Circles\\Db\\ShareWrapperRequestBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Service/ShareWrapperService.php","line":204,"function":"getSharesByFileIds","class":"OCA\\Circles\\Db\\ShareWrapperRequest","type":"->"},{"file":"/var/www/html/apps/circles/lib/ShareByCircleProvider.php","line":664,"function":"getSharesByFileIds","class":"OCA\\Circles\\Service\\ShareWrapperService","type":"->"},{"file":"/var/www/html/lib/private/Share20/Manager.php","line":1691,"function":"getAccessList","class":"OCA\\Circles\\ShareByCircleProvider","type":"->"},{"file":"/var/www/html/lib/private/Share20/ShareHelper.php","line":51,"function":"getAccessList","class":"OC\\Share20\\Manager","type":"->"},{"file":"/var/www/html/apps/activity/lib/FilesHooks.php","line":598,"function":"getPathsForAccessList","class":"OC\\Share20\\ShareHelper","type":"->"},{"file":"/var/www/html/apps/activity/lib/FilesHooks.php","line":295,"function":"getUserPathsFromPath","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/var/www/html/apps/activity/lib/FilesHooksStatic.php","line":67,"function":"fileMove","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/var/www/html/lib/private/legacy/OC_Hook.php","line":105,"function":"fileMove","class":"OCA\\Activity\\FilesHooksStatic","type":"::"},{"file":"/var/www/html/lib/private/Files/View.php","line":770,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php","line":454,"function":"rename","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php","line":178,"function":"moveInto","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":612,"function":"move","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/apps/dav/lib/Server.php","line":379,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/remote.php","line":172,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":28,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near \")\"\nLINE 1: ...level\" = $1) WHERE (\"sh\".\"share_type\" = $2) AND (()) AND (\"s...\n                                                             ^","Code":"42601","Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":130,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1099,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/html/lib/private/DB/Connection.php","line":328,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":344,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":384,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":1046,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Tools/Db/ExtendedQueryBuilder.php","line":942,"function":"getRows","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Db/ShareWrapperRequestBuilder.php","line":120,"function":"asItems","class":"OCA\\Circles\\Tools\\Db\\ExtendedQueryBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Db/ShareWrapperRequest.php","line":294,"function":"getItemsFromRequest","class":"OCA\\Circles\\Db\\ShareWrapperRequestBuilder","type":"->"},{"file":"/var/www/html/apps/circles/lib/Service/ShareWrapperService.php","line":204,"function":"getSharesByFileIds","class":"OCA\\Circles\\Db\\ShareWrapperRequest","type":"->"},{"file":"/var/www/html/apps/circles/lib/ShareByCircleProvider.php","line":664,"function":"getSharesByFileIds","class":"OCA\\Circles\\Service\\ShareWrapperService","type":"->"},{"file":"/var/www/html/lib/private/Share20/Manager.php","line":1691,"function":"getAccessList","class":"OCA\\Circles\\ShareByCircleProvider","type":"->"},{"file":"/var/www/html/lib/private/Share20/ShareHelper.php","line":51,"function":"getAccessList","class":"OC\\Share20\\Manager","type":"->"},{"file":"/var/www/html/apps/activity/lib/FilesHooks.php","line":598,"function":"getPathsForAccessList","class":"OC\\Share20\\ShareHelper","type":"->"},{"file":"/var/www/html/apps/activity/lib/FilesHooks.php","line":295,"function":"getUserPathsFromPath","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/var/www/html/apps/activity/lib/FilesHooksStatic.php","line":67,"function":"fileMove","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/var/www/html/lib/private/legacy/OC_Hook.php","line":105,"function":"fileMove","class":"OCA\\Activity\\FilesHooksStatic","type":"::"},{"file":"/var/www/html/lib/private/Files/View.php","line":770,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php","line":454,"function":"rename","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php","line":178,"function":"moveInto","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":612,"function":"move","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/apps/dav/lib/Server.php","line":379,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/remote.php","line":172,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":130}},"CustomMessage":"Exception thrown: Doctrine\\DBAL\\Exception\\SyntaxErrorException"}}

Note that, with the activity app, the error will appear in the logs too when moving a file from a subfolder to the root folder, because the paths will be got too after the file was moved and thus at that point the scenario described above happens again (although no error will be shown in the UI in this case).

To reproduce the original report it is necessary to enable server side encryption and disable the master key (which requires setting a configuration of the encryption app, as it is enabled by default. After that when a file is uploaded (or open/downloaded) getAccessList will be called (in File, which in turn calls it in ShareManager), so if the file is in the root folder the same behaviour described above is triggered in the Circles app.

danxuliu avatar Jul 03 '24 03:07 danxuliu

Indeed, after enabling Default encryption module app, enabling server-side encryption (from admin Security settings) and disabling the master key (by running encryption:disable-master-key occ command) I was able to reproduce the error.

BTW, even if the error is thrown, the file seems to be uploaded - or rather just created - on the server, but as an empty file. Soon after, when the desktop client tries to synchronize again, I got an unresolved conflict warning, since the 0 bytes version was downloaded from the server.

After manually patching the return of getSharesByFileIds() function from /apps/circles/lib/Service/ShareWrapperService.php - as in the commit 8553b58 from circles PR 1615 - the SQL error seems to be fixed; I was able to upload a file within the root folder of my test user.

I did run into other encryption related errors, but I think they are not related to the currently tested fix. Right after successfully uploading the file I got a warning saying that no public key found for user "nc27tester", user will not be able to read the file. I quickly learned that, after disabling the master key, individual user keys are being generated when the corresponding users log in. So I deleted the files (just to be sure), logged out and logged in again and then uploaded another file. This time the file was uploaded without errors or warnings, but if I change it (be it locally or using the web interface) the synchronization will fail wilt the following error:

Encryption not ready: multikeydecrypt with share key failed:error:04099079:rsa routines:RSA_padding_check_PKCS1_OAEP_mgf1:oaep decoding error

I might continue the investigation of this new issue later, but I don't think it is related with the current issue or the proposed fix.

LE: Don't know exactly what happened but after several hours, when I wanted to continue the debugging I was able edit and synchronize files uploaded within the root folder without getting the multikeydecrypt error. Maybe some cron job did the thing. For the record, another change that I did yesterday without mentioning it was to add the 'encryption.legacy_format_support' => true, config, because I noticed there was a 'Legacy cipher is no longer supported!' error logged soon after the multikeydecrypt ones.

floss4good avatar Jul 04 '24 16:07 floss4good

I've just tested the proposed fix on Nextcloud Hub 8 (29.0.3), freshly installed via web installer, without recommended apps. Please find below my testing logs:

  • Enabled 'Default encryption module' app;

  • Enabled server-side encryption (from /settings/admin/security);

  • Executed encryption:disable-master-key occ command;

  • Created a new test user;

  • After few minutes, when tried to log in, got an error:

    • Internal Server Error

      The server was unable to complete your request. If this happens again, please send the technical details below to the server administrator. More details can be found in the server log.

  • Checked the logs and for 'index' app (POST /index.php/login) the SQL error was logged:

    • SyntaxErrorException An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) AND (`sh`.`parent` IS NULL)' at line 1

  • Also, for 'no app in context' the following error was logged:

    • Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.

  • as well as the following warning:

    • DecryptionFailedException Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you. issue while running UpdateSingleMetadata

  • After some time tried again to log in and this time worked; however I noticed that besides 'Documents' folder only 'Nextcloud Manual.pdf' was added within the root folder and it had 0B (Quota showed 1.1 MB used).

  • Disabled 'Teams' app (29.0.0-dev);

  • Created a new test user (nc29tester2);

  • Waited few minutes (until the cron had run);

  • Successfully logged in with the second test user and all the default files were created (Quota showed 37.4 MB used);

  • Re-enabled 'Teams' app;

  • Configured the desktop client to synchronize the account of nc29tester2;

  • Only the folders were synchronized (for the files located within the root folder the SQL error was shown);

  • Created a new file, locally, within the root folder; sync failed with the same SQL error.

  • Patched the getSharesByFileIds() function from /apps/circles/lib/Service/ShareWrapperService.php - as done in circles PR 1615;

  • All the files were now synchronized for nc29tester2;

  • Created a new local file placed within the root folder and it was successfully synchronized;

  • Edited some files both locally and using the web editor and the changes were successfully synchronized.

  • Created a third test user and after logging in all the default files were created;

  • As a side note several decryption related errors were logged for 'no app in context' (I suspect that one entry for each file that was created), same as already reported in #40193, but this is another scenario:

    • Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.

Anyhow, the conclusion would be that applying the patch will fix the SQL syntax error.

floss4good avatar Jul 05 '24 22:07 floss4good