[Bug]: AppConfigUnknownKeyException unknown config key, Error while generating metadata for fileid
⚠️ This issue respects the following points: ⚠️
- [X] This is a bug, not a question or a configuration/webserver/proxy issue.
- [X] This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- [X] Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- [X] I agree to follow Nextcloud's Code of Conduct.
Bug description
I just upgraded to v29 and spotted these warnings in overview. Same warnings are present in 29.0.2 RC2. There are some warnings regarding your setup. 4353 warnings in the logs since 2. júna 2024, 23:48:49{"2":4353,"3":0,"4":0}
Then I checked and logs and found these:
AppConfigUnknownKeyException
unknown config key
Error while generating metadata for fileid 28543
and
Value type is set to zero (0) in database. This is fine only during the upgrade process from 28 to 29.
The full error from nextcloud.log is below.
Steps to reproduce
- upgrade to v29
Expected behavior
warnings shouldn't be there
Installation method
Community Web installer on a VPS or web space
Nextcloud Server version
29
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
Upgraded to a MAJOR version (ex. 22 to 23)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
- [X] Default user-backend (database)
- [ ] LDAP/ Active Directory
- [ ] SSO - SAML
- [ ] Other
Configuration report
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"my.domain.com"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "pgsql",
"version": "29.0.2.1",
"overwrite.cli.url": "http:\/\/my.domain.com",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"memcache.local": "\\OC\\Memcache\\APCu",
"maintenance": false,
"theme": "",
"loglevel": 2,
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"updater.release.channel": "stable",
"mail_smtpmode": "smtp",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_sendmailmode": "smtp",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"default_phone_region": "SK",
"maintenance_window_start": 1
}
}
List of activated Apps
Enabled:
- activity: 2.21.1
- circles: 29.0.0-dev
- cloud_federation_api: 1.12.0
- comments: 1.19.0
- contactsinteraction: 1.10.0
- dashboard: 7.9.0
- dav: 1.30.1
- federatedfilesharing: 1.19.0
- federation: 1.19.0
- files: 2.1.0
- files_downloadlimit: 2.0.0
- files_pdfviewer: 2.10.0
- files_reminders: 1.2.0
- files_sharing: 1.21.0
- files_trashbin: 1.19.0
- files_versions: 1.22.0
- firstrunwizard: 2.18.0
- logreader: 2.14.0
- lookup_server_connector: 1.17.0
- nextcloud_announcements: 1.18.0
- notifications: 2.17.0
- oauth2: 1.17.0
- password_policy: 1.19.0
- photos: 2.5.0
- privacy: 1.13.0
- provisioning_api: 1.19.0
- recommendations: 2.1.0
- related_resources: 1.4.0
- serverinfo: 1.19.0
- settings: 1.12.0
- sharebymail: 1.19.0
- support: 1.12.0
- survey_client: 1.17.0
- systemtags: 1.19.0
- text: 3.10.0
- theming: 2.4.0
- twofactor_backupcodes: 1.18.0
- updatenotification: 1.19.1
- user_status: 1.9.0
- viewer: 2.3.0
- weather_status: 1.9.0
- workflowengine: 2.11.0
Disabled:
- admin_audit: 1.19.0
- bruteforcesettings: 2.9.0
- encryption: 2.17.0
- files_external: 1.21.0
- files_rightclick: 0.15.1 (installed 1.6.0)
- suspicious_login: 7.0.0
- twofactor_totp: 11.0.0-dev
- user_ldap: 1.20.0
Nextcloud Signing status
No errors have been found.
Nextcloud Logs
{"reqId":"1ezPHwhmLDSVMLqHi1JR","level":2,"time":"2024-06-02T22:17:13+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Value type is set to zero (0) in database. This is fine only during the upgrade process from 28 to 29.","userAgent":"--","version":"29.0.2.1","data":{"app":"core","key":"files_metadata"}}
{"reqId":"1ezPHwhmLDSVMLqHi1JR","level":2,"time":"2024-06-02T22:17:13+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Error while generating metadata for fileid 26494","userAgent":"--","version":"29.0.2.1","exception":{"Exception":"OCP\\Exceptions\\AppConfigUnknownKeyException","Message":"unknown config key","Code":0,"Trace":[{"file":"/var/www/cloud.kveri.com/htdocs/lib/private/AppConfig.php","line":829,"function":"isLazy","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/lib/private/AppConfig.php","line":716,"function":"setTypedValue","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/lib/private/FilesMetadata/FilesMetadataManager.php","line":208,"function":"setValueArray","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/lib/private/FilesMetadata/FilesMetadataManager.php","line":115,"function":"saveMetadata","class":"OC\\FilesMetadata\\FilesMetadataManager","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/lib/private/FilesMetadata/FilesMetadataManager.php","line":121,"function":"refreshMetadata","class":"OC\\FilesMetadata\\FilesMetadataManager","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/core/BackgroundJobs/GenerateMetadataJob.php","line":109,"function":"refreshMetadata","class":"OC\\FilesMetadata\\FilesMetadataManager","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/core/BackgroundJobs/GenerateMetadataJob.php","line":99,"function":"scanFolder","class":"OC\\Core\\BackgroundJobs\\GenerateMetadataJob","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/core/BackgroundJobs/GenerateMetadataJob.php","line":99,"function":"scanFolder","class":"OC\\Core\\BackgroundJobs\\GenerateMetadataJob","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/core/BackgroundJobs/GenerateMetadataJob.php","line":99,"function":"scanFolder","class":"OC\\Core\\BackgroundJobs\\GenerateMetadataJob","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/core/BackgroundJobs/GenerateMetadataJob.php","line":99,"function":"scanFolder","class":"OC\\Core\\BackgroundJobs\\GenerateMetadataJob","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/core/BackgroundJobs/GenerateMetadataJob.php","line":99,"function":"scanFolder","class":"OC\\Core\\BackgroundJobs\\GenerateMetadataJob","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/core/BackgroundJobs/GenerateMetadataJob.php","line":99,"function":"scanFolder","class":"OC\\Core\\BackgroundJobs\\GenerateMetadataJob","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/core/BackgroundJobs/GenerateMetadataJob.php","line":88,"function":"scanFolder","class":"OC\\Core\\BackgroundJobs\\GenerateMetadataJob","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/core/BackgroundJobs/GenerateMetadataJob.php","line":74,"function":"scanFilesForUser","class":"OC\\Core\\BackgroundJobs\\GenerateMetadataJob","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/lib/public/BackgroundJob/Job.php","line":80,"function":"run","class":"OC\\Core\\BackgroundJobs\\GenerateMetadataJob","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/lib/public/BackgroundJob/TimedJob.php","line":102,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/lib/public/BackgroundJob/TimedJob.php","line":92,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/cloud.kveri.com/htdocs/cron.php","line":176,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/cloud.kveri.com/htdocs/lib/private/AppConfig.php","Line":203,"message":"Error while generating metadata for fileid 26494","exception":{},"CustomMessage":"Error while generating metadata for fileid 26494"}}
Additional info
No response
cc @ArtificialOwl
Also seeing this in NC 30.0.1 RC2
{"reqId":"phQfGODTlipe8QIqTjfT","level":2,"time":"2024-10-11T16:46:52-05:00","remoteAddr":"10.1.2.1","user":"admin","app":"core","method":"POST","url":"/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/core/shareapi_expire_after_n_days","message":"Value type is set to zero (0) in database. This is fine only during the upgrade process from 28 to 29.","userAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0.1 Mobile/15E148 Safari/604.1","version":"30.0.1.1","data":{"app":"core","key":"shareapi_expire_after_n_days"},"id":"6709d8c2cc34e"}
Just hit this as well in CI with latest master.
{
"reqId": "0WlLMgyLwqGdz8jN7Lvd",
"level": 3,
"time": "2025-02-18T06:31:54+00:00",
"remoteAddr": "",
"user": false,
"app": "core",
"method": "",
"url": "--",
"message": "Error while running background job OCA\\ContextChat\\BackgroundJobs\\IndexerJob (id: 35, arguments: {\"storageId\":1,\"rootId\":1})",
"userAgent": "--",
"version": "32.0.0.0",
"exception": {
"Exception": "OCP\\Exceptions\\AppConfigUnknownKeyException",
"Message": "unknown config key",
"Code": 0,
"Trace": [
{
"file": "/home/runner/work/context_chat/context_chat/lib/private/AppConfig.php",
"line": 816,
"function": "isLazy",
"class": "OC\\AppConfig",
"type": "->"
},
{
"file": "/home/runner/work/context_chat/context_chat/lib/private/AppConfig.php",
"line": 576,
"function": "setTypedValue",
"class": "OC\\AppConfig",
"type": "->"
},
{
"file": "/home/runner/work/context_chat/context_chat/lib/private/AppFramework/Services/AppConfig.php",
"line": 121,
"function": "setValueString",
"class": "OC\\AppConfig",
"type": "->"
},
{
"file": "/home/runner/work/context_chat/context_chat/apps/context_chat/lib/Service/DiagnosticService.php",
"line": 133,
"function": "setAppValueString",
"class": "OC\\AppFramework\\Services\\AppConfig",
"type": "->"
},
{
"file": "/home/runner/work/context_chat/context_chat/apps/context_chat/lib/BackgroundJobs/IndexerJob.php",
"line": 239,
"function": "sendIndexedFiles",
"class": "OCA\\ContextChat\\Service\\DiagnosticService",
"type": "->"
},
{
"file": "/home/runner/work/context_chat/context_chat/apps/context_chat/lib/BackgroundJobs/IndexerJob.php",
"line": 123,
"function": "index",
"class": "OCA\\ContextChat\\BackgroundJobs\\IndexerJob",
"type": "->"
},
{
"file": "/home/runner/work/context_chat/context_chat/lib/public/BackgroundJob/Job.php",
"line": 61,
"function": "run",
"class": "OCA\\ContextChat\\BackgroundJobs\\IndexerJob",
"type": "->"
},
{
"file": "/home/runner/work/context_chat/context_chat/lib/public/BackgroundJob/TimedJob.php",
"line": 88,
"function": "start",
"class": "OCP\\BackgroundJob\\Job",
"type": "->"
},
{
"file": "/home/runner/work/context_chat/context_chat/lib/public/BackgroundJob/TimedJob.php",
"line": 75,
"function": "start",
"class": "OCP\\BackgroundJob\\TimedJob",
"type": "->"
},
{
"file": "/home/runner/work/context_chat/context_chat/cron.php",
"line": 168,
"function": "execute",
"class": "OCP\\BackgroundJob\\TimedJob",
"type": "->"
}
],
"File": "/home/runner/work/context_chat/context_chat/lib/private/AppConfig.php",
"Line": 182,
"message": "Error while running background job OCA\\ContextChat\\BackgroundJobs\\IndexerJob (id: 35, arguments: {\"storageId\":1,\"rootId\":1})",
"exception": {},
"CustomMessage": "Error while running background job OCA\\ContextChat\\BackgroundJobs\\IndexerJob (id: 35, arguments: {\"storageId\":1,\"rootId\":1})"
}
}
Code is as follows:
$this->appConfig->setAppValueString('indexed_files_count', (string)Util::numericToNumber($count + Util::numericToNumber($this->appConfig->getAppValueString('indexed_files_count', '0', false))), false);