Problem with Protocol and repeat the same problem

Hello Guys,

i have allways the same Problem.

Exceptionfclose(): Argument #1 ($stream) must be an open stream resource in file ‘/var/www/html/custom_apps/richdocuments/lib/Service/RemoteService.php’ line 73

Anyone can help?

Nextcloud Hub 26 Winter (34.0.1):

  • Operating system and version (Truenas Linux version : 6.12.33-production+truenas #1 SMP PREEMPT_DYNAMIC Mon Feb 23 17:38:27 UTC 2026 x86_64 GNU/Linux*)*

  • postgres version 18.3-trixie

  • nginx version 1.29.6:

  • Reverse proxy npmplus (version 2.14.0): GitHub - ZoeyVid/NPMplus: a fork of nginx-proxy-manager · GitHub

  • PHP version (8.4.18):

  • Is this the first time you’ve seen this error? (Yes )

  • Installation method (APP Container on Truenas Scale version 24.10.2.1 Goldeye – Maintainer Installation Template*)*

  • Are you using Cloudflare, mod_security, or similar? (No) - its on my own network

you should paste the full error message, i.e. the raw log entry.

Exceptionfclose(): Argument #1 ($stream) must be an open stream resource in file ‘/var/www/html/custom_apps/richdocuments/lib/Service/RemoteService.php’ line 73

  1. /var/www/html/lib/private/AppFramework/App.phpZeile 137

    OC\AppFramework\Http\Dispatcher->dispatch(
      {
        "__class__": "OC\\Core\\Controller\\PreviewController"
      },
      "getPreviewByFileId"
    )
    
  2. /var/www/html/lib/private/Route/Router.phpZeile 324

    OC\AppFramework\App::main(
      "OC\\Core\\Controller\\PreviewController",
      "getPreviewByFileId",
      {
        "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
      },
      {
        "_route": "core.preview.getpreviewbyfileid"
      }
    )
    
  3. /var/www/html/lib/base.phpZeile 1159

    OC\Route\Router->match(
      "/core/preview"
    )
    
  4. /var/www/html/index.phpZeile 25

    OC::handleRequest()
    

Verursacht von TypeErrorfclose(): Argument #1 ($stream) must be an open stream resource

{
"reqId": "gewgkGI3LsdPgivmfX3g",
"level": 3,
"time": "2026-07-22T10:02:34+00:00",
"remoteAddr": "172.16.1.7",
"user": "admin",
"app": "index",
"method": "GET",
"url": "/core/preview?fileId=3459&x=250&y=250",
"scriptName": "/index.php",
"message": "fclose(): Argument #1 ($stream) must be an open stream resource in file '/var/www/html/custom_apps/richdocuments/lib/Service/RemoteService.php' line 73",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36 OPR/132.0.0.0",
"version": "34.0.1.2",
"exception": {
"Exception": "Exception",
"Message": "fclose(): Argument #1 ($stream) must be an open stream resource in file '/var/www/html/custom_apps/richdocuments/lib/Service/RemoteService.php' line 73",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/lib/private/AppFramework/App.php",
"line": 137,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OC\\Core\\Controller\\PreviewController"
},
"getPreviewByFileId"
]
},
{
"file": "/var/www/html/lib/private/Route/Router.php",
"line": 324,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::",
"args": [
"OC\\Core\\Controller\\PreviewController",
"getPreviewByFileId",
{
"__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
},
{
"_route": "core.preview.getpreviewbyfileid"
}
]
},
{
"file": "/var/www/html/lib/base.php",
"line": 1159,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->",
"args": [
"/core/preview"
]
},
{
"file": "/var/www/html/index.php",
"line": 25,
"function": "handleRequest",
"class": "OC",
"type": "::",
"args": []
}
],
"File": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"Line": 110,
"Previous": {
"Exception": "TypeError",
"Message": "fclose(): Argument #1 ($stream) must be an open stream resource",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/custom_apps/richdocuments/lib/Service/RemoteService.php",
"line": 73,
"function": "fclose",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/custom_apps/richdocuments/lib/Preview/Office.php",
"line": 56,
"function": "convertFileTo",
"class": "OCA\\Richdocuments\\Service\\RemoteService",
"type": "->",
"args": [
{
"__class__": "OC\\Files\\Node\\File"
},
"png",
5
]
},
{
"file": "/var/www/html/lib/private/Preview/GeneratorHelper.php",
"line": 25,
"function": "getThumbnail",
"class": "OCA\\Richdocuments\\Preview\\Office",
"type": "->",
"args": [
{
"__class__": "OC\\Files\\Node\\File"
},
4096,
4096
]
},
{
"file": "/var/www/html/lib/private/Preview/Generator.php",
"line": 382,
"function": "getThumbnail",
"class": "OC\\Preview\\GeneratorHelper",
"type": "->",
"args": [
{
"__class__": "OCA\\Richdocuments\\Preview\\OOXML"
},
{
"__class__": "OC\\Files\\Node\\File"
},
4096,
4096
]
},
{
"file": "/var/www/html/lib/private/Preview/Generator.php",
"line": 336,
"function": "generateProviderPreview",
"class": "OC\\Preview\\Generator",
"type": "->",
"args": [
{
"__class__": "OC\\Files\\Node\\File"
},
4096,
4096,
false,
true,
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
null
]
},
{
"file": "/var/www/html/lib/private/Preview/Generator.php",
"line": 127,
"function": "getMaxPreview",
"class": "OC\\Preview\\Generator",
"type": "->",
"args": [
[],
{
"__class__": "OC\\Files\\Node\\File"
},
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
null
]
},
{
"file": "/var/www/html/lib/private/Preview/Generator.php",
"line": 95,
"function": "generatePreviews",
"class": "OC\\Preview\\Generator",
"type": "->",
"args": [
{
"__class__": "OC\\Files\\Node\\File"
},
[
{
"width": 250,
"height": 250,
"crop": true,
"mode": "fill"
}
],
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
true
]
},
{
"file": "/var/www/html/lib/private/PreviewManager.php",
"line": 183,
"function": "getPreview",
"class": "OC\\Preview\\Generator",
"type": "->",
"args": [
{
"__class__": "OC\\Files\\Node\\File"
},
250,
250,
true,
"fill",
null,
true
]
},
{
"file": "/var/www/html/core/Controller/PreviewController.php",
"line": 166,
"function": "getPreview",
"class": "OC\\PreviewManager",
"type": "->",
"args": [
{
"__class__": "OC\\Files\\Node\\File"
},
250,
250,
true,
"fill"
]
},
{
"file": "/var/www/html/core/Controller/PreviewController.php",
"line": 128,
"function": "fetchPreview",
"class": "OC\\Core\\Controller\\PreviewController",
"type": "->",
"args": [
{
"__class__": "OC\\Files\\Node\\File"
},
250,
250,
false,
true,
"fill",
false
]
},
{
"file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"line": 165,
"function": "getPreviewByFileId",
"class": "OC\\Core\\Controller\\PreviewController",
"type": "->",
"args": [
3459,
250,
250,
false,
true,
"fill",
false
]
},
{
"file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"line": 78,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OC\\Core\\Controller\\PreviewController"
},
"getPreviewByFileId"
]
},
{
"file": "/var/www/html/lib/private/AppFramework/App.php",
"line": 137,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OC\\Core\\Controller\\PreviewController"
},
"getPreviewByFileId"
]
},
{
"file": "/var/www/html/lib/private/Route/Router.php",
"line": 324,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::",
"args": [
"OC\\Core\\Controller\\PreviewController",
"getPreviewByFileId",
{
"__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
},
{
"_route": "core.preview.getpreviewbyfileid"
}
]
},
{
"file": "/var/www/html/lib/base.php",
"line": 1159,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->",
"args": [
"/core/preview"
]
},
{
"file": "/var/www/html/index.php",
"line": 25,
"function": "handleRequest",
"class": "OC",
"type": "::",
"args": []
}
],
"File": "/var/www/html/custom_apps/richdocuments/lib/Service/RemoteService.php",
"Line": 73
},
"message": "fclose(): Argument #1 ($stream) must be an open stream resource in file '/var/www/html/custom_apps/richdocuments/lib/Service/RemoteService.php' line 73",
"exception": "{\"class\":\"Exception\",\"message\":\"fclose(): Argument #1 ($stream) must be an open stream resource in file '/var/www/html/custom_apps/richdocuments/lib/Service/RemoteService.php' line 73\",\"code\":0,\"file\":\"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php:110\",\"trace\":\"#0 /var/www/html/lib/private/AppFramework/App.php(137): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OC\\Core\\Controller\\PreviewController), 'getPreviewByFil...')\\n#1 /var/www/html/lib/private/Route/Router.php(324): OC\\AppFramework\\App::main('OC\\\\Core\\\\Control...', 'getPreviewByFil...', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\\n#2 /var/www/html/lib/base.php(1159): OC\\Route\\Router->match('/core/preview')\\n#3 /var/www/html/index.php(25): OC::handleRequest()\\n#4 {main}\",\"previous\":{\"class\":\"TypeError\",\"message\":\"fclose(): Argument #1 ($stream) must be an open stream resource\",\"code\":0,\"file\":\"/var/www/html/custom_apps/richdocuments/lib/Service/RemoteService.php:73\",\"trace\":\"#0 /var/www/html/custom_apps/richdocuments/lib/Service/RemoteService.php(73): fclose(Resource id #17)\\n#1 /var/www/html/custom_apps/richdocuments/lib/Preview/Office.php(56): OCA\\Richdocuments\\Service\\RemoteService->convertFileTo(Object(OC\\Files\\Node\\File), 'png', 5)\\n#2 /var/www/html/lib/private/Preview/GeneratorHelper.php(25): OCA\\Richdocuments\\Preview\\Office->getThumbnail(Object(OC\\Files\\Node\\File), 4096, 4096)\\n#3 /var/www/html/lib/private/Preview/Generator.php(382): OC\\Preview\\GeneratorHelper->getThumbnail(Object(OCA\\Richdocuments\\Preview\\OOXML), Object(OC\\Files\\Node\\File), 4096, 4096)\\n#4 /var/www/html/lib/private/Preview/Generator.php(336): OC\\Preview\\Generator->generateProviderPreview(Object(OC\\Files\\Node\\File), 4096, 4096, false, true, 'application/vnd...', NULL)\\n#5 /var/www/html/lib/private/Preview/Generator.php(127): OC\\Preview\\Generator->getMaxPreview(Array, Object(OC\\Files\\Node\\File), 'application/vnd...', NULL)\\n#6 /var/www/html/lib/private/Preview/Generator.php(95): OC\\Preview\\Generator->generatePreviews(Object(OC\\Files\\Node\\File), Array, 'application/vnd...', true)\\n#7 /var/www/html/lib/private/PreviewManager.php(183): OC\\Preview\\Generator->getPreview(Object(OC\\Files\\Node\\File), 250, 250, true, 'fill', NULL, true)\\n#8 /var/www/html/core/Controller/PreviewController.php(166): OC\\PreviewManager->getPreview(Object(OC\\Files\\Node\\File), 250, 250, true, 'fill')\\n#9 /var/www/html/core/Controller/PreviewController.php(128): OC\\Core\\Controller\\PreviewController->fetchPreview(Object(OC\\Files\\Node\\File), 250, 250, false, true, 'fill', false)\\n#10 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(165): OC\\Core\\Controller\\PreviewController->getPreviewByFileId(3459, 250, 250, false, true, 'fill', false)\\n#11 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(78): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OC\\Core\\Controller\\PreviewController), 'getPreviewByFil...')\\n#12 /var/www/html/lib/private/AppFramework/App.php(137): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OC\\Core\\Controller\\PreviewController), 'getPreviewByFil...')\\n#13 /var/www/html/lib/private/Route/Router.php(324): OC\\AppFramework\\App::main('OC\\\\Core\\\\Control...', 'getPreviewByFil...', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\\n#14 /var/www/html/lib/base.php(1159): OC\\Route\\Router->match('/core/preview')\\n#15 /var/www/html/index.php(25): OC::handleRequest()\\n#16 {main}\"}}",
"CustomMessage": "fclose(): Argument #1 ($stream) must be an open stream resource in file '/var/www/html/custom_apps/richdocuments/lib/Service/RemoteService.php' line 73"
},
"id": "6a60be528de46"
}