### ⚠️ 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
Documents can be open with web browser using Nextcloud Office and custom Collabora server, but it doesn't work with Nextcloud mobile apps.
On iOS, it says that the page is not found while on Android it loads indefinitely and nothing more appears but the loading circle.
It happens right after the upgrade to version 34.0.
### Steps to reproduce
1. Create a document (ods or xlsx)
2. Edit it with the browser
3. Try to open on mobile app
### Expected behavior
The document has to be open by the mobile app
### Nextcloud Server version
34
### 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?
Upgraded to a MAJOR version (ex. 31 to 32)
### Are you using the Nextcloud Server Encryption module?
None
### What user-backends are you using?
- [x] Default user-backend _(database)_
- [ ] LDAP/ Active Directory
- [ ] SSO - SAML
- [ ] Other
### Configuration report
```json
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"***REMOVED SENSITIVE VALUE***",
"127.0.0.1",
"localhost",
"***REMOVED SENSITIVE VALUE***"
],
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"overwrite.cli.url": "https:\/\/nextcloud.cyberhouse.dnsalias.com",
"htaccess.RewriteBase": "\/",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "34.0.0.12",
"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": "IT",
"maintenance": false,
"memcache.local": "\\OC\\Memcache\\APCu",
"maintenance_window_start": 1,
"mail_smtpmode": "smtp",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_sendmailmode": "smtp",
"mail_smtpport": "465",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtpauth": 1,
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"mail_smtpsecure": "ssl",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379,
"timeout": 0,
"password": "***REMOVED SENSITIVE VALUE***"
},
"updater.release.channel": "stable",
"loglevel": 2,
"updatedirectory": "\/var\/nextcloud-update",
"app_install_overwrite": [
"richdocuments",
"impersonate",
"twothousandandfortyeight"
],
"serverid": "0"
}
}
```
### List of activated Apps
```shell
Enabled:
- activity: 7.0.0
- appstore: 1.0.0
- bruteforcesettings: 7.0.0
- calendar: 6.4.2
- cloud_federation_api: 1.18.0
- comments: 1.24.0
- contacts: 8.5.1
- contactsinteraction: 1.15.0
- dashboard: 7.14.0
- dav: 1.39.0
- federatedfilesharing: 1.24.0
- federation: 1.24.0
- files: 2.6.0
- files_downloadlimit: 5.2.0-dev.0
- files_lock: 34.0.0
- files_pdfviewer: 7.0.0-dev.0
- files_reminders: 1.7.0
- files_sharing: 1.26.0
- files_trashbin: 1.24.0
- files_versions: 1.27.0
- firstrunwizard: 7.0.0-dev.0
- impersonate: 4.0.0
- logreader: 7.0.0
- lookup_server_connector: 1.22.0
- mail: 5.9.1
- nextcloud_announcements: 6.0.0
- notes: 6.0.0
- notifications: 7.0.0-dev.1
- oauth2: 1.22.0
- office: 1.0.0
- password_policy: 6.0.0-dev.0
- photos: 7.0.0
- privacy: 6.0.0-dev.1
- profile: 1.3.0
- provisioning_api: 1.24.0
- recommendations: 7.0.0-dev.0
- related_resources: 5.0.0-dev.0
- richdocuments: 11.0.0
- serverinfo: 6.0.0
- settings: 1.17.0
- sharebymail: 1.24.0
- support: 6.0.0
- survey_client: 6.0.0-dev.0
- systemtags: 1.24.0
- text: 8.0.0
- theming: 2.9.0
- twofactor_backupcodes: 1.23.0
- twofactor_nextcloud_notification: 8.0.0
- twofactor_totp: 16.0.0
- updatenotification: 1.24.0
- user_status: 1.14.0
- viewer: 7.0.0-dev.0
- weather_status: 1.14.0
- webhook_listeners: 1.6.0
- workflowengine: 2.16.0
Disabled:
- admin_audit: 1.24.0
- app_api: 34.0.0 (installed 32.0.0)
- circles: 34.0.0 (installed 31.0.0-dev.0)
- encryption: 2.22.0
- files_external: 1.26.0
- spreed: 23.0.4 (installed 23.0.4)
- suspicious_login: 12.0.0-dev.0
- testing: 1.23.0
- user_ldap: 1.25.0
```
### Nextcloud Signing status
```shell
No errors have been found.
```
### Nextcloud Logs
```json
{"reqId":"bwNbdS96CDAG75lfRLuV","level":3,"time":"2026-06-12T13:33:40+00:00","remoteAddr":"192.168.1.12","user":"davide","app":"index","method":"GET","url":"/index.php/core/preview?fileId=228454&x=1024&y=1024&a=1&mode=cover&forceIcon=0&mimeFallback=0&etag=6a2ba67801075","scriptName":"/index.php","message":"fclose(): supplied resource is not a valid stream resource in file '/var/www/nextcloud/apps/richdocuments/lib/Service/RemoteService.php' line 73","userAgent":"Mozilla/5.0 (iOS) Nextcloud-iOS/33.0.9","version":"34.0.0.12","exception":{"Exception":"Exception","Message":"fclose(): supplied resource is not a valid stream resource in file '/var/www/nextcloud/apps/richdocuments/lib/Service/RemoteService.php' line 73","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":324,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1159,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":25,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":110,"Previous":{"Exception":"TypeError","Message":"fclose(): supplied resource is not a valid stream resource","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/richdocuments/lib/Service/RemoteService.php","line":73,"function":"fclose","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/richdocuments/lib/Preview/Office.php","line":56,"function":"convertFileTo","class":"OCA\\Richdocuments\\Service\\RemoteService","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/GeneratorHelper.php","line":25,"function":"getThumbnail","class":"OCA\\Richdocuments\\Preview\\Office","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":382,"function":"getThumbnail","class":"OC\\Preview\\GeneratorHelper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":336,"function":"generateProviderPreview","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":127,"function":"getMaxPreview","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":95,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/PreviewManager.php","line":183,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/core/Controller/PreviewController.php","line":166,"function":"getPreview","class":"OC\\PreviewManager","type":"->"},{"file":"/var/www/nextcloud/core/Controller/PreviewController.php","line":128,"function":"fetchPreview","class":"OC\\Core\\Controller\\PreviewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":165,"function":"getPreviewByFileId","class":"OC\\Core\\Controller\\PreviewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":78,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":324,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1159,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":25,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/richdocuments/lib/Service/RemoteService.php","Line":73},"message":"fclose(): supplied resource is not a valid stream resource in file '/var/www/nextcloud/apps/richdocuments/lib/Service/RemoteService.php' line 73","exception":"{\"class\":\"Exception\",\"message\":\"fclose(): supplied resource is not a valid stream resource in file '/var/www/nextcloud/apps/richdocuments/lib/Service/RemoteService.php' line 73\",\"code\":0,\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php:110\",\"trace\":\"#0 /var/www/nextcloud/lib/private/AppFramework/App.php(137): OC\\AppFramework\\Http\\Dispatcher->dispatch()\\n#1 /var/www/nextcloud/lib/private/Route/Router.php(324): OC\\AppFramework\\App::main()\\n#2 /var/www/nextcloud/lib/base.php(1159): OC\\Route\\Router->match()\\n#3 /var/www/nextcloud/index.php(25): OC::handleRequest()\\n#4 {main}\",\"previous\":{\"class\":\"TypeError\",\"message\":\"fclose(): supplied resource is not a valid stream resource\",\"code\":0,\"file\":\"/var/www/nextcloud/apps/richdocuments/lib/Service/RemoteService.php:73\",\"trace\":\"#0 /var/www/nextcloud/apps/richdocuments/lib/Service/RemoteService.php(73): fclose()\\n#1 /var/www/nextcloud/apps/richdocuments/lib/Preview/Office.php(56): OCA\\Richdocuments\\Service\\RemoteService->convertFileTo()\\n#2 /var/www/nextcloud/lib/private/Preview/GeneratorHelper.php(25): OCA\\Richdocuments\\Preview\\Office->getThumbnail()\\n#3 /var/www/nextcloud/lib/private/Preview/Generator.php(382): OC\\Preview\\GeneratorHelper->getThumbnail()\\n#4 /var/www/nextcloud/lib/private/Preview/Generator.php(336): OC\\Preview\\Generator->generateProviderPreview()\\n#5 /var/www/nextcloud/lib/private/Preview/Generator.php(127): OC\\Preview\\Generator->getMaxPreview()\\n#6 /var/www/nextcloud/lib/private/Preview/Generator.php(95): OC\\Preview\\Generator->generatePreviews()\\n#7 /var/www/nextcloud/lib/private/PreviewManager.php(183): OC\\Preview\\Generator->getPreview()\\n#8 /var/www/nextcloud/core/Controller/PreviewController.php(166): OC\\PreviewManager->getPreview()\\n#9 /var/www/nextcloud/core/Controller/PreviewController.php(128): OC\\Core\\Controller\\PreviewController->fetchPreview()\\n#10 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(165): OC\\Core\\Controller\\PreviewController->getPreviewByFileId()\\n#11 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(78): OC\\AppFramework\\Http\\Dispatcher->executeController()\\n#12 /var/www/nextcloud/lib/private/AppFramework/App.php(137): OC\\AppFramework\\Http\\Dispatcher->dispatch()\\n#13 /var/www/nextcloud/lib/private/Route/Router.php(324): OC\\AppFramework\\App::main()\\n#14 /var/www/nextcloud/lib/base.php(1159): OC\\Route\\Router->match()\\n#15 /var/www/nextcloud/index.php(25): OC::handleRequest()\\n#16 {main}\"}}","CustomMessage":"fclose(): supplied resource is not a valid stream resource in file '/var/www/nextcloud/apps/richdocuments/lib/Service/RemoteService.php' line 73"}}
```
### Additional info
_No response_