nextcloud / nextcloud/registration
An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'username' in 'field list'
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 147
- Forks
- 83
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 9
Description
Steps to reproduce
- Installed lates Registration abb (v2.3.0)
Expected behaviour
User registration complete and auto log into the newly created account
Actual behaviour
User registration unable to complete due to error after clicking on "Request Verifikation Link"
Server configuration
Operating system:
Debian 12
Web server:
Apache2
Database:
mysql Ver 15.1 Distrib 10.11.4-MariaDB
PHP version:
PHP 8.2.7
Nextcloud version: (see Nextcloud admin page)
28.0.1
Updated from an older Nextcloud/ownCloud or fresh install:
updated from previous versions
Where did you install Nextcloud from:
Signing status:
Signing status
Login as admin user into your Nextcloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here.
List of activated apps:
App list
``` activity: 2.20.0 - admin_audit: 1.18.0 - bookmarks: 13.1.3 - calendar: 4.6.1 - circles: 28.0.0-dev - cloud_federation_api: 1.11.0 - comments: 1.18.0 - contacts: 5.5.0 - contactsinteraction: 1.9.0 - dashboard: 7.8.0 - dav: 1.29.1 - deck: 1.12.0 - federatedfilesharing: 1.18.0 - federation: 1.18.0 - files: 2.0.0 - files_accesscontrol: 1.18.0 - files_pdfviewer: 2.9.0 - files_reminders: 1.1.0 - files_sharing: 1.20.0 - files_trashbin: 1.18.0 - files_versions: 1.21.0 - firstrunwizard: 2.17.0 - logreader: 2.13.0 - lookup_server_connector: 1.16.0 - nextcloud_announcements: 1.17.0 - notes: 4.9.1 - notifications: 2.16.0 - oauth2: 1.16.3 - password_policy: 1.18.0 - passwords: 2023.12.31 - photos: 2.4.0 - privacy: 1.12.0 - provisioning_api: 1.18.0 - recommendations: 2.0.0 - registration: 2.3.0 - related_resources: 1.3.0 - serverinfo: 1.18.0 - settings: 1.10.1 - sharebymail: 1.18.0 - spreed: 18.0.1 - support: 1.11.0 - survey_client: 1.16.0 - systemtags: 1.18.0 - text: 3.9.1 - theming: 2.3.0 - twofactor_backupcodes: 1.17.0 - updatenotification: 1.18.0 - user_status: 1.8.1 - viewer: 2.2.0 - weather_status: 1.8.0 - workflowengine: 2.10.0 ```The content of config/config.php:
Config report
"system": {
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"localhost",
"192.168.1.8",
"cloud.netcom.systems",
"192.168.1.2",
"192.168.1.254"
],
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"overwrite.cli.url": "https:\/\/cloud.netcom.systems",
"overwriteprotocol": "https",
"dbtype": "mysql",
"version": "28.0.1.1",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"instanceid": "***REMOVED SENSITIVE VALUE***",
"logtimezone": "UTC",
"installed": true,
"theme": "",
"loglevel": 0,
"maintenance": false,
"updater.release.channel": "stable",
"memcache.local": "\\OC\\Memcache\\APCu",
"mail_smtpmode": "smtp",
"enable_previews": true,
"preview_max_x": 2048,
"preview_max_y": 2048,
"enabledPreviewProviders": [
"OC\\Preview\\PNG",
"OC\\Preview\\JPEG",
"OC\\Preview\\GIF",
"OC\\Preview\\BMP",
"OC\\Preview\\XBitmap",
"OC\\Preview\\MP3",
"OC\\Preview\\TXT",
"OC\\Preview\\MarkDown"
],
"app_install_overwrite": [
"bookmarks",
"admin_notifications",
"files_reader"
],
"has_rebuilt_cache": true,
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_sendmailmode": "smtp",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpsecure": "ssl",
"mail_smtpauth": 1,
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "465",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"mysql.utf8mb4": true,
"default_phone_region": "DE",
"updater.secret": "***REMOVED SENSITIVE VALUE***"
}
}
Are you using external storage, if yes which one: local/smb/sftp/...
Are you using encryption: yes/no
no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no
LDAP configuration (delete this part if not used)
LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder
Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';
Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.
Client configuration
Browser:
Operating system:
Logs
Web server error log
Web server error log
Insert your webserver log here
Nextcloud log (data/nextcloud.log)
Nextcloud log
DbalException
An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'username' in 'field list'
/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php
line 328
OC\DB\Exceptions\DbalException::wrap()
/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php
line 137
OC\DB\QueryBuilder\QueryBuilder->executeStatement()
/var/www/nextcloud/apps/registration/lib/Db/RegistrationMapper.php
line 107
OCP\AppFramework\Db\QBMapper->insert()
/var/www/nextcloud/apps/registration/lib/Service/RegistrationService.php
line 108
OCA\Registration\Db\RegistrationMapper->insert()
/var/www/nextcloud/apps/registration/lib/Controller/RegisterController.php
line 139
OCA\Registration\Service\RegistrationService->createRegistration(
"*** sensitive parameters replaced ***"
)
/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php
line 230
OCA\Registration\Controller\RegisterController->submitEmailForm()
/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php
line 137
OC\AppFramework\Http\Dispatcher->executeController()
/var/www/nextcloud/lib/private/AppFramework/App.php
line 184
OC\AppFramework\Http\Dispatcher->dispatch()
/var/www/nextcloud/lib/private/Route/Router.php
line 315
OC\AppFramework\App::main()
/var/www/nextcloud/lib/base.php
line 1069
OC\Route\Router->match()
/var/www/nextcloud/index.php
line 39
OC::handleRequest()
Caused by InvalidFieldNameException
An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'username' in 'field list'
Raw log entry
{
"reqId": "QlqUiGaTQ6THEXAxJXj9",
"level": 3,
"time": "2023-12-29T07:41:52+00:00",
"remoteAddr": "147.161.165.7",
"user": "--",
"app": "index",
"method": "POST",
"url": "/index.php/apps/registration/",
"message": "An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'username' in 'field list'",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0",
"version": "28.0.1.1",
"exception": {
"Exception": "OC\\DB\\Exceptions\\DbalException",
"Message": "An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'username' in 'field list'",
"Code": 1054,
"Trace": [
{
"file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 328,
"function": "wrap",
"class": "OC\\DB\\Exceptions\\DbalException",
"type": "::"
},
{
"file": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
"line": 137,
"function": "executeStatement",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/registration/lib/Db/RegistrationMapper.php",
"line": 107,
"function": "insert",
"class": "OCP\\AppFramework\\Db\\QBMapper",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/registration/lib/Service/RegistrationService.php",
"line": 108,
"function": "insert",
"class": "OCA\\Registration\\Db\\RegistrationMapper",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/registration/lib/Controller/RegisterController.php",
"line": 139,
"function": "createRegistration",
"class": "OCA\\Registration\\Service\\RegistrationService",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 230,
"function": "submitEmailForm",
"class": "OCA\\Registration\\Controller\\RegisterController",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 137,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
"line": 184,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/Route/Router.php",
"line": 315,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
},
{
"file": "/var/www/nextcloud/lib/base.php",
"line": 1069,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
},
{
"file": "/var/www/nextcloud/index.php",
"line": 39,
"function": "handleRequest",
"class": "OC",
"type": "::"
}
],
"File": "/var/www/nextcloud/lib/private/DB/Exceptions/DbalException.php",
"Line": 71,
"Previous": {
"Exception": "Doctrine\\DBAL\\Exception\\InvalidFieldNameException",
"Message": "An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'username' in 'field list'",
"Code": 1054,
"Trace": [
{
"file": "/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
"line": 1938,
"function": "convert",
"class": "Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter",
"type": "->"
},
{
"file": "/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
"line": 1880,
"function": "handleDriverException",
"class": "Doctrine\\DBAL\\Connection",
"type": "->"
},
{
"file": "/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
"line": 1208,
"function": "convertExceptionDuringQuery",
"class": "Doctrine\\DBAL\\Connection",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/DB/Connection.php",
"line": 294,
"function": "executeStatement",
"class": "Doctrine\\DBAL\\Connection",
"type": "->"
},
{
"file": "/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
"line": 386,
"function": "executeStatement",
"class": "OC\\DB\\Connection",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 280,
"function": "execute",
"class": "Doctrine\\DBAL\\Query\\QueryBuilder",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 326,
"function": "execute",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
"line": 137,
"function": "executeStatement",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/registration/lib/Db/RegistrationMapper.php",
"line": 107,
"function": "insert",
"class": "OCP\\AppFramework\\Db\\QBMapper",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/registration/lib/Service/RegistrationService.php",
"line": 108,
"function": "insert",
"class": "OCA\\Registration\\Db\\RegistrationMapper",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/registration/lib/Controller/RegisterController.php",
"line": 139,
"function": "createRegistration",
"class": "OCA\\Registration\\Service\\RegistrationService",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 230,
"function": "submitEmailForm",
"class": "OCA\\Registration\\Controller\\RegisterController",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 137,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
"line": 184,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/Route/Router.php",
"line": 315,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
},
{
"file": "/var/www/nextcloud/lib/base.php",
"line": 1069,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
},
{
"file": "/var/www/nextcloud/index.php",
"line": 39,
"function": "handleRequest",
"class": "OC",
"type": "::"
}
],
"File": "/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php",
"Line": 67,
"Previous": {
"Exception": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
"Message": "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'username' in 'field list'",
"Code": 1054,
"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": 1202,
"function": "execute",
"class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/DB/Connection.php",
"line": 294,
"function": "executeStatement",
"class": "Doctrine\\DBAL\\Connection",
"type": "->"
},
{
"file": "/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
"line": 386,
"function": "executeStatement",
"class": "OC\\DB\\Connection",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 280,
"function": "execute",
"class": "Doctrine\\DBAL\\Query\\QueryBuilder",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 326,
"function": "execute",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
"line": 137,
"function": "executeStatement",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/registration/lib/Db/RegistrationMapper.php",
"line": 107,
"function": "insert",
"class": "OCP\\AppFramework\\Db\\QBMapper",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/registration/lib/Service/RegistrationService.php",
"line": 108,
"function": "insert",
"class": "OCA\\Registration\\Db\\RegistrationMapper",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/registration/lib/Controller/RegisterController.php",
"line": 139,
"function": "createRegistration",
"class": "OCA\\Registration\\Service\\RegistrationService",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 230,
"function": "submitEmailForm",
"class": "OCA\\Registration\\Controller\\RegisterController",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 137,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
"line": 184,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/Route/Router.php",
"line": 315,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
},
{
"file": "/var/www/nextcloud/lib/base.php",
"line": 1069,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
},
{
"file": "/var/www/nextcloud/index.php",
"line": 39,
"function": "handleRequest",
"class": "OC",
"type": "::"
}
],
"File": "/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php",
"Line": 28,
"Previous": {
"Exception": "PDOException",
"Message": "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'username' in 'field list'",
"Code": "42S22",
"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": 1202,
"function": "execute",
"class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/DB/Connection.php",
"line": 294,
"function": "executeStatement",
"class": "Doctrine\\DBAL\\Connection",
"type": "->"
},
{
"file": "/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
"line": 386,
"function": "executeStatement",
"class": "OC\\DB\\Connection",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 280,
"function": "execute",
"class": "Doctrine\\DBAL\\Query\\QueryBuilder",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 326,
"function": "execute",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
"line": 137,
"function": "executeStatement",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/registration/lib/Db/RegistrationMapper.php",
"line": 107,
"function": "insert",
"class": "OCP\\AppFramework\\Db\\QBMapper",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/registration/lib/Service/RegistrationService.php",
"line": 108,
"function": "insert",
"class": "OCA\\Registration\\Db\\RegistrationMapper",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/registration/lib/Controller/RegisterController.php",
"line": 139,
"function": "createRegistration",
"class": "OCA\\Registration\\Service\\RegistrationService",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 230,
"function": "submitEmailForm",
"class": "OCA\\Registration\\Controller\\RegisterController",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 137,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
"line": 184,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/Route/Router.php",
"line": 315,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
},
{
"file": "/var/www/nextcloud/lib/base.php",
"line": 1069,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
},
{
"file": "/var/www/nextcloud/index.php",
"line": 39,
"function": "handleRequest",
"class": "OC",
"type": "::"
}
],
"File": "/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
"Line": 130
}
}
},
"message": "An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'username' in 'field list'",
"exception": [],
"CustomMessage": "An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'username' in 'field list'"
},
"id": "658e7845c1ce5"
}
Browser log
Browser log
Insert your browser log here, this could for example include:
a) The javascript console log
b) The network log
c) ...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing registration with the Registration app on the reported Nextcloud setup, then inspect apps/registration/lib/Db/RegistrationMapper.php at line 107 and the calls from RegistrationService.php and RegisterController.php. Done means the registration request completes without the unknown username column error and the expected account login flow works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mariadb, php
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100