documentserver_community icon indicating copy to clipboard operation
documentserver_community copied to clipboard

stream_get_contents(): supplied resource is not a valid stream resource at FontManager.php#67

Open BornToBeRoot opened this issue 5 years ago • 25 comments

Got this error from time to time in den Nextcloud logs...

Updated from Nextcloud 17.0.2 to 18.0.0

{"reqId":"XjMU7cZJFoD7u3HgzTIDhgAAAAg","level":3,"time":"2020-01-30T17:41:06+00:00","remoteAddr":"84.161.215.253","user":"USERNAME","app":"PHP","method":"GET","url":"/settings/apps/update/documentserver_community","message":"fclose(): supplied resource is not a valid stream resource at /var/www/html/nextcloud/apps/documentserver_community/lib/Document/FontManager.php#66","userAgent":"Mozilla/5.0 (Linux; Android 9; SNE-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36","version":"18.0.0.10","id":"5e3317a41b45b"}
{"reqId":"XjMU7cZJFoD7u3HgzTIDhgAAAAg","level":3,"time":"2020-01-30T17:41:06+00:00","remoteAddr":"84.161.215.253","user":"USERNAME","app":"PHP","method":"GET","url":"/settings/apps/update/documentserver_community","message":"fclose(): supplied resource is not a valid stream resource at /var/www/html/nextcloud/apps/documentserver_community/lib/Document/FontManager.php#66","userAgent":"Mozilla/5.0 (Linux; Android 9; SNE-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 Mobile Safari/537.36","version":"18.0.0.10","id":"5e3317a41b45b"}

BornToBeRoot avatar Jan 30 '20 17:01 BornToBeRoot

Same here! Upgraded from 17.0.2 to 18.0.0, using docker-compose for my configuration

rogsme avatar Jan 30 '20 21:01 rogsme

Happening here after update of the document_server app to version 0.1.5

Nils160988 avatar Jan 30 '20 21:01 Nils160988

Yes, I can also confirm this as well. the error occurs for me on both 0.1.4 and 0.1.5

ghostwind66 avatar Jan 31 '20 15:01 ghostwind66

Try the permission fix as mentioned here: https://github.com/nextcloud/documentserver_community/issues/40

It looks like 0.1.4 should mitigate this issue but it seems like if your HTTP/PHP-FPM user doesn't have the ability to modify permissions in that directory, it wouldn't work. I'd definitely expect that sort of behavior in a docker container. Or even if SELinux is set to Enforce.

ghost avatar Feb 03 '20 16:02 ghost

I can confirm this behaviour in my docker set up as well:

{"reqId":"jQO0XzQaMjeAT8wAirca","level":3,"time":"2020-02-07T10:57:52+00:00","remoteAddr":"xx","user":"xx","app":"PHP","method":"POST","url":"/settings/apps/enable","message":"fclose(): supplied resource is not a valid stream resource at /var/www/html/custom_apps/documentserver_community/lib/Document/FontManager.php#66","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0","version":"18.0.0.10","id":"5e3d883c40b3f"}
{"reqId":"jQO0XzQaMjeAT8wAirca","level":3,"time":"2020-02-07T10:57:52+00:00","remoteAddr":"xx","user":"xx","app":"PHP","method":"POST","url":"/settings/apps/enable","message":"stream_get_contents(): supplied resource is not a valid stream resource at /var/www/html/custom_apps/documentserver_community/lib/Document/FontManager.php#67","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0","version":"18.0.0.10","id":"5e3d883c40b2f"}

Mentioned permission fix didn't help it.

mrwsl avatar Feb 07 '20 15:02 mrwsl

same problem here. not running in a docker container. fresh install of both nc18 and document server.

howudodat avatar Feb 08 '20 06:02 howudodat

I'm also having this same problem & FontManager.php#66 as well. I'm running nc18.0.1 via the Linuxserver Nextcloud image.

[PHP] Error: stream_get_contents(): supplied resource is not a valid stream resource at /config/www/nextcloud/apps/documentserver_community/lib/Document/FontManager.php#67

POST /settings/apps/enable
from 172.19.0.1 by xthursdayx at 2020-02-16T20:15:55+00:00

xthursdayx avatar Feb 16 '20 20:02 xthursdayx

nc 18.0.1 cds 0.1.5 ubuntu server 18.04

setting permissions as in suggested in #40 is not possible, the file does not exist after unpacking cds 0.1.5.

ie there is no "allfontsgen" in

$NEXTCLOUD_DIR/apps/documentserver_community/3rdparty/onlyoffice/documentserver/server/FileConverter/bin/

It is, however in

$NEXTCLOUD_DIR/apps/documentserver_community/3rdparty/onlyoffice/documentserver/server/tools

There the execution-bit is set (-rwxr-xr-x). #40 suggests "chmod -", thus removing the execution bit.

inkfs avatar Feb 17 '20 13:02 inkfs

I got the same error to with my docker installation. Link to the forum

Aurnytoraink avatar Feb 23 '20 21:02 Aurnytoraink

Hi,

I think that it is not an execution right issue as rights are set here, but allfontsgen is looking for libraries it does not find. Adding symlinks from FileConverter/bin in server/tools of :

libUnicodeConverter.so
libgraphics.so
libicudata.so.58
libicuuc.so.58
libkernel.so

helps and the message disappears. Fonts are listed in documentserver_community/3rdparty/onlyoffice/documentserver/fonts but OnlyOffice is still not working :/

It seems that this file has been created by @icewind1991 maybe he can help :)

Oliv4945 avatar Feb 24 '20 23:02 Oliv4945

Same problem here with Nextcloud 18.0.2 fclose(): supplied resource is not a valid stream resource at /home/www/cloud.myserver.tv/apps/documentserver_community/lib/Document/FontManager.php#66

with it comes a second error: stream_get_contents(): supplied resource is not a valid stream resource at /home/www/cloud.geistigewelt.tv/apps/documentserver_community/lib/Document/FontManager.php#67

One document cannot be opened. Loading stops at 100%

Jolopu avatar Mar 16 '20 22:03 Jolopu

I think the issue has to do with the font used in the docx. It was created in MS Word with Calibri. Then it was saved on Nextcloud. When I tried to open it with OnlyOffice it got stuck on loading. Calibri is not included in the OnlyOffice fonts. When I created the document using Arial I could open it in OnlyOffice.

Jolopu avatar Mar 16 '20 22:03 Jolopu

I have the messages at the activation of app documentserver_community ´occ app:enable documentserver_community´

WhilelM avatar Mar 17 '20 10:03 WhilelM

I think the issue has to do with the font used in the docx

Can not approve. Just updated NC from v17.0.4 to v18.0.2 (Docker) and downloaded and enabled Community Document Server app afterwards. It took quite some time to install, obviously, but when it was done, nothing else happened. No extra icon in the header menu, no extra entries in the (+) menu. Instead, I also see the aforementioned stream_get_contents()… notes in the logs. There are no .docx nor .odt nor any other documents anywhere whatsoever.

mcnesium avatar Mar 18 '20 09:03 mcnesium

@mcnesium I'm in the same situation as you but I have the icons. In the settings, go to the ONLYOFFice tab and make sure that the address is "https" (that worked for me) But I'm still stuck. When I create a new document, openoffice launch up but I get an error pop-up

Aurnytoraink avatar Mar 18 '20 09:03 Aurnytoraink

@Aurnytoraink unfortunately, there is also no OnlyOffice tab in the settings :(

mcnesium avatar Mar 18 '20 09:03 mcnesium

@mcnesium Go the applications and make sure that only office is installed

Aurnytoraink avatar Mar 18 '20 09:03 Aurnytoraink

@Aurnytoraink

Screenshot_2020-03-18 Apps - Nextcloud

Screenshot_2020-03-18 Settings - Nextcloud

Screenshot_2020-03-18 Logging - Nextcloud

mcnesium avatar Mar 18 '20 10:03 mcnesium

@mcnesium on the applications page (first pic), click on the search button (top-right corner) and search for onlyoffice

Aurnytoraink avatar Mar 18 '20 10:03 Aurnytoraink

@Aurnytoraink Thank you, now I understand.

Why in the world does it not say "You also need to install this other app" on the top of the README.md of this app? I am sure many users struggle to get this running just because Nextcloud does not communicate transparently how to do it.

So now I got this ONLYOFFICE (*) entry in the settings. Document Editing Service address is set to https://cloud.mydomain.de/index.php/apps/documentserver_community/ and I was able to create a spread sheet using the (+) menu. Thank you for guiding me to that :+1:

mcnesium avatar Mar 18 '20 10:03 mcnesium

Thank you @Aurnytoraink @mcnesium Finally I have OO up and running, too : )

inkfs avatar Mar 18 '20 12:03 inkfs

Glad that's working for you :disappointed_relieved:

Aurnytoraink avatar Mar 18 '20 20:03 Aurnytoraink

Thank you @Aurnytoraink , I did not understood too that a second package is required...

Oliv4945 avatar Mar 19 '20 21:03 Oliv4945

Same here. Thanks for clarifying @Aurnytoraink !

mrwsl avatar Mar 20 '20 09:03 mrwsl

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 60 days. Thank you for your contribution!

Retaking repo management include inheritance of old, not treated, and probablty obsolete issues, this is why it was decided to mark issues as stale.

github-actions[bot] avatar Apr 08 '24 00:04 github-actions[bot]

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

github-actions[bot] avatar Jun 10 '24 00:06 github-actions[bot]