### Steps to reproduce
1. Update mail app to 5.1.0
2. Go to mail menu
3. See er…ror

### Expected behavior
The Nextcloud Mail application can be used as usual.
### Actual behavior
An error appears when accessing https://domain.tld/apps/mail/.
### Mail app version
5.1.0
### Nextcloud version
31.0.5
### Mailserver or service
Selfhosted Email
### Operating system
Ubuntu 24.04
### PHP engine version
PHP 8.3
### Nextcloud memory caching
Valkey
### Web server
Other
### Database
PostgreSQL
### Additional info
I am using Caddy as the web server.
And this seems to be the log related to the error.
```
{
"reqId": "2jiDAsvHt1a737MVbcdU",
"level": 3,
"time": "2025-05-21T06:12:41+00:00",
"remoteAddr": "100.111.52.41",
"user": "User",
"app": "index",
"method": "GET",
"url": "/apps/mail/",
"message": "debug is not a valid attribute",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 Edg/136.0.0.0",
"version": "31.0.5.1",
"exception": {
"Exception": "BadFunctionCallException",
"Message": "debug is not a valid attribute",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/lib/public/AppFramework/Db/Entity.php",
"line": 59,
"function": "setter",
"class": "OCP\\AppFramework\\Db\\Entity",
"type": "->",
"args": [
"debug",
[
false
]
]
},
{
"file": "/var/www/html/lib/public/AppFramework/Db/QBMapper.php",
"line": 315,
"function": "fromRow",
"class": "OCP\\AppFramework\\Db\\Entity",
"type": "::",
"args": [
{
"0": "And 40 more entries, set log level to debug to see all entries",
"id": 3,
"user_id": "User",
"name": "User",
"email": "user@domain.tld",
"inbound_host": "mail.domain.tld"
}
]
},
{
"file": "/var/www/html/lib/public/AppFramework/Db/QBMapper.php",
"line": 333,
"function": "mapRowToEntity",
"class": "OCP\\AppFramework\\Db\\QBMapper",
"type": "->",
"args": [
{
"0": "And 40 more entries, set log level to debug to see all entries",
"id": 3,
"user_id": "User",
"name": "User",
"email": "user@domain.tld",
"inbound_host": "mail.domain.tld"
}
]
},
{
"file": "/var/www/html/custom_apps/mail/lib/Db/MailAccountMapper.php",
"line": 83,
"function": "findEntities",
"class": "OCP\\AppFramework\\Db\\QBMapper",
"type": "->",
"args": [
{
"__class__": "OC\\DB\\QueryBuilder\\QueryBuilder"
}
]
},
{
"file": "/var/www/html/custom_apps/mail/lib/Service/AccountService.php",
"line": 65,
"function": "findByUserId",
"class": "OCA\\Mail\\Db\\MailAccountMapper",
"type": "->",
"args": [
"User"
]
},
{
"file": "/var/www/html/custom_apps/mail/lib/Controller/PageController.php",
"line": 150,
"function": "findByUserId",
"class": "OCA\\Mail\\Service\\AccountService",
"type": "->",
"args": [
"User"
]
},
{
"file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"line": 200,
"function": "index",
"class": "OCA\\Mail\\Controller\\PageController",
"type": "->",
"args": []
},
{
"file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"line": 114,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Mail\\Controller\\PageController"
},
"index"
]
},
{
"file": "/var/www/html/lib/private/AppFramework/App.php",
"line": 161,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Mail\\Controller\\PageController"
},
"index"
]
},
{
"file": "/var/www/html/lib/private/Route/Router.php",
"line": 307,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::",
"args": [
"OCA\\Mail\\Controller\\PageController",
"index",
{
"__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
},
{
"_route": "mail.page.index"
}
]
},
{
"file": "/var/www/html/lib/base.php",
"line": 1040,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->",
"args": [
"/apps/mail/"
]
},
{
"file": "/var/www/html/index.php",
"line": 24,
"function": "handleRequest",
"class": "OC",
"type": "::",
"args": []
}
],
"File": "/var/www/html/lib/public/AppFramework/Db/Entity.php",
"Line": 95,
"message": "debug is not a valid attribute",
"exception": [],
"CustomMessage": "debug is not a valid attribute"
},
"id": "682d6ee7c5a65"
}
```