### ⚠️ This issue respects the following points: ⚠️
- [x] This is a **bug**, no…t a question or a configuration/webserver/proxy issue.
- [x] This issue is **not** already reported on [Github](https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3Abug) OR [Nextcloud Community Forum](https://help.nextcloud.com/) _(I've searched it)_.
- [x] Nextcloud Server **is** up to date. See [Maintenance and Release Schedule](https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule) for supported versions.
- [x] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/).
### Bug description
Hello. I have set up an internal instance of nextcloud, according to [this guide](https://docs.nextcloud.com/server/30/admin_manual/installation/example_ubuntu.html).
When opening the discovery page in the appstore, the external promotional images (defined in `discover.json`) do not load. I don't think this is a reverse proxy issue, as I can install apps and other external images load just fine, also I don't have any reverse proxy issues noted in the administration overview.
Example:

After some debugging I found out that the crash is related to the cache and occurs in `apps/settings/lib/Controller/AppSettingsController.php`, in function GetAppDiscoverMedia, line 150:
`$allFiles = $folder->getDirectoryListing();`
What is weird is that `$folder` is created just a few lines above, and yet this line throws a `OCP\\Files\\NotFoundException`. I have checked and this directory is created successfully in `/var/www/nextcloud/data/appdata_*/appstore/app-discover-cache`. I don't think it's a permission issue either, as I have stated above that the directory is freshly-created.
I am not exactly sure why these specific functions use a cache, when app screenshots (in "best-rated apps") are just externally sourced `<img>`s.
This is not a major bug but it does make it more difficult to read the logs, as it creates a lot of errors (about 3 errors each time the discovery page is opened).
### Steps to reproduce
1. Set up a new local nextcloud instance
2. Open the app discovery page
3. You will get HTTP 500 errors in your console, as well as exceptions in your logs.
### Expected behavior
The images and videos on the discovery page load properly.
### Nextcloud Server version
30
### Operating system
Debian/Ubuntu
### PHP engine version
PHP 8.3
### Web server
Apache (supported)
### Database engine version
MariaDB
### Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
### Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
### What user-backends are you using?
- [x] Default user-backend _(database)_
- [x] LDAP/ Active Directory
- [ ] SSO - SAML
- [ ] Other
### Configuration report
```json
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"servername"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "30.0.2.2",
"overwrite.cli.url": "https:\/\/servername\/nextcloud",
"htaccess.RewriteBase": "\/nextcloud",
"overwriteprotocol": "https",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"maintenance_window_start": 1,
"forbidden_filename_basenames": [
"con",
"prn",
"aux",
"nul",
"com0",
"com1",
"com2",
"com3",
"com4",
"com5",
"com6",
"com7",
"com8",
"com9",
"com\u00b9",
"com\u00b2",
"com\u00b3",
"lpt0",
"lpt1",
"lpt2",
"lpt3",
"lpt4",
"lpt5",
"lpt6",
"lpt7",
"lpt8",
"lpt9",
"lpt\u00b9",
"lpt\u00b2",
"lpt\u00b3"
],
"forbidden_filename_characters": [
"<",
">",
":",
"\"",
"|",
"?",
"*",
"\\",
"\/"
],
"forbidden_filename_extensions": [
" ",
".",
".filepart",
".part"
],
"maintenance": false,
"memcache.local": "\\OC\\Memcache\\APCu",
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379
},
"ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
"skeletondirectory": "",
"mail_smtpmode": "smtp",
"mail_sendmailmode": "smtp",
"allow_local_remote_servers": true
}
}
```
### List of activated Apps
```shell
Enabled:
- activity: 3.0.0
- app_api: 4.0.0
- bruteforcesettings: 3.0.0
- calendar: 5.0.5
- cfg_share_links: 6.1.1
- circles: 30.0.0
- cloud_federation_api: 1.13.0
- comments: 1.20.1
- contacts: 6.1.1
- dav: 1.31.1
- deck: 1.14.2
- drawio: 3.0.3
- federatedfilesharing: 1.20.0
- files: 2.2.0
- files_accesscontrol: 1.20.1
- files_downloadlimit: 3.0.0
- files_pdfviewer: 3.0.0
- files_reminders: 1.3.0
- files_sharing: 1.22.0
- files_trashbin: 1.20.1
- files_versions: 1.23.0
- firstrunwizard: 3.0.0
- forms: 4.3.4
- groupfolders: 18.0.5
- logreader: 3.0.0
- lookup_server_connector: 1.18.0
- mail: 4.0.3
- notes: 4.11.0
- notifications: 3.0.0
- oauth2: 1.18.1
- password_policy: 2.0.0
- photos: 3.0.2
- privacy: 2.0.0
- provisioning_api: 1.20.0
- quota_warning: 1.20.0
- recommendations: 3.0.0
- related_resources: 1.5.0
- richdocuments: 8.5.2
- richdocumentscode: 24.4.902
- serverinfo: 2.0.0
- settings: 1.13.0
- sharebymail: 1.20.0
- socialsharing_email: 3.2.0
- systemtags: 1.20.0
- text: 4.1.0
- theming: 2.5.0
- theming_customcss: 1.17.0
- twofactor_backupcodes: 1.19.0
- updatenotification: 1.20.0
- user_ldap: 1.21.0
- viewer: 3.0.0
- webhook_listeners: 1.1.0-dev
- workflowengine: 2.12.0
Disabled:
- admin_audit: 1.20.0
- contactsinteraction: 1.11.0 (installed 1.11.0)
- dashboard: 7.10.0 (installed 7.10.0)
- encryption: 2.18.0
- federation: 1.20.0 (installed 1.20.0)
- files_external: 1.22.0 (installed 1.22.0)
- ldap_write_support: 1.12.0 (installed 1.12.0)
- nextcloud_announcements: 2.0.0 (installed 2.0.0)
- polls: 7.2.5 (installed 7.2.5)
- support: 2.0.0 (installed 2.0.0)
- survey_client: 2.0.0 (installed 2.0.0)
- suspicious_login: 8.0.0
- twofactor_nextcloud_notification: 4.0.0
- twofactor_totp: 12.0.0-dev
- user_status: 1.10.0 (installed 1.10.0)
- weather_status: 1.10.0 (installed 1.10.0)
```
### Nextcloud Signing status
```shell
No errors have been found.
```
### Nextcloud Logs
```json
{"reqId":"YK4YhARmm9wSzDgtCvhJ","level":3,"time":"2024-11-27T08:41:35+00:00","remoteAddr":"192.168.1.126","user":"admin","app":"index","method":"GET","url":"/nextcloud/settings/api/apps/media?fileName=https%3A%2F%2Fnextcloud.com%2Fc%2Fuploads%2F2024%2F09%2FNextcloud-Hub-9-1024x576.jpg","message":"Exception thrown: OCP\\Files\\NotFoundException","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0","version":"30.0.2.2","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":81,"function":"getFileInfo","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php","line":33,"function":"getDirectoryListing","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/AppSettingsController.php","line":150,"function":"getDirectoryListing","class":"OC\\Files\\SimpleFS\\SimpleFolder","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"getAppDiscoverMedia","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1001,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Node.php","Line":90,"message":"","exception":{},"CustomMessage":"Exception thrown: OCP\\Files\\NotFoundException"}}
{"reqId":"0NU8aIpKuXguS0zKLoOX","level":3,"time":"2024-11-27T08:41:35+00:00","remoteAddr":"192.168.1.126","user":"admin","app":"index","method":"GET","url":"/nextcloud/settings/api/apps/media?fileName=https%3A%2F%2Fgithub.com%2Fnextcloud%2Ffirstrunwizard%2Fraw%2Fmaster%2Fimg%2FNextcloud.webm","message":"Exception thrown: OCP\\Files\\NotFoundException","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0","version":"30.0.2.2","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":81,"function":"getFileInfo","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php","line":33,"function":"getDirectoryListing","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/AppSettingsController.php","line":150,"function":"getDirectoryListing","class":"OC\\Files\\SimpleFS\\SimpleFolder","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"getAppDiscoverMedia","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1001,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Node.php","Line":90,"message":"","exception":{},"CustomMessage":"Exception thrown: OCP\\Files\\NotFoundException"}}
{"reqId":"jm9AkQri7BMBxUApNdnz","level":3,"time":"2024-11-27T08:41:35+00:00","remoteAddr":"192.168.1.126","user":"admin","app":"index","method":"GET","url":"/nextcloud/settings/api/apps/media?fileName=https%3A%2F%2Fgithub.com%2Fnextcloud%2Ffirstrunwizard%2Fraw%2Fmaster%2Fimg%2FNextcloud.mp4","message":"Exception thrown: OCP\\Files\\NotFoundException","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0","version":"30.0.2.2","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":81,"function":"getFileInfo","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php","line":33,"function":"getDirectoryListing","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/AppSettingsController.php","line":150,"function":"getDirectoryListing","class":"OC\\Files\\SimpleFS\\SimpleFolder","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"getAppDiscoverMedia","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1001,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Node.php","Line":90,"message":"","exception":{},"CustomMessage":"Exception thrown: OCP\\Files\\NotFoundException"}}
```
### Additional info
_No response_