Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. ![]()
The Basics
- Nextcloud Server version (e.g., 29.x.x):
- Nextcloud Hub 10 (31.0.8)
- Operating system and version (e.g., Ubuntu 24.04):
- Unraid 7.1.4
- Web server and version (e.g, Apache 2.4.25):
replace me
- Reverse proxy and version _(e.g. nginx 1.27.2)
- Running behind linuxservio’s swag container, latest (4.2.0-ls403). nginx/1.28.0
- PHP version (e.g, 8.3):
- 8.4.11
- Is this the first time you’ve seen this error? (Yes / No):
- yes
- When did this problem seem to first start?
- Just noticed a few days ago as I started experimenting more with search
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
- As a docker container in unraid
- Are you using CloudfIare, mod_security, or similar? (Yes / No)
- No
Summary of the issue you are facing:
When using search in the iOS app, I noticed that files are not found if they are more than one directory deep.
ex: main/notes/foo/bar.txt
If I am in the main folder and search for “bar”, nothing is found.
I also see errors in the logs related to SQL
If I go one directory deeper to “notes” and repeat the same search, bar.txt is returned.
Using MariaDB, database info:
Type: mysql
Version: 11.4.8
Steps to replicate it (hint: details matter!):
- In the iOS app, search for a known existing file while being several directories above that file’s location
- Check logs for errors
Log entries
Nextcloud
Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.
{"reqId":"wW6J0MCIWjfzpIXqMIjK","level":3,"time":"2025-08-26T15:14:02+00:00","remoteAddr":"10.65.165.221","user":"jake","app":"no app in context","method":"GET","url":"/ocs/v2.php/search/providers/audioplayer/search?term=oil","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 'name`)` LIKE '%oil%') AND (`user_id` = 'jake')' at line 1","userAgent":"Mozilla/5.0 (iOS) Nextcloud-iOS/7.1.2","version":"31.0.8.1","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 'name`)` LIKE '%oil%') AND (`user_id` = 'jake')' at line 1","Code":1064,"Trace":[{"file":"/app/www/public/3rdparty/doctrine/dbal/src/Connection.php","line":1976,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},{"file":"/app/www/public/3rdparty/doctrine/dbal/src/Connection.php","line":1918,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/app/www/public/3rdparty/doctrine/dbal/src/Connection.php","line":1111,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/app/www/public/lib/private/DB/Connection.php","line":419,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/app/www/public/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/app/www/public/lib/private/DB/QueryBuilder/QueryBuilder.php","line":289,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/app/www/public/lib/private/DB/QueryBuilder/QueryBuilder.php","line":266,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/config/www/nextcloud/apps/audioplayer/lib/Db/DbMapper.php","line":77,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/config/www/nextcloud/apps/audioplayer/lib/Search/Provider.php","line":52,"function":"search","class":"OCA\\audioplayer\\Db\\DbMapper","type":"->"},{"file":"/app/www/public/lib/private/Search/SearchComposer.php","line":352,"function":"search","class":"OCA\\audioplayer\\Search\\Provider","type":"->"},{"file":"/app/www/public/core/Controller/UnifiedSearchController.php","line":105,"function":"search","class":"OC\\Search\\SearchComposer","type":"->"},{"file":"/app/www/public/lib/private/AppFramework/Http/Dispatcher.php","line":200,"function":"search","class":"OC\\Core\\Controller\\UnifiedSearchController","type":"->"},{"file":"/app/www/public/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/app/www/public/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/app/www/public/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/app/www/public/ocs/v1.php","line":49,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/app/www/public/ocs/v2.php","line":7,"args":["/app/www/public/ocs/v1.php"],"function":"require_once"}],"File":"/app/www/public/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 'name`)` LIKE '%oil%') AND (`user_id` = 'jake')' at line 1","Code":1064,"Trace":[{"file":"/app/www/public/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/app/www/public/3rdparty/doctrine/dbal/src/Connection.php","line":1104,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/app/www/public/lib/private/DB/Connection.php","line":419,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/app/www/public/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/app/www/public/lib/private/DB/QueryBuilder/QueryBuilder.php","line":289,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/app/www/public/lib/private/DB/QueryBuilder/QueryBuilder.php","line":266,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/config/www/nextcloud/apps/audioplayer/lib/Db/DbMapper.php","line":77,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/config/www/nextcloud/apps/audioplayer/lib/Search/Provider.php","line":52,"function":"search","class":"OCA\\audioplayer\\Db\\DbMapper","type":"->"},{"file":"/app/www/public/lib/private/Search/SearchComposer.php","line":352,"function":"search","class":"OCA\\audioplayer\\Search\\Provider","type":"->"},{"file":"/app/www/public/core/Controller/UnifiedSearchController.php","line":105,"function":"search","class":"OC\\Search\\SearchComposer","type":"->"},{"file":"/app/www/public/lib/private/AppFramework/Http/Dispatcher.php","line":200,"function":"search","class":"OC\\Core\\Controller\\UnifiedSearchController","type":"->"},{"file":"/app/www/public/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/app/www/public/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/app/www/public/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/app/www/public/ocs/v1.php","line":49,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/app/www/public/ocs/v2.php","line":7,"args":["/app/www/public/ocs/v1.php"],"function":"require_once"}],"File":"/app/www/public/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":24,"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 'name`)` LIKE '%oil%') AND (`user_id` = 'jake')' at line 1","Code":"42000","Trace":[{"file":"/app/www/public/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":130,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/app/www/public/3rdparty/doctrine/dbal/src/Connection.php","line":1104,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/app/www/public/lib/private/DB/Connection.php","line":419,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/app/www/public/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/app/www/public/lib/private/DB/QueryBuilder/QueryBuilder.php","line":289,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/app/www/public/lib/private/DB/QueryBuilder/QueryBuilder.php","line":266,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/config/www/nextcloud/apps/audioplayer/lib/Db/DbMapper.php","line":77,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/config/www/nextcloud/apps/audioplayer/lib/Search/Provider.php","line":52,"function":"search","class":"OCA\\audioplayer\\Db\\DbMapper","type":"->"},{"file":"/app/www/public/lib/private/Search/SearchComposer.php","line":352,"function":"search","class":"OCA\\audioplayer\\Search\\Provider","type":"->"},{"file":"/app/www/public/core/Controller/UnifiedSearchController.php","line":105,"function":"search","class":"OC\\Search\\SearchComposer","type":"->"},{"file":"/app/www/public/lib/private/AppFramework/Http/Dispatcher.php","line":200,"function":"search","class":"OC\\Core\\Controller\\UnifiedSearchController","type":"->"},{"file":"/app/www/public/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/app/www/public/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/app/www/public/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/app/www/public/ocs/v1.php","line":49,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/app/www/public/ocs/v2.php","line":7,"args":["/app/www/public/ocs/v1.php"],"function":"require_once"}],"File":"/app/www/public/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 'name`)` LIKE '%oil%') AND (`user_id` = 'jake')' 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 'name`)` LIKE '%oil%') AND (`user_id` = 'jake')' at line 1"},"id":"68addf4ac0478"}```
#### Web Browser
If the problem is related to the Web interface, open your browser inspector *Console* and *Network* tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.
PASTE
#### Web server / Reverse Proxy
The output of your Apache/nginx/system log in `/var/log/____`:
PASTE HERE
### Configuration
#### Nextcloud
The output of `occ config:list system` or similar is best, but, if not possible, the contents of your `config.php` file from `/path/to/nextcloud` is fine (make sure to remove any identifiable information!):
{
“system”: {
“memcache.local”: “\OC\Memcache\Redis”,
“memcache.locking”: “\OC\Memcache\APCu”,
“redis”: {
“host”: “REMOVED SENSITIVE VALUE”,
“port”: 6379
},
“datadirectory”: “REMOVED SENSITIVE VALUE”,
“passwordsalt”: “REMOVED SENSITIVE VALUE”,
“secret”: “REMOVED SENSITIVE VALUE”,
“trusted_domains”: [
REMOVED SENSITIVE VALUE
],
“trusted_proxies”: “REMOVED SENSITIVE VALUE”,
“dbtype”: “mysql”,
“version”: “31.0.8.1”,
“overwrite.cli.url”: “REMOVED SENSITIVE VALUE”,
“overwritehost”: “REMOVED SENSITIVE VALUE”,
“overwriteprotocol”: “https”,
“dbname”: “REMOVED SENSITIVE VALUE”,
“dbhost”: “REMOVED SENSITIVE VALUE”,
“dbport”: “”,
“dbtableprefix”: “oc_”,
“mysql.utf8mb4”: true,
“dbuser”: “REMOVED SENSITIVE VALUE”,
“dbpassword”: “REMOVED SENSITIVE VALUE”,
“installed”: true,
“instanceid”: “REMOVED SENSITIVE VALUE”,
“preview_max_x”: 512,
“preview_max_y”: 512,
“preview_max_scale_factor”: 1,
“trashbin_retention_obligation”: “30, 60”,
“maintenance”: false,
“theme”: “”,
“loglevel”: 2,
“filelocking.enabled”: “true”,
“upgrade.disable-web”: true,
“files.chunked_upload.max_size”: 40000000
}
}
#### Apps
The output of `occ app:list` (if possible).
Enabled:
- activity: 4.0.0
- app_api: 5.0.2
- audioplayer: 3.5.1
- bruteforcesettings: 4.0.0
- circles: 31.0.0
- cloud_federation_api: 1.14.0
- comments: 1.21.0
- contactsinteraction: 1.12.0
- dashboard: 7.11.0
- dav: 1.33.0
- federatedfilesharing: 1.21.0
- federation: 1.21.0
- files: 2.3.1
- files_downloadlimit: 4.0.0
- files_pdfviewer: 4.0.0
- files_reminders: 1.4.0
- files_sharing: 1.23.1
- files_trashbin: 1.21.0
- files_versions: 1.24.0
- firstrunwizard: 4.0.0
- logreader: 4.0.0
- lookup_server_connector: 1.19.0
- nextcloud_announcements: 3.0.0
- notes: 4.12.3
- notifications: 4.0.0
- oauth2: 1.19.1
- password_policy: 3.0.0
- photos: 4.0.0
- previewgenerator: 5.9.0
- privacy: 3.0.0
- profile: 1.0.0
- provisioning_api: 1.21.0
- recommendations: 4.0.0
- related_resources: 2.0.0
- serverinfo: 3.0.0
- settings: 1.14.0
- sharebymail: 1.21.0
- support: 3.0.0
- survey_client: 3.0.0
- systemtags: 1.21.1
- text: 5.0.0
- theming: 2.6.1
- twofactor_backupcodes: 1.20.0
- twofactor_totp: 13.0.0-dev.0
- user_status: 1.11.0
- viewer: 4.0.0
- weather_status: 1.11.0
- webhook_listeners: 1.2.0
- workflowengine: 2.13.0
Disabled:
- admin_audit: 1.21.0
- encryption: 2.19.0
- files_external: 1.23.0
- files_fulltextsearch: 31.0.0 (installed 31.0.0)
- files_rightclick: 1.6.0 (installed 1.6.0)
- fulltextsearch: 31.0.0 (installed 31.0.0)
- fulltextsearch_elasticsearch: 31.0.0 (installed 31.0.0)
- suspicious_login: 9.0.1
- twofactor_nextcloud_notification: 5.0.0
- updatenotification: 1.21.0 (installed 1.17.0)
- user_ldap: 1.22.0
### Tips for increasing the likelihood of a response
* Use the `preformatted text` formatting option in the editor for all log entries and configuration output.
* If screenshots are useful, feel free to include them.
- If possible, also include key error output in text form so it can be searched for.
* Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.