Nextcloud not working after upgrading to Debian Bookworm

I just upgraded to Debian 12 this morning. Afterwards I noticed that Nextcloud is no longer running. First I was dealing with the new php 8.2.7 that didn’t fit with Nextcloud 25.0.8. I did all the updates und upgrades ending in Version 27.0.0.8. I still got the message that php 8.2.7 is not compatible with my Nextcloud version.

So I installed php 8.1 additionally and no I am facing the follwing browser 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.

I am a little lost as there is not much in the logs:

nextcloud.log

{"reqId":"2LrbodQNscV5sWAlZkKm","level":0,"time":"July 05, 2023 20:24:58","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Creation of dynamic property OCA\\Deck\\Command\\UserExport::$stackMapper is deprecated at /var/www/appelzwei/nextcloud_latest/apps/deck/lib/Command/UserExport.php#59","userAgent":"--","version":"27.0.0.8","data":{"app":"PHP"}}
{"reqId":"2LrbodQNscV5sWAlZkKm","level":0,"time":"July 05, 2023 20:24:58","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Creation of dynamic property OCA\\Deck\\Command\\UserExport::$boardMapper is deprecated at /var/www/appelzwei/nextcloud_latest/apps/deck/lib/Command/UserExport.php#61","userAgent":"--","version":"27.0.0.8","data":{"app":"PHP"}}
{"reqId":"2LrbodQNscV5sWAlZkKm","level":0,"time":"July 05, 2023 20:24:58","remoteAddr":"","user":"--","app":"serverDI","method":"","url":"--","message":"The requested alias \"SystemConfig\" is deprecated. Please request \"OC\\SystemConfig\" directly. This alias will be removed in a future Nextcloud version.","userAgent":"--","version":"27.0.0.8","data":{"app":"serverDI"}}
{"reqId":"3ilaKfdZ8DUOoD1w2pIE","level":0,"time":"July 05, 2023 20:38:20","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Creation of dynamic property OCA\\Deck\\Command\\UserExport::$stackMapper is deprecated at /var/www/appelzwei/nextcloud_latest/apps/deck/lib/Command/UserExport.php#59","userAgent":"--","version":"27.0.0.8","data":{"app":"PHP"}}
{"reqId":"3ilaKfdZ8DUOoD1w2pIE","level":0,"time":"July 05, 2023 20:38:20","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Creation of dynamic property OCA\\Deck\\Command\\UserExport::$boardMapper is deprecated at /var/www/appelzwei/nextcloud_latest/apps/deck/lib/Command/UserExport.php#61","userAgent":"--","version":"27.0.0.8","data":{"app":"PHP"}}
{"reqId":"3ilaKfdZ8DUOoD1w2pIE","level":0,"time":"July 05, 2023 20:38:20","remoteAddr":"","user":"--","app":"serverDI","method":"","url":"--","message":"The requested alias \"SystemConfig\" is deprecated. Please request \"OC\\SystemConfig\" directly. This alias will be removed in a future Nextcloud version.","userAgent":"--","version":"27.0.0.8","data":{"app":"serverDI"}}
{"reqId":"X8Rv8z6yVF4gMITrKJ9U","level":0,"time":"July 05, 2023 20:38:57","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Creation of dynamic property OCA\\Deck\\Command\\UserExport::$stackMapper is deprecated at /var/www/appelzwei/nextcloud_latest/apps/deck/lib/Command/UserExport.php#59","userAgent":"--","version":"27.0.0.8","data":{"app":"PHP"}}
{"reqId":"X8Rv8z6yVF4gMITrKJ9U","level":0,"time":"July 05, 2023 20:38:57","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Creation of dynamic property OCA\\Deck\\Command\\UserExport::$boardMapper is deprecated at /var/www/appelzwei/nextcloud_latest/apps/deck/lib/Command/UserExport.php#61","userAgent":"--","version":"27.0.0.8","data":{"app":"PHP"}}
{"reqId":"X8Rv8z6yVF4gMITrKJ9U","level":0,"time":"July 05, 2023 20:38:57","remoteAddr":"","user":"--","app":"serverDI","method":"","url":"--","message":"The requested alias \"SystemConfig\" is deprecated. Please request \"OC\\SystemConfig\" directly. This alias will be removed in a future Nextcloud version.","userAgent":"--","version":"27.0.0.8","data":{"app":"serverDI"}}
{"reqId":"MzzFhtbHnHTmuWkuxiYr","level":0,"time":"July 05, 2023 20:39:03","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Creation of dynamic property OCA\\Deck\\Command\\UserExport::$stackMapper is deprecated at /var/www/appelzwei/nextcloud_latest/apps/deck/lib/Command/UserExport.php#59","userAgent":"--","version":"27.0.0.8","data":{"app":"PHP"}}
{"reqId":"MzzFhtbHnHTmuWkuxiYr","level":0,"time":"July 05, 2023 20:39:03","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Creation of dynamic property OCA\\Deck\\Command\\UserExport::$boardMapper is deprecated at /var/www/appelzwei/nextcloud_latest/apps/deck/lib/Command/UserExport.php#61","userAgent":"--","version":"27.0.0.8","data":{"app":"PHP"}}
{"reqId":"MzzFhtbHnHTmuWkuxiYr","level":0,"time":"July 05, 2023 20:39:03","remoteAddr":"","user":"--","app":"serverDI","method":"","url":"--","message":"The requested alias \"SystemConfig\" is deprecated. Please request \"OC\\SystemConfig\" directly. This alias will be removed in a future Nextcloud version.","userAgent":"--","version":"27.0.0.8","data":{"app":"serverDI"}}
root@hamburg:/var/www/appelzwei/nc# sudo -u www-data php occ status
  - installed: true
  - version: 27.0.0.8
  - versionstring: 27.0.0
  - edition:
  - maintenance: false
  - needsDbUpgrade: false
  - productname: Nextcloud
  - extendedSupport: false

Where might be the reason for the malfunction and what to do?

Phili

1 Like

Ok, I just found the “log_query” Parameter in the config.php. Now there is much more in the logs

{"reqId":"WX3pK0QMWj9C1QWhaerf","level":0,"time":"July 05, 2023 23:05:47","remoteAddr":"192.168.50.104","user":"--","app":"core","method":"GET","url":"/","message":"DB QueryBuilder: 'SELECT * FROM `*PREFIX*appconfig`'","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"27.0.0.8","data":{"app":"core"}}
{"reqId":"WX3pK0QMWj9C1QWhaerf","level":3,"time":"July 05, 2023 23:05:47","remoteAddr":"192.168.50.104","user":"--","app":"index","method":"GET","url":"/","message":"Failed to connect to the database: An exception occurred in the driver: could not find driver","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"27.0.0.8","exception":{"Exception":"Doctrine\\DBAL\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: could not find driver","Code":0,"Trace":[{"file":"/var/www/appelzwei/nextcloud_latest/3rdparty/doctrine/dbal/src/Connection.php","line":1531,"function":"connect","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/3rdparty/doctrine/dbal/src/Connection.php","line":1029,"function":"getWrappedConnection","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/DB/Connection.php","line":262,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":345,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/AppConfig.php","line":418,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/AppConfig.php","line":184,"function":"loadConfigValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/AppConfig.php","line":374,"function":"getApps","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/App/AppManager.php","line":131,"function":"getValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/App/AppManager.php","line":152,"function":"getInstalledAppsValues","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/legacy/OC_App.php","line":232,"function":"getInstalledApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/AppFramework/Bootstrap/Coordinator.php","line":90,"function":"getEnabledApps","class":"OC_App","type":"::"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/base.php","line":696,"function":"runInitialRegistration","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/base.php","line":1173,"function":"init","class":"OC","type":"::"},{"file":"/var/www/appelzwei/nextcloud_latest/index.php","line":34,"args":["/var/www/appelzwei/nextcloud_latest/lib/base.php"],"function":"require_once"}],"File":"/var/www/appelzwei/nextcloud_latest/lib/private/DB/Connection.php","Line":140,"CustomMessage":"--"}}
{"reqId":"WX3pK0QMWj9C1QWhaerf","level":0,"time":"July 05, 2023 23:05:47","remoteAddr":"192.168.50.104","user":"--","app":"core","method":"GET","url":"/","message":"DB QueryBuilder: 'SELECT * FROM `*PREFIX*appconfig`'","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"27.0.0.8","data":{"app":"core"}}
{"reqId":"WX3pK0QMWj9C1QWhaerf","level":3,"time":"July 05, 2023 23:05:47","remoteAddr":"192.168.50.104","user":"--","app":"core","method":"GET","url":"/","message":"Failed to connect to the database: An exception occurred in the driver: could not find driver","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36","version":"27.0.0.8","exception":{"Exception":"Doctrine\\DBAL\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: could not find driver","Code":0,"Trace":[{"file":"/var/www/appelzwei/nextcloud_latest/3rdparty/doctrine/dbal/src/Connection.php","line":1531,"function":"connect","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/3rdparty/doctrine/dbal/src/Connection.php","line":1029,"function":"getWrappedConnection","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/DB/Connection.php","line":262,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":345,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/AppConfig.php","line":418,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/AppConfig.php","line":184,"function":"loadConfigValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/AppConfig.php","line":374,"function":"getApps","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/App/AppManager.php","line":131,"function":"getValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/App/AppManager.php","line":152,"function":"getInstalledAppsValues","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/legacy/OC_App.php","line":232,"function":"getInstalledApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/private/AppFramework/Bootstrap/Coordinator.php","line":90,"function":"getEnabledApps","class":"OC_App","type":"::"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/base.php","line":696,"function":"runInitialRegistration","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/appelzwei/nextcloud_latest/lib/base.php","line":1173,"function":"init","class":"OC","type":"::"},{"file":"/var/www/appelzwei/nextcloud_latest/index.php","line":34,"args":["/var/www/appelzwei/nextcloud_latest/lib/base.php"],"function":"require_once"}],"File":"/var/www/appelzwei/nextcloud_latest/lib/private/DB/Connection.php","Line":140,"CustomMessage":"--"}}
{

Let’s see how I can solve

“Failed to connect to the database: An exception occurred in the driver: could not find driver”

I tried this script

and I get the following output with either connection method

$dsn = 'mysql:dbname=nextcloud;host=localhost:3306';
$dsn = 'mysql:dbname=nextcloud;unix_socket=/var/run/mysqld/mysqld.sock';
-start-------------
oc_accounts
oc_accounts_data
oc_activity
oc_activity_mq
oc_addressbookchanges
oc_addressbooks
oc_appconfig
oc_authorized_groups
oc_authtoken
oc_bruteforce_attempts
oc_calendar_appt_bookings
oc_calendar_appt_configs
oc_calendar_invitations
oc_calendar_reminders
oc_calendar_resources
oc_calendar_resources_md
oc_calendar_rooms
oc_calendar_rooms_md
oc_calendarchanges
oc_calendarobjects
oc_calendarobjects_props
oc_calendars
oc_calendarsubscriptions
oc_cards
oc_cards_properties
oc_circles_circle
oc_circles_event
oc_circles_member
oc_circles_membership
oc_circles_mount
oc_circles_mountpoint
oc_circles_remote
oc_circles_share_lock
oc_circles_token
oc_collres_accesscache
oc_collres_collections
oc_collres_resources
oc_comments
oc_comments_read_markers
oc_dav_cal_proxy
oc_dav_shares
oc_deck_assigned_labels
oc_deck_assigned_users
oc_deck_attachment
oc_deck_board_acl
oc_deck_boards
oc_deck_cards
oc_deck_labels
oc_deck_sessions
oc_deck_stacks
oc_direct_edit
oc_directlink
oc_federated_reshares
oc_file_locks
oc_file_metadata
oc_filecache
oc_filecache_extended
oc_files_trash
oc_files_versions
oc_flow_checks
oc_flow_operations
oc_flow_operations_scope
oc_group_admin
oc_group_user
oc_groups
oc_jobs
oc_known_users
oc_login_flow_v2
oc_mail_accounts
oc_mail_aliases
oc_mail_attachments
oc_mail_classifiers
oc_mail_coll_addresses
oc_mail_local_messages
oc_mail_mailboxes
oc_mail_message_tags
oc_mail_messages
oc_mail_provisionings
oc_mail_recipients
oc_mail_smime_certificates
oc_mail_tags
oc_mail_trusted_senders
oc_migrations
oc_mimetypes
oc_mounts
oc_notifications
oc_notifications_pushhash
oc_notifications_settings
oc_oauth2_access_tokens
oc_oauth2_clients
oc_open_local_editor
oc_phonetrack_devices
oc_phonetrack_filtersb
oc_phonetrack_geofences
oc_phonetrack_points
oc_phonetrack_proxims
oc_phonetrack_pubshares
oc_phonetrack_sessions
oc_phonetrack_shares
oc_phonetrack_tileserver
oc_photos_albums
oc_photos_albums_collabs
oc_photos_albums_files
oc_polls_comments
oc_polls_events
oc_polls_notif
oc_polls_options
oc_polls_votes
oc_preferences
oc_privacy_admins
oc_privatedata
oc_profile_config
oc_properties
oc_ratelimit_entries
oc_reactions
oc_recent_contact
oc_schedulingobjects
oc_share
oc_share_external
oc_storages
oc_storages_credentials
oc_systemtag
oc_systemtag_group
oc_systemtag_object_mapping
oc_text_documents
oc_text_sessions
oc_text_steps
oc_trusted_servers
oc_twofactor_backupcodes
oc_twofactor_providers
oc_user_status
oc_user_transfer_owner
oc_users
oc_users_external
oc_vcategory
oc_vcategory_to_object
oc_webauthn
oc_whats_new
-end---------------

OK, solved it. I removed all php8.1 packages and then all was fine.

I need to say, that in between I edited lib/versioncheck.php to make sure NC accepts php-versions newer than 8.2.

Crazy day!
Thanks anyhow
Phili

1 Like