richdocuments icon indicating copy to clipboard operation
richdocuments copied to clipboard

Unable to create a new file from a template

Open Menzaah opened this issue 2 years ago • 11 comments

Steps to reproduce

  1. Create an Excel table template
  2. Import an Excel template into Nextcloud Office settings
  3. Try creating a new spreadsheet from this template

Expected behavior

The spreadsheet is supposed to open and therefore the file is created.

Actual behavior

Via the Nextcloud application it is impossible to create a new file from the templates. On Android it is downright impossible to select a template and on iOS during creation it runs in a vacuum and ends up creating an empty file in the wrong format. On the other hand, via the web interface from a computer, this poses no problem.

Host OS

Ubuntu 20.04

Nextcloud AIO version

Nextcloud AIO v4.8.1

Current channel

Latest channel

Other valuable info

On creation failures via iOS, no error log is generated and no error messages on the device. On the android side I can't even create a file from a template. Here are the only logs I have regarding Richdocuments that I don't understand the origin at all.

Logs richdocuments-error.txt

Thank you in advance for all the help provided, it's not totally blocking but quite disabling.

Menzaah avatar Apr 15 '23 09:04 Menzaah

I could not reproduce this. Can you share which version of richdocuments you are using and which version of the Collabora Online container is in use? Also if you are able to share a copy of the template file you used and how you have configured it (as user template or admin template) this would be helpful.

juliusknorr avatar Apr 25 '23 08:04 juliusknorr

Hello, Nextcloud AIO is in version V.4.9.0 with all containers up-to-date. Regarding Richdocument and Collabora Online, how can I find the specified version? Otherwise you will find attached a copy of the file in question, which is an excel template that we use daily. I added it as an admin template via the Nextcloud Office administration settings.

Thanks for your help !

DEPART.zip

Menzaah avatar Apr 25 '23 08:04 Menzaah

I have the same problem - i think since the last upgrade to richdocument 7.1.3

I am running NC 25.0.5 und Collabora in der Version 22.05.13.1

The behaviour is the same as @Menzaah described above. The iOS-App creates only a .ott-file with 0 bytes. From the webinterface a correct file is created - but after i try to close the document i don't come back to the nextcloud - i only see the background-image of the nextcloud.

From my point of view, the mistake happens before contacting the collaboraserver. Collabora would be contacted only after a new document has been created from the global template. But even that does not work.

Bingenberger avatar May 15 '23 12:05 Bingenberger

Hello !

In continuity, after an update to Nextcloud AIO v6.0.0 still the same problem...

Menzaah avatar Jun 09 '23 13:06 Menzaah

@szaimen can you check if you can reproduce this on AIO?

juliusknorr avatar Jun 09 '23 15:06 juliusknorr

Yes, I can reproduce this with the following example file: Persönliches Monatsbudget1.zip I get the following logs in the collabora container when I try to create a new file from the template via web:

frk-00020-00020 2023-06-10 14:35:24.551270 +0200 [ forkit ] WRN  The systemplate directory [/opt/cool/systemplate] is read-only, and at least [/opt/cool/systemplate//etc/hosts] is out-of-date. Will have to copy sysTemplate to jails. To restore optimal performance, make sure the files in [/opt/cool/systemplate/etc] are up-to-date.| common/JailUtil.cpp:438
kit-00022-00020 2023-06-10 14:35:25.148851 +0200 [ kitbroker_001 ] ERR  Failed to load: file:///tmp/user/docs/ZbwidLqSFqh4YwCT/New%20spreadsheet.ods, error: loadComponentFromURL returned an empty reference| kit/Kit.cpp:1458
kit-00022-00020 2023-06-10 14:35:25.148918 +0200 [ kitbroker_001 ] ERR  ToMaster-01b: error: cmd=load kind=faileddocloading| common/Session.hpp:165
Failed to load the document. Setting TerminationFlag
kit-00022-00020 2023-06-10 14:35:25.149074 +0200 [ kitbroker_001 ] FTL  Failed to load the document. Setting TerminationFlag| kit/Kit.cpp:1485
kit-00022-00020 2023-06-10 14:35:25.149103 +0200 [ kitbroker_001 ] ERR  ToMaster-01b: Failed to get LoKitDocument instance for [file:///tmp/user/docs/ZbwidLqSFqh4YwCT/New%20spreadsheet.ods]| kit/ChildSession.cpp:816
wsd-00001-00118 2023-06-10 14:35:25.149346 +0200 [ docbroker_001 ] ERR  ToClient-01b: Document load failed: faileddocloading| wsd/ClientSession.cpp:1583
wsd-00001-00118 2023-06-10 14:35:25.149551 +0200 [ docbroker_001 ] ERR  Unexpected message: [o12 close: ].| wsd/DocumentBroker.cpp:2933
wsd-00001-00118 2023-06-10 14:35:25.149723 +0200 [ docbroker_001 ] ERR  #21: Socket write returned -1 (EPIPE: Broken pipe)| net/Socket.hpp:1442
wsd-00001-00118 2023-06-10 14:35:25.150030 +0200 [ docbroker_001 ] ERR  #21: Socket write returned -1 (EPIPE: Broken pipe)| net/Socket.hpp:1442
wsd-00001-00118 2023-06-10 14:35:25.150052 +0200 [ docbroker_001 ] WRN  #21: Shutting down but 4 bytes couldn't be flushed and still remain in the output buffer| net/WebSocketHandler.hpp:857
wsd-00001-00118 2023-06-10 14:35:25.150078 +0200 [ docbroker_001 ] ERR  #21: Socket write returned -1 (EPIPE: Broken pipe)| net/Socket.hpp:1442
wsd-00001-00118 2023-06-10 14:35:25.150188 +0200 [ docbroker_001 ] WRN  #21: DocBroker [https://mynextcloud.com:443/index.php/apps/richdocuments/wopi/files/4915_ocdqopf62h6v] got disconnected from its Kit (22) unexpectedly. Closing| wsd/COOLWSD.cpp:3396
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted
sh: 1: /usr/bin/coolmount: Operation not permitted

szaimen avatar Jun 10 '23 12:06 szaimen

Thanks. Apparently I can also reproduce this, but only when creating a new ods file from the xltx file, i might have had the setting enabled on the last attempt to "Use Office Open XML (OOXML) instead of OpenDocument Format (ODF) by default for new files" in which case it works fine.

Will need to further check if that is actually an upstream issue in Collabora.

juliusknorr avatar Jun 11 '23 19:06 juliusknorr

"Use Office Open XML (OOXML) instead of OpenDocument Format (ODF) by default for new files" in which case it works fine.

Indeed I dont have this enabled on my test instance.

szaimen avatar Jun 11 '23 19:06 szaimen

Hello !

Our nextcloud instance is under the latest version of the "stable" channel (Nextcloud AIO v6.3.0) and the problem still persists.

Menzaah avatar Jul 26 '23 18:07 Menzaah

This happens when creating any of ODF from any of MS template files. Created file is not ODF but OOXML structure. Interesting is that with multiple attempts results may be different, i.e. sometimes is proper file created. With NC 30/RD 8.5.3 behavior seems changed, I get "Unable to create the new file from template" but file is really created as before. Collabora complains when opening created file if it is with wrong structure, like ODF extension but OOXML structure.

Seems this issue may be the same, not enought details there which extension from which template, just: "create a file from a template (either user or system template) I get an error: Unable to create new file from template" https://github.com/nextcloud/richdocuments/issues/2167.

timur-g avatar Dec 21 '24 16:12 timur-g

This happens when creating any of ODF from any of MS template files. Created file is not ODF but OOXML structure. Interesting is that with multiple attempts results may be different, i.e. sometimes is proper file created. With NC 30/RD 8.5.3 behavior seems changed, I get "Unable to create the new file from template" but file is really created as before. Collabora complains when opening created file if it is with wrong structure, like ODF extension but OOXML structure.

I can confirm this is probably the case for me too. If you really want to use ODF, you can create your own templates and use those instead of the default ones.

freeklucas avatar Jul 05 '25 20:07 freeklucas