SQL error "column "email" does not exist" when searching for internal users

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

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. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 33.0.5
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 12
  • Web server and version (e.g, Apache 2.4.25):
    • Apache
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Apache
  • PHP version (e.g, 8.3):
    • 8.2
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • No idea
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Archive
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

When trying to share a file with another Nextcloud user, the wheel starts spinning but never any result is returned. An (incomplete) SQL (PostgreSQL) error about a missing email column can be found in nextcloud.log:

An exception occurred while executing a query: SQLSTATE[42703]: Undefined column: 7 ERROR: column "email" does not exist\nLINE 1: …"configkey" = ‘email’) WHERE ("uid" ILIKE $1) OR ("email" IL…\n

Steps to replicate it (hint: details matter!):

  1. Select a file in Nextcloud

  2. On the sharing tab, when I click in the Internal Sharing field, the names of some recently used users is shown.

  3. As I want to share with another user, I start typing its name in the field

  4. I get a spinning wheel, but no results are returned

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":"EHXSdZgcA6k5bwENu2gy","level":3,"time":"June 03, 2026 09:14:03","remoteAddr":"192.168.0.10","user":"myusername","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/files_sharing/api/v1/sharees?format=json&itemType=file&search=firstname+lastname&lookup=false&perPage=25&shareType%5B%5D=0&shareType%5B%5D=1&shareType%5B%5D=7&shareType%5B%5D=10&shareType%5B%5D=8&shareType%5B%5D=12&shareType%5B%5D=15","scriptName":"/ocs/v2.php","message":"An exception occurred while executing a query: SQLSTATE[42703]: Undefined column: 7 ERROR:  column \"email\" does not exist\nLINE 1: ...\"configkey\" = 'email') WHERE (\"uid\" ILIKE $1) OR (\"email\" IL...\n                                                             ^","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.1","exception":{"Exception":"OC\\DB\\Exceptions\\DbalException","Message":"An exception occurred while executing a query: SQLSTATE[42703]: Undefined column: 7 ERROR:  column \"email\" does not exist\nLINE 1: ...\"configkey\" = 'email') WHERE (\"uid\" ILIKE $1) OR (\"email\" IL...\n                                                             ^","Code":7,"Trace":[{"file":"/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php","line":53,"function":"wrap","class":"OC\\DB\\Exceptions\\DbalException","type":"::"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":268,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/var/www/nextcloud/apps/guests/lib/UserBackend.php","line":241,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":277,"function":"getDisplayNames","class":"OCA\\Guests\\UserBackend","type":"->"},{"file":"/var/www/nextcloud/lib/private/Collaboration/Collaborators/UserPlugin.php","line":52,"function":"searchDisplayName","class":"OC\\User\\Manager","type":"->"},{"file":"/var/www/nextcloud/lib/private/Collaboration/Collaborators/Search.php","line":47,"function":"search","class":"OC\\Collaboration\\Collaborators\\UserPlugin","type":"->"},{"file":"/var/www/nextcloud/apps/files_sharing/lib/Controller/ShareesAPIController.php","line":186,"function":"search","class":"OC\\Collaboration\\Collaborators\\Search","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":205,"function":"search","class":"OCA\\Files_Sharing\\Controller\\ShareesAPIController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":118,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/ocs/v1.php","line":61,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/ocs/v2.php","line":8,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/DB/Exceptions/DbalException.php","Line":56,"Previous":{"Exception":"Doctrine\\DBAL\\Exception\\InvalidFieldNameException","Message":"An exception occurred while executing a query: SQLSTATE[42703]: Undefined column: 7 ERROR:  column \"email\" does not exist\nLINE 1: ...\"configkey\" = 'email') WHERE (\"uid\" ILIKE $1) OR (\"email\" IL...\n                                                             ^","Code":7,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1976,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1918,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1111,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":420,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":268,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/var/www/nextcloud/apps/guests/lib/UserBackend.php","line":241,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":277,"function":"getDisplayNames","class":"OCA\\Guests\\UserBackend","type":"->"},{"file":"/var/www/nextcloud/lib/private/Collaboration/Collaborators/UserPlugin.php","line":52,"function":"searchDisplayName","class":"OC\\User\\Manager","type":"->"},{"file":"/var/www/nextcloud/lib/private/Collaboration/Collaborators/Search.php","line":47,"function":"search","class":"OC\\Collaboration\\Collaborators\\UserPlugin","type":"->"},{"file":"/var/www/nextcloud/apps/files_sharing/lib/Controller/ShareesAPIController.php","line":186,"function":"search","class":"OC\\Collaboration\\Collaborators\\Search","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":205,"function":"search","class":"OCA\\Files_Sharing\\Controller\\ShareesAPIController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":118,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/ocs/v1.php","line":61,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/ocs/v2.php","line":8,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php","Line":68,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[42703]: Undefined column: 7 ERROR:  column \"email\" does not exist\nLINE 1: ...\"configkey\" = 'email') WHERE (\"uid\" ILIKE $1) OR (\"email\" IL...\n                                                             ^","Code":7,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1104,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":420,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":268,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/var/www/nextcloud/apps/guests/lib/UserBackend.php","line":241,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":277,"function":"getDisplayNames","class":"OCA\\Guests\\UserBackend","type":"->"},{"file":"/var/www/nextcloud/lib/private/Collaboration/Collaborators/UserPlugin.php","line":52,"function":"searchDisplayName","class":"OC\\User\\Manager","type":"->"},{"file":"/var/www/nextcloud/lib/private/Collaboration/Collaborators/Search.php","line":47,"function":"search","class":"OC\\Collaboration\\Collaborators\\UserPlugin","type":"->"},{"file":"/var/www/nextcloud/apps/files_sharing/lib/Controller/ShareesAPIController.php","line":186,"function":"search","class":"OC\\Collaboration\\Collaborators\\Search","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":205,"function":"search","class":"OCA\\Files_Sharing\\Controller\\ShareesAPIController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":118,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/ocs/v1.php","line":61,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/ocs/v2.php","line":8,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":24,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[42703]: Undefined column: 7 ERROR:  column \"email\" does not exist\nLINE 1: ...\"configkey\" = 'email') WHERE (\"uid\" ILIKE $1) OR (\"email\" IL...\n                                                             ^","Code":"42703","Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":130,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1104,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":420,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php","line":50,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":268,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/var/www/nextcloud/apps/guests/lib/UserBackend.php","line":241,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":277,"function":"getDisplayNames","class":"OCA\\Guests\\UserBackend","type":"->"},{"file":"/var/www/nextcloud/lib/private/Collaboration/Collaborators/UserPlugin.php","line":52,"function":"searchDisplayName","class":"OC\\User\\Manager","type":"->"},{"file":"/var/www/nextcloud/lib/private/Collaboration/Collaborators/Search.php","line":47,"function":"search","class":"OC\\Collaboration\\Collaborators\\UserPlugin","type":"->"},{"file":"/var/www/nextcloud/apps/files_sharing/lib/Controller/ShareesAPIController.php","line":186,"function":"search","class":"OC\\Collaboration\\Collaborators\\Search","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":205,"function":"search","class":"OCA\\Files_Sharing\\Controller\\ShareesAPIController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":118,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/ocs/v1.php","line":61,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/ocs/v2.php","line":8,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":130}}},"message":"An exception occurred while executing a query: SQLSTATE[42703]: Undefined column: 7 ERROR:  column \"email\" does not exist\nLINE 1: ...\"configkey\" = 'email') WHERE (\"uid\" ILIKE $1) OR (\"email\" IL...\n                                                             ^","exception":"{\"class\":\"OC\\DB\\Exceptions\\DbalException\",\"message\":\"An exception occurred while executing a query: SQLSTATE[42703]: Undefined column: 7 ERROR:  column \\\"email\\\" does not exist\\nLINE 1: ...\\\"configkey\\\" = 'email') WHERE (\\\"uid\\\" ILIKE $1) OR (\\\"email\\\" IL...\\n                                                             ^\",\"code\":7,\"file\":\"/var/www/nextcloud/lib/private/DB/Exceptions/DbalException.php:56\",\"trace\":\"#0 /var/www/nextcloud/lib/private/DB/ConnectionAdapter.php(53): OC\\DB\\Exceptions\\DbalException::wrap()\\n#1 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(268): OC\\DB\\ConnectionAdapter->executeQuery()\\n#2 /var/www/nextcloud/apps/guests/lib/UserBackend.php(241): OC\\DB\\QueryBuilder\\QueryBuilder->executeQuery()\\n#3 /var/www/nextcloud/lib/private/User/Manager.php(277): OCA\\Guests\\UserBackend->getDisplayNames()\\n#4 /var/www/nextcloud/lib/private/Collaboration/Collaborators/UserPlugin.php(52): OC\\User\\Manager->searchDisplayName()\\n#5 /var/www/nextcloud/lib/private/Collaboration/Collaborators/Search.php(47): OC\\Collaboration\\Collaborators\\UserPlugin->search()\\n#6 /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareesAPIController.php(186): OC\\Collaboration\\Collaborators\\Search->search()\\n#7 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(205): OCA\\Files_Sharing\\Controller\\ShareesAPIController->search()\\n#8 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(118): OC\\AppFramework\\Http\\Dispatcher->executeController()\\n#9 /var/www/nextcloud/lib/private/AppFramework/App.php(153): OC\\AppFramework\\Http\\Dispatcher->dispatch()\\n#10 /var/www/nextcloud/lib/private/Route/Router.php(321): OC\\AppFramework\\App::main()\\n#11 /var/www/nextcloud/ocs/v1.php(61): OC\\Route\\Router->match()\\n#12 /var/www/nextcloud/ocs/v2.php(8): require_once('...')\\n#13 {main}\",\"previous\":{\"class\":\"Doctrine\\DBAL\\Exception\\InvalidFieldNameException\",\"message\":\"An exception occurred while executing a query: SQLSTATE[42703]: Undefined column: 7 ERROR:  column \\\"email\\\" does not exist\\nLINE 1: ...\\\"configkey\\\" = 'email') WHERE (\\\"uid\\\" ILIKE $1) OR (\\\"email\\\" IL...\\n                                                             ^\",\"code\":7,\"file\":\"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php:68\",\"trace\":\"#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1976): Doctrine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter->convert()\\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1918): Doctrine\\DBAL\\Connection->handleDriverException()\\n#2 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1111): Doctrine\\DBAL\\Connection->convertExceptionDuringQuery()\\n#3 /var/www/nextcloud/lib/private/DB/Connection.php(420): Doctrine\\DBAL\\Connection->executeQuery()\\n#4 /var/www/nextcloud/lib/private/DB/ConnectionAdapter.php(50): OC\\DB\\Connection->executeQuery()\\n#5 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(268): OC\\DB\\ConnectionAdapter->executeQuery()\\n#6 /var/www/nextcloud/apps/guests/lib/UserBackend.php(241): OC\\DB\\QueryBuilder\\QueryBuilder->executeQuery()\\n#7 /var/www/nextcloud/lib/private/User/Manager.php(277): OCA\\Guests\\UserBackend->getDisplayNames()\\n#8 /var/www/nextcloud/lib/private/Collaboration/Collaborators/UserPlugin.php(52): OC\\User\\Manager->searchDisplayName()\\n#9 /var/www/nextcloud/lib/private/Collaboration/Collaborators/Search.php(47): OC\\Collaboration\\Collaborators\\UserPlugin->search()\\n#10 /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareesAPIController.php(186): OC\\Collaboration\\Collaborators\\Search->search()\\n#11 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(205): OCA\\Files_Sharing\\Controller\\ShareesAPIController->search()\\n#12 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(118): OC\\AppFramework\\Http\\Dispatcher->executeController()\\n#13 /var/www/nextcloud/lib/private/AppFramework/App.php(153): OC\\AppFramework\\Http\\Dispatcher->dispatch()\\n#14 /var/www/nextcloud/lib/private/Route/Router.php(321): OC\\AppFramework\\App::main()\\n#15 /var/www/nextcloud/ocs/v1.php(61): OC\\Route\\Router->match()\\n#16 /var/www/nextcloud/ocs/v2.php(8): require_once('...')\\n#17 {main}\",\"previous\":{\"class\":\"Doctrine\\DBAL\\Driver\\PDO\\Exception\",\"message\":\"SQLSTATE[42703]: Undefined column: 7 ERROR:  column \\\"email\\\" does not exist\\nLINE 1: ...\\\"configkey\\\" = 'email') WHERE (\\\"uid\\\" ILIKE $1) OR (\\\"email\\\" IL...\\n                                                             ^\",\"code\":7,\"file\":\"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php:24\",\"trace\":\"#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php(132): Doctrine\\DBAL\\Driver\\PDO\\Exception::new()\\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1104): Doctrine\\DBAL\\Driver\\PDO\\Statement->execute()\\n#2 /var/www/nextcloud/lib/private/DB/Connection.php(420): Doctrine\\DBAL\\Connection->executeQuery()\\n#3 /var/www/nextcloud/lib/private/DB/ConnectionAdapter.php(50): OC\\DB\\Connection->executeQuery()\\n#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(268): OC\\DB\\ConnectionAdapter->executeQuery()\\n#5 /var/www/nextcloud/apps/guests/lib/UserBackend.php(241): OC\\DB\\QueryBuilder\\QueryBuilder->executeQuery()\\n#6 /var/www/nextcloud/lib/private/User/Manager.php(277): OCA\\Guests\\UserBackend->getDisplayNames()\\n#7 /var/www/nextcloud/lib/private/Collaboration/Collaborators/UserPlugin.php(52): OC\\User\\Manager->searchDisplayName()\\n#8 /var/www/nextcloud/lib/private/Collaboration/Collaborators/Search.php(47): OC\\Collaboration\\Collaborators\\UserPlugin->search()\\n#9 /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareesAPIController.php(186): OC\\Collaboration\\Collaborators\\Search->search()\\n#10 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(205): OCA\\Files_Sharing\\Controller\\ShareesAPIController->search()\\n#11 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(118): OC\\AppFramework\\Http\\Dispatcher->executeController()\\n#12 /var/www/nextcloud/lib/private/AppFramework/App.php(153): OC\\AppFramework\\Http\\Dispatcher->dispatch()\\n#13 /var/www/nextcloud/lib/private/Route/Router.php(321): OC\\AppFramework\\App::main()\\n#14 /var/www/nextcloud/ocs/v1.php(61): OC\\Route\\Router->match()\\n#15 /var/www/nextcloud/ocs/v2.php(8): require_once('...')\\n#16 {main}\",\"previous\":{\"class\":\"PDOException\",\"message\":\"SQLSTATE[42703]: Undefined column: 7 ERROR:  column \\\"email\\\" does not exist\\nLINE 1: ...\\\"configkey\\\" = 'email') WHERE (\\\"uid\\\" ILIKE $1) OR (\\\"email\\\" IL...\\n                                                             ^\",\"code\":\"42703\",\"file\":\"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php:130\",\"trace\":\"#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php(130): PDOStatement->execute()\\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1104): Doctrine\\DBAL\\Driver\\PDO\\Statement->execute()\\n#2 /var/www/nextcloud/lib/private/DB/Connection.php(420): Doctrine\\DBAL\\Connection->executeQuery()\\n#3 /var/www/nextcloud/lib/private/DB/ConnectionAdapter.php(50): OC\\DB\\Connection->executeQuery()\\n#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(268): OC\\DB\\ConnectionAdapter->executeQuery()\\n#5 /var/www/nextcloud/apps/guests/lib/UserBackend.php(241): OC\\DB\\QueryBuilder\\QueryBuilder->executeQuery()\\n#6 /var/www/nextcloud/lib/private/User/Manager.php(277): OCA\\Guests\\UserBackend->getDisplayNames()\\n#7 /var/www/nextcloud/lib/private/Collaboration/Collaborators/UserPlugin.php(52): OC\\User\\Manager->searchDisplayName()\\n#8 /var/www/nextcloud/lib/private/Collaboration/Collaborators/Search.php(47): OC\\Collaboration\\Collaborators\\UserPlugin->search()\\n#9 /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareesAPIController.php(186): OC\\Collaboration\\Collaborators\\Search->search()\\n#10 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(205): OCA\\Files_Sharing\\Controller\\ShareesAPIController->search()\\n#11 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(118): OC\\AppFramework\\Http\\Dispatcher->executeController()\\n#12 /var/www/nextcloud/lib/private/AppFramework/App.php(153): OC\\AppFramework\\Http\\Dispatcher->dispatch()\\n#13 /var/www/nextcloud/lib/private/Route/Router.php(321): OC\\AppFramework\\App::main()\\n#14 /var/www/nextcloud/ocs/v1.php(61): OC\\Route\\Router->match()\\n#15 /var/www/nextcloud/ocs/v2.php(8): require_once('...')\\n#16 {main}\"}}}}","CustomMessage":"An exception occurred while executing a query: SQLSTATE[42703]: Undefined column: 7 ERROR:  column \"email\" does not exist\nLINE 1: ...\"configkey\" = 'email') WHERE (\"uid\" ILIKE $1) OR (\"email\" IL...\n                                                             ^"}}


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": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.0.1"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "debug": false,
        "version": "33.0.5.1",
        "overwrite.cli.url": "https:\/\/cloud.example.com",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "ldapIgnoreNamingRules": false,
        "htaccess.RewriteBase": "\/",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "overwritehost": "cloud.example.com",
        "overwriteprotocol": "https",
        "skeletondirectory": "",
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [
            "admin"
        ],
        "twofactor_enforced_excluded_groups": [],
        "mail_smtpmode": "sendmail",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "default_phone_region": "BE",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "log_type": "file",
        "logfile": "\/var\/www\/nextcloud\/data\/nextcloud.log",
        "logdateformat": "F d, Y H:i:s",
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "loglevel": 2,
        "theme": "",
        "updater.release.channel": "stable",
        "app_install_overwrite": [
            "unsplash",
            "files_retention",
            "ransomware_detection",
            "files_readmemd",
            "bruteforcesettings",
            "files_antivirus",
            "talk_matterbridge",
            "impersonate",
            "files_markdown",
            "oidc_login"
        ],
        "memories.exiftool": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/exiftool-amd64-glibc",
        "memories.vod.path": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64",
        "allow_user_to_change_display_name": false,
        "oidc_login_auto_redirect": false,
        "oidc_login_provider_url": "https:\/\/auth.example.com\/realms\/bar\/",
        "oidc_login_client_id": "nextcloud",
        "oidc_login_client_secret": "foo",
        "oidc_login_logout_url": "https:\/\/cloud.example.com\/apps\/oidc_login\/oidc",
        "oidc_login_end_session_redirect": true,
        "oidc_login_default_quota": "32212254720",
        "oidc_login_button_text": "Log in with Example.com account",
        "oidc_login_hide_password_form": false,
        "oidc_login_use_id_token": false,
        "oidc_login_attributes": {
            "id": "preferred_username",
            "mail": "email",
            "login_filter": "nextcloudGroups",
            "groups": "nextcloudGroups",
            "is_admin": "nextcloudAdmin"
        },
        "oidc_login_filter_allowed_values": [
            "nextcloud"
        ],
        "oidc_login_use_external_storage": false,
        "oidc_login_scope": "openid profile email roles",
        "oidc_login_proxy_ldap": false,
        "oidc_login_disable_registration": false,
        "oidc_login_redir_fallback": false,
        "oidc_login_tls_verify": true,
        "oidc_create_groups": false,
        "oidc_login_webdav_enabled": true,
        "oidc_login_password_authentication": false,
        "oidc_login_public_key_caching_time": 86400,
        "oidc_login_min_time_between_jwks_requests": 10,
        "oidc_login_well_known_caching_time": 86400,
        "oidc_login_skip_proxy": false,
        "oidc_login_code_challenge_method": "",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "trashbin_retention_obligation": "auto,30",
        "enabledPreviewProviders": [
            "OC\\Preview\\Image",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\TIFF",
            "OC\\Preview\\Movie"
        ],
        "memories.db.triggers.fcu": true,
        "maintenance_window_start": 1,
        "files.chunked_upload.max_size": 104857600
    }
}

Apps

The output of occ app:list (if possible).

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.

@Freg welcome to the Nextcloud community :waving_hand:

  • have you updated DB indices occ db:add-missing-indices?
  • have you updated DB mimetypes occ maintenance:repair --include-expensive?

Yes, I ran both commands, and they did not help unfortunately.

I found the complete error in my PostgreSQL log:

2026-06-03 18:09:05.593 CEST [2508220] ai-nextcloud@ai-nextcloud ERROR:  column "email" does not exist at character 191
2026-06-03 18:09:05.593 CEST [2508220] ai-nextcloud@ai-nextcloud STATEMENT:  SELECT "uid", "displayname" FROM "oc_guests_users" "u" LEFT JOIN "oc_preferences" "p" ON ("userid" = "uid") AND ("appid" = 'settings') AND ("configkey" = 'email') WHERE ("uid" ILIKE $1) OR ("email" ILIKE $2) OR ("displayname" ILIKE $3) OR ("configvalue" ILIKE $4) ORDER BY "uid_lower" ASC LIMIT 25
$ php occ guests:list

In DbalException.php line 56:

An exception occurred while executing a query: SQLSTATE[42703]: Undefined column: 7 ERROR:  column “email” does not exist
LINE 1: SELECT “uid”, “email”, “displayname” FROM “oc_guests_users” …

So the email field in oc_guests_users is missing.

ai-nextcloud=# \d oc_guests_users;
                            Table "public.oc_guests_users"
   Column    |          Type          | Collation | Nullable |         Default         
-------------+------------------------+-----------+----------+-------------------------
 uid         | character varying(64)  |           | not null | ''::character varying
 uid_lower   | character varying(64)  |           | not null | ''::character varying
 displayname | character varying(64)  |           |          | NULL::character varying
 password    | character varying(255) |           | not null | ''::character varying
Indexes:
    "oc_guests_users_pkey" PRIMARY KEY, btree (uid)
    "guests_user_uid_lower" btree (uid_lower)

I removed the guests app because we were not using it anyway, and now it’s working again. I guess some upgrade bug in the guests app caused this problem.