The Basics
- Nextcloud Server version (e.g., 29.x.x): 31.0.4.1
- Operating system and version (e.g., Ubuntu 24.04): Ubuntu 24.04
- Web server and version (e.g, Apache 2.4.25): Apache 2.4.25
- Reverse proxy and version _(e.g. nginx 1.27.2): none
- PHP version (e.g, 8.3): 8.4
- Is this the first time you’ve seen this error? (Yes / No): Yes
- When did this problem seem to first start? Three weeks ago
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.): Bare Metal
- Are you using CloudfIare, mod_security, or similar? (Yes / No): No
Summary of the issue you are facing:
When I attempted to access my Nextcloud server I was faced with the following error message:
"Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log."
Since then I have found in the nextcloud.log (see below) an error stating “Failed to connect to the database: An exception occurred in the driver: could not find driver”.
I have found other requests for help with similar details, most hinting at missing php modules or issues surrounding my config.php file, as well as suggestions to update the server from Ubuntu 22.04 to 24.04 (none of which were successful).
The last post suggested running a php-updater script (Internal server error - Failed to connect to the database) which I completed, however this also failed to resolve the issue.
Steps to replicate it (hint: details matter!):
- Updated Ubuntu server from 22.04 to Ubuntu 24.04
- Updated all PHP Modules to latest and removed all previous Modules
- Tried to setup a similar server on a VirtualMachine to compare with current Bare Metal system (but failed to get it off the ground)
Log entries
Nextcloud
{“reqId”:“8JoDrx4VTvrVwzmMf4n4”,“level”:3,“time”:“2025-04-29T19:13:16+00:00”,“remoteAddr”:“192.168.1.23”,“user”:false,“app”:“core”,“metho
d”:“GET”,“url”:“/index.php/204”,“message”:“Failed to connect to the database: An exception occurred in the driver: could not find driver”
,“userAgent”:“Mozilla/5.0 (Linux) mirall/3.11.0git (Nextcloud, ubuntu-6.8.0-58-generic ClientArchitecture: x86_64 OsArchitecture: x86_64)
“,“version”:“31.0.4.1”,“exception”:{“Exception”:“Doctrine\DBAL\Exception”,“Message”:“Failed to connect to the database: An exception oc
curred in the driver: could not find driver”,“Code”:0,“Trace”:[{“file”:”/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php”,“li
ne”:458,“function”:“connect”,“class”:“OC\DB\Connection”,“type”:“->”},{“file”:“/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.
php”,“line”:416,“function”:“getDatabasePlatformVersion”,“class”:“Doctrine\DBAL\Connection”,“type”:“->”},{“file”:“/var/www/nextcloud/3rd
party/doctrine/dbal/src/Connection.php”,“line”:323,“function”:“detectDatabasePlatform”,“class”:“Doctrine\DBAL\Connection”,“type”:“->”},
{“file”:“/var/www/nextcloud/lib/private/DB/Connection.php”,“line”:903,“function”:“getDatabasePlatform”,“class”:“Doctrine\DBAL\Connectio
n”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php”,“line”:235,“function”:“getDatabaseProvider”,“class”:“OC
\DB\Connection”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php”,“line”:96,“function”:“getDatabas
eProvider”,“class”:“OC\DB\ConnectionAdapter”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/AppConfig.php”,“line”:1226,“function”
:“expr”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/AppConfig.php”,“line”:243,“func
tion”:“loadConfig”,“class”:“OC\AppConfig”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/legacy/OC_App.php”,“line”:653,“function”:
“searchValues”,“class”:“OC\AppConfig”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/TemplateLayout.php”,“line”:202,“function”:“ge
tAppVersions”,“class”:“OC_App”,“type”:“::”},{“file”:“/var/www/nextcloud/lib/private/legacy/OC_Template.php”,“line”:120,“function”:“__cons
truct”,“class”:“OC\TemplateLayout”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/Template/Base.php”,“line”:113,“function”:“fetchP
age”,“class”:“OC_Template”,“type”:“->”},{“file”:“/var/www/nextcloud/lib/private/legacy/OC_Template.php”,“line”:297,“function”:“printPage”
,“class”:“OC\Template\Base”,“type”:“->”},{“file”:“/var/www/nextcloud/index.php”,“line”:89,“function”:“printExceptionErrorPage”,“class”:
“OC_Template”,“type”:“::”}],“File”:“/var/www/nextcloud/lib/private/DB/Connection.php”,“Line”:237,“message”:“Failed to connect to the data
base: An exception occurred in the driver: could not find driver”,“exception”:{},“CustomMessage”:“Failed to connect to the database: An e
xception occurred in the driver: could not find driver”}}
Web server / Reverse Proxy
/var/log/apapche2/nextcloud_error.log:
[Tue Apr 29 19:11:23.584857 2025] [core:info] [pid 702965] [client 192.168.1.23:48914] AH00128: File does not exist: /var/www/nextcloud/favicon.ico, referer: http://192.168.1.2/index.php/login
Nextcloud Configuration
{
“system”: {
“instanceid”: “REMOVED SENSITIVE VALUE”,
“passwordsalt”: “REMOVED SENSITIVE VALUE”,
“secret”: “REMOVED SENSITIVE VALUE”,
“trusted_domains”: [
“192.168.1.2”,
“localhost”,
“nextcloud.bearbttm.uk”
],
“datadirectory”: “REMOVED SENSITIVE VALUE”,
“dbtype”: “mysql”,
“version”: “31.0.4.1”,
“overwrite.cli.url”: “http://192.168.1.2”,
“htaccess.RewriteBase”: “/”,
“dbname”: “REMOVED SENSITIVE VALUE”,
“dbhost”: “REMOVED SENSITIVE VALUE”,
“dbport”: “”,
“dbtableprefix”: “oc_”,
“mysql.utf8mb4”: true,
“dbuser”: “REMOVED SENSITIVE VALUE”,
“dbpassword”: “REMOVED SENSITIVE VALUE”,
“installed”: true,
“default_phone_region”: “GB”,
“force_language”: “en”,
“default_locale”: “en_GB”,
“force_locale”: “en_GB”,
“knowledgebaseenabled”: true,
“remember_login_cookie_lifetime”: 2592000,
“session_lifetime”: 86400,
“session_keepalive”: false,
“auto_logout”: true,
“token_auth_enforced”: false,
“auth.bruteforce.protection.enabled”: true,
“auth.webauthn.enabled”: false,
“updatechecker”: true,
“updater.service.url”: “https://updates.nextcloud.com/updater_server/”,
“updater.release.channel”: “stable”,
“config_is_read_only”: false,
“maintenance”: false,
“maintenance_window_start”: 1,
“theme”: “”,
“loglevel”: 2,
“memories.db.triggers.fcu”: true,
“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”,
“memories.vod.ffmpeg”: “/usr/bin/ffmpeg”,
“memories.vod.ffprobe”: “/usr/bin/ffprobe”
},
Apps
“apps”: {
“activity”: {
“enabled”: “yes”,
“installed_version”: “4.0.0”,
“types”: “filesystem”
},
“admin_audit”: {
“enabled”: “yes”,
“installed_version”: “1.21.0”,
“types”: “logging”
},
“app_api”: {
“enabled”: “yes”,
“installed_version”: “5.0.2”,
“types”: “”
},
“audioplayer”: {
“enabled”: “no”,
“installed_version”: “3.4.1”,
“types”: “filesystem”
},
“backgroundjob”: {
“lastjob”: “34”
},
“bruteForce”: {
“whitelist_1”: “192.168.1.0/24”,
“whitelist_2”: “10.147.20.0/24”
},
“bruteforcesettings”: {
“enabled”: “yes”,
“installed_version”: “4.0.0”,
“types”: “”
},
“calendar”: {
“enabled”: “yes”,
“installed_version”: “5.2.1”,
“types”: “”
},
“circles”: {
“enabled”: “no”,
“installed_version”: “29.0.0-dev”,
“loopback_tmp_scheme”: “http”,
“maintenance_run”: “0”,
“maintenance_update”: “{"3":1722621087,"2":1722621087,"1":1722621087}”,
“types”: “filesystem,dav”
},
“cloud_federation_api”: {
“enabled”: “yes”,
“installed_version”: “1.14.0”,
“types”: “filesystem”
},
“comments”: {
“enabled”: “no”,
“installed_version”: “1.19.0”,
“types”: “logging”
},
“contacts”: {
“enabled”: “yes”,
“installed_version”: “7.0.6”,
“types”: “dav”
},
“contactsinteraction”: {
“enabled”: “yes”,
“installed_version”: “1.12.0”,
“types”: “dav”
},
“cookbook”: {
“enabled”: “yes”,
“installed_version”: “0.11.3”,
“types”: “”
},
“core”: {
“backgroundjobs_mode”: “cron”,
“installedat”: “1722621010.2226”,
“lastcron”: 1745944013,
“lastupdateResult”: “”,
“lastupdatedat”: 1745889489,
“metadataGenerationDone”: true,
“moveavatarsdone”: “yes”,
“previewsCleanedUp”: “1”,
“public_files”: “files_sharing/public.php”,
“shareapi_default_permissions”: “1”,
“shareapi_enabled”: “no”,
“updater.secret.created”: 1736694871,
“vendor”: “nextcloud”,
“files_metadata”: {
“photos-original_date_time”: {
“value”: null,
“type”: “int”,
“etag”: “”,
“indexed”: true,
“editPermission”: 0
},
“photos-size”: {
“value”: null,
“type”: “array”,
“etag”: “”,
“indexed”: false,
“editPermission”: 0
},
“photos-exif”: {
“value”: null,
“type”: “array”,
“etag”: “”,
“indexed”: false,
“editPermission”: 0
},
“photos-ifd0”: {
“value”: null,
“type”: “array”,
“etag”: “”,
“indexed”: false,
“editPermission”: 0
},
“blurhash”: {
“value”: null,
“type”: “string”,
“etag”: “295d58b2505c3912b5f94fc402e3b569”,
“indexed”: false,
“editPermission”: 0
}
},
“oc.integritycheck.checker”:
},
“dashboard”: {
“enabled”: “yes”,
“installed_version”: “7.11.0”,
“types”: “”
},
“dav”: {
“buildCalendarReminderIndex”: “yes”,
“buildCalendarSearchIndex”: “yes”,
“builtSocialSearchIndex”: “yes”,
“chunks_migrated”: “1”,
“enabled”: “yes”,
“installed_version”: “1.33.0”,
“regeneratedBirthdayCalendarsForYearFix”: “yes”,
“types”: “filesystem”
},
“external”: {
“enabled”: “yes”,
“installed_version”: “6.0.2”,
“jwt_token_privkey_es256”: “REMOVED SENSITIVE VALUE”,
“jwt_token_pubkey_es256”: “-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEq1E8sSSiHVtR98VJEU41EtgbqWi8\nlPamK18UzDrX5ZZeJ+7WeWh5NBi+jZNdht6W2eK4aZJsveI1Mfyzl9O3KA==\n-----END PUBLIC KEY-----\n”,
“max_site”: 1,
“sites”: “REMOVED SENSITIVE VALUE”,
“types”: “”
},
“federatedfilesharing”: {
“enabled”: “yes”,
“installed_version”: “1.21.0”,
“types”: “”
},
“federation”: {
“enabled”: “yes”,
“installed_version”: “1.21.0”,
“types”: “authentication”
},
“files”: {
“enabled”: “yes”,
“installed_version”: “2.3.1”,
“mimetype_version”: “29.0.4.1”,
“types”: “filesystem”
},
“files_antivirus”: {
“av_cmd_options”: “”,
“av_host”: “”,
“av_icap_mode”: “reqmod”,
“av_icap_request_service”: “avscan”,
“av_icap_response_header”: “X-Infection-Found”,
“av_icap_tls”: “0”,
“av_infected_action”: “only_log”,
“av_max_file_size”: “-1”,
“av_mode”: “executable”,
“av_path”: “/usr/bin/clamscan”,
“av_port”: “0”,
“av_scan_first_bytes”: “-1”,
“av_socket”: “/var/run/clamav/clamd.ctl”,
“av_stream_max_length”: “26214400”,
“enabled”: “no”,
“installed_version”: “5.5.7”,
“types”: “filesystem,dav”
},
“files_downloadlimit”: {
“enabled”: “yes”,
“installed_version”: “4.0.0”,
“types”: “”
},
“files_external”: {
“enabled”: “yes”,
“installed_version”: “1.23.0”,
“types”: “filesystem”
},
“files_fulltextsearch”: {
“enabled”: “no”,
“installed_version”: “30.0.0”,
“types”: “filesystem”
},
“files_pdfviewer”: {
“enabled”: “yes”,
“installed_version”: “4.0.0”,
“types”: “”
},
“files_reminders”: {
“enabled”: “yes”,
“installed_version”: “1.4.0”,
“types”: “”
},
“files_sharing”: {
“enabled”: “yes”,
“incoming_server2server_share_enabled”: “no”,
“installed_version”: “1.23.1”,
“lookupServerEnabled”: “no”,
“lookupServerUploadEnabled”: “no”,
“outgoing_server2server_share_enabled”: “no”,
“types”: “filesystem”
},
“files_trashbin”: {
“enabled”: “yes”,
“installed_version”: “1.21.0”,
“types”: “filesystem,dav”
},
“files_versions”: {
“enabled”: “yes”,
“installed_version”: “1.24.0”,
“types”: “filesystem,dav”
},
“files_zip”: {
“enabled”: “yes”,
“installed_version”: “2.1.0”,
“types”: “”
},
“firstrunwizard”: {
“enabled”: “no”,
“installed_version”: “3.0.0”,
“types”: “logging”
},
“fulltextsearch”: {
“app_navigation”: “1”,
“enabled”: “no”,
“installed_version”: “30.0.0”,
“search_platform”: “OCA\FullTextSearch_Elasticsearch\Platform\ElasticSearchPlatform”,
“types”: “”
},
“fulltextsearch_elasticsearch”: {
“analyzer_tokenizer”: “standard”,
“elastic_host”: “”,
“elastic_index”: “my_index”,
“enabled”: “no”,
“installed_version”: “30.0.0”,
“types”: “”
},
“geoblocker”: {
“enabled”: “no”,
“installed_version”: “0.5.15”,
“types”: “”
},
“integration_mastodon”: {
“enabled”: “no”,
“installed_version”: “2.0.6”,
“oauth_instance_url”: “”,
“types”: “”,
“use_popup”: “1”
},
“integration_openstreetmap”: {
“enabled”: “no”,
“installed_version”: “2.0.1”,
“types”: “”
},
“logreader”: {
“enabled”: “yes”,
“installed_version”: “4.0.0”,
“types”: “logging”
},
“lookup_server_connector”: {
“enabled”: “yes”,
“installed_version”: “1.19.0”,
“types”: “authentication”
},
“mail”: {
“enabled”: “no”,
“installed_version”: “3.7.6”,
“types”: “”
},
“maps”: {
“enabled”: “no”,
“installed_version”: “1.4.0”,
“types”: “filesystem”
},
“mediadc”: {
“enabled”: “no”,
“installed_version”: “0.3.9”,
“types”: “”
},
“memories”: {
“enabled”: “no”,
“installed_version”: “7.4.1”,
“types”: “”
},
“music”: {
“enabled”: “yes”,
“installed_version”: “2.1.4”,
“types”: “filesystem”
},
“nextcloud_announcements”: {
“enabled”: “yes”,
“installed_version”: “3.0.0”,
“pub_date”: “Thu, 24 Oct 2019 00:00:00 +0200”,
“types”: “logging”
},
“notes”: {
“enabled”: “yes”,
“installed_version”: “4.12.0”,
“types”: “”
},
“notifications”: {
“enabled”: “yes”,
“installed_version”: “4.0.0”,
“types”: “logging”
},
“oauth2”: {
“enabled”: “yes”,
“installed_version”: “1.19.1”,
“types”: “authentication”
},
“password_policy”: {
“enabled”: “yes”,
“enforceNumericCharacters”: “1”,
“enforceSpecialCharacters”: “1”,
“enforceUpperLowerCase”: “1”,
“installed_version”: “3.0.0”,
“maximumLoginAttempts”: “2”,
“minLength”: “72”,
“types”: “authentication”
},
“photos”: {
“enabled”: “no”,
“installed_version”: “3.0.2”,
“lastPlaceMappedUser”: “john”,
“lastPlaceMappingDone”: “true”,
“types”: “dav,authentication”
},
“privacy”: {
“enabled”: “yes”,
“installed_version”: “3.0.0”,
“types”: “”
},
“profile”: {
“enabled”: “yes”,
“installed_version”: “1.0.0”,
“types”: “”
},
“provisioning_api”: {
“enabled”: “yes”,
“installed_version”: “1.21.0”,
“types”: “prevent_group_restriction”
},
“recommendations”: {
“enabled”: “yes”,
“installed_version”: “4.0.0”,
“types”: “”
},
“related_resources”: {
“enabled”: “yes”,
“installed_version”: “2.0.0”,
“types”: “”
},
“richdocuments”: {
“disable_certificate_verification”: “yes”,
“enabled”: “no”,
“installed_version”: “8.5.1”,
“types”: “prevent_group_restriction”,
“wopi_url”: “http://nextcloud.bearbttm.uk/apps/richdocumentscode/proxy.php?req=”
},
“richdocumentscode”: {
“enabled”: “no”,
“installed_version”: “24.4.802”,
“types”: “”
},
“serverinfo”: {
“cached_count_appdata_files”: 30107,
“cached_count_filecache”: 51781,
“cached_count_storages”: “7”,
“enabled”: “yes”,
“installed_version”: “3.0.0”,
“size_appdata_storage”: 49136,
“types”: “”
},
“settings”: {
“enabled”: “yes”,
“installed_version”: “1.14.0”,
“types”: “”
},
“sharebymail”: {
“enabled”: “no”,
“installed_version”: “1.19.0”,
“types”: “filesystem”
},
“spreed”: {
“enabled”: “no”,
“installed_version”: “20.0.0”,
“project_access_invalidated”: “1”,
“signaling_token_privkey_es256”: “REMOVED SENSITIVE VALUE”,
“signaling_token_pubkey_es256”: “REMOVED SENSITIVE VALUE”,
“types”: “dav,prevent_group_restriction”
},
“support”: {
“enabled”: “no”,
“installed_version”: “1.12.0”,
“types”: “session”
},
“survey_client”: {
“enabled”: “no”,
“installed_version”: “1.17.0”,
“types”: “”
},
“suspicious_login”: {
“enabled”: “no”,
“installed_version”: “8.0.0”,
“types”: “authentication”
},
“systemtags”: {
“enabled”: “no”,
“installed_version”: “1.19.0”,
“types”: “logging”
},
“text”: {
“enabled”: “yes”,
“installed_version”: “5.0.0”,
“types”: “dav”
},
“theming”: {
“enabled”: “yes”,
“installed_version”: “2.6.1”,
“types”: “logging”
},
“thesearchpage”: {
“enabled”: “yes”,
“installed_version”: “1.2.10”,
“types”: “”
},
“twofactor_backupcodes”: {
“enabled”: “yes”,
“installed_version”: “1.20.0”,
“types”: “”
},
“twofactor_nextcloud_notification”: {
“enabled”: “yes”,
“installed_version”: “5.0.0”,
“types”: “”
},
“updatenotification”: {
“calendar”: “5.2.2”,
“contacts”: “7.0.4”,
“cookbook”: “0.11.3”,
“core”: “30.0.8.1”,
“enabled”: “yes”,
“installed_version”: “1.21.0”,
“music”: “2.1.3”,
“thesearchpage”: “1.2.10”,
“types”: “”,
“update_check_errors”: 0,
“welcome”: “1.2.1”
},
“user_status”: {
“enabled”: “no”,
“installed_version”: “1.9.0”,
“types”: “”
},
“viewer”: {
“enabled”: “yes”,
“installed_version”: “4.0.0”,
“types”: “”
},
“weather_status”: {
“enabled”: “yes”,
“installed_version”: “1.11.0”,
“types”: “”
},
“webhook_listeners”: {
“enabled”: “yes”,
“installed_version”: “1.2.0”,
“types”: “filesystem”
},
“welcome”: {
“enabled”: “yes”,
“installed_version”: “1.2.1”,
“types”: “”
},
“workflowengine”: {
“enabled”: “yes”,
“installed_version”: “2.13.0”,
“types”: “filesystem”
}
}
}
Additional Information:
Output from $ php-updater --list-installed is:
SAPI libapache2-mod-php8.3 8.3.20-1+ubuntu24.04.1+deb.sury.org+1 im
\apache2handler /usr/lib/apache2/modules/libphp8.3.so loaded
SAPI libapache2-mod-php8.4 8.4.6-1+ubuntu24.04.1+deb.sury.org+1 im
\apache2handler /usr/lib/apache2/modules/libphp8.4.so <<INACTIVE
SAPI php8.4-cli 8.4.6-1+ubuntu24.04.1+deb.sury.org+1 im
\php binary /usr/bin/php8.4 linked to generic /usr/bin/php
- php8.4-common 8.4.6-1+ubuntu24.04.1+deb.sury.org+1 im
\included modules: calendar ctype exif ffi fileinfo ftp gettext iconv pdo
phar posix shmop sockets sysvmsg sysvsem sysvshm tokenizer - php8.4-curl 8.4.6-1+ubuntu24.04.1+deb.sury.org+1 im
\included module: curl - php8.4-dev 8.4.6-1+ubuntu24.04.1+deb.sury.org+1 im
- php8.4-gd 8.4.6-1+ubuntu24.04.1+deb.sury.org+1 im
\included module: gd - php8.4-gmp 8.4.6-1+ubuntu24.04.1+deb.sury.org+1 im
\included module: gmp - php8.4-igbinary 3.2.16-3+ubuntu24.04.1+deb.sury.org+1 im
\included module: igbinary - php8.4-intl 8.4.6-1+ubuntu24.04.1+deb.sury.org+1 im
\included module: intl - php8.4-mbstring 8.4.6-1+ubuntu24.04.1+deb.sury.org+1 im
\included module: mbstring - php8.4-memcached 3.3.0-1+ubuntu24.04.1+deb.sury.org+1 im
\included module: memcached - php8.4-msgpack 1:3.0.0-1+ubuntu24.04.1+deb.sury.org+1 im
\included module: msgpack - php8.4-mysql 8.4.6-1+ubuntu24.04.1+deb.sury.org+1 im
\included modules: mysqli mysqlnd pdo_mysql - php8.4-opcache 8.4.6-1+ubuntu24.04.1+deb.sury.org+1 im
\included module: opcache - php8.4-readline 8.4.6-1+ubuntu24.04.1+deb.sury.org+1 im
\included module: readline - php8.4-xml 8.4.6-1+ubuntu24.04.1+deb.sury.org+1 im
\included modules: dom simplexml xml xmlreader xmlwriter xsl - php8.4-zip 8.4.6-1+ubuntu24.04.1+deb.sury.org+1 im
\included module: zip - php-all-dev 2:96+ubuntu24.04.1+deb.sury.org+1 im
- php-common 2:96+ubuntu24.04.1+deb.sury.org+1 im
- php-igbinary-all-dev 3.2.16-3+ubuntu24.04.1+deb.sury.org+1 im
- php-memcached-all-dev 3.3.0-1+ubuntu24.04.1+deb.sury.org+1 im
- php-msgpack-all-dev 1:3.0.0-1+ubuntu24.04.1+deb.sury.org+1 im
- php-pear 1:1.10.16+submodules+notgz-2+ubuntu24.04.1+deb.sury.org+1im
- pkg-php-tools 1.44 im