documentserver_community icon indicating copy to clipboard operation
documentserver_community copied to clipboard

File changes are shown in OnlyOffice but don't appear in Files app

Open rnwgnr opened this issue 5 years ago • 256 comments

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

Nextcloud: 18.0.0 (happens with SQLite and MariaDB Backend) , internal store only. DocumentServer_Communtiy version: 0.1.1 Still happens 18.0.3 and Document Server 0.1.5

Whenever editing a file in OnlyOffice, the changes are not reflected in the "Files" app:

  • The timestamp of the file does not change.
  • When downloading the file, the changes are lost.

Nevertheless when opening the file again in OnlyOffice, the changes are there.

I guess OnlyOffice caches the document internally and the changes are not copied back to the users storage folder.

rnwgnr avatar Jan 18 '20 11:01 rnwgnr

I just want to add it also happens with PostgreSQL as database (and redis as cache).

KopfKrieg avatar Jan 18 '20 22:01 KopfKrieg

This happens in Document Server_Community version: 0.1.2 Similar to others, I too have same issue of not saving the document, but changes reflects in onlyoffice alone. But its been saved few minutes after inactive session .

And if the document is being collaborated, sessions of the users are not terminated even if the user closes the window or onlyoffice. I hope the problem is hiding in termination of session. If the session is closed, document will be saved automatically. So we need to have an icon or some thing like that to close the session when closing the window or closing onlyoffice. And we need force save option as in onlyoffice

And the requirement is file has to be saved if the current user / last collaborated user closes their window.

pkmkrishnakumar-zz avatar Jan 21 '20 08:01 pkmkrishnakumar-zz

I can confirm this issue as well. I can edit and watch the changes in the web interface. But no file sync is initated and no files version is created as well the timestamp did not change. Nextcloud running on ubuntu 18.04, php7.3fpm, latest postgresql. This error comes up several times in an hour: {"reqId":"J8CAcxdnyyTHiHMCF2qE","level":3,"time":"2020-01-22T08:20:43+01:00","remoteAddr":"","user":"--","app":"documentserver_community","method":"","url":"--","message":{"Exception":"OCA\\DocumentServer\\Document\\DocumentConversionException","Message":"save_code: d.rb.ua,La,d.Me,e.Document)})}null!=d.fa&&(this.memory.va(Ai.fa),this.ra.Dk(function(){e.Epb(d,a,!0,c)}))};this.Epb=function(d,a,c,z){var h=0,Ga=d.fa.length-1;if(1==a&&(h=d.Selection.xa,Ga=d.Selection.ya,h>Ga)){var f=Ga;Ga=h;h=f}0>Ga&&(Ga=0);0>h&&(h=0);f=d.fa;for(var La=this;h<=Ga&&h<f.length;++h){var n=f[h];switch(n.ka){case $f:var r=n.Ym();ff!==r?it(r,n.Qv(),function(d,a,c,e){oh===d?a.ewa()?d=Ai.Qca:(d=Ai.Pya,c=!0):d=a.zpa()?Ai.Mfa:Ai.mza;La.ra.ta(d,function(){gB(La.ra,La.bq.Qja++,a,{UE:function(){e(c)}})})},\nsave: Uncaught TypeError: Cannot read property 'ua' of null\nDoctRenderer:<result><error code=\"save\" /></result>\n","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/documentserver_community/lib/DocumentConverter.php","line":123,"function":"run","class":"OCA\\DocumentServer\\Document\\ConverterBinary","type":"->","args":["/NEXTCLOUD-DATA/nextcloud-tmp/oc_tmp_q6UGwN-.xml"]},{"file":"/var/www/nextcloud/apps/documentserver_community/lib/DocumentConverter.php","line":78,"function":"runCommand","class":"OCA\\DocumentServer\\DocumentConverter","type":"->","args":[{"__class__":"OCA\\DocumentServer\\Document\\ConvertCommand"}]},{"file":"/var/www/nextcloud/apps/documentserver_community/lib/Document/DocumentStore.php","line":168,"function":"saveChanges","class":"OCA\\DocumentServer\\DocumentConverter","type":"->","args":["/NEXTCLOUD-DATA/data/appdata_ocl353ioyjno/documentserver_community/doc_4198266707",["38;CgAAADEAXwA1ADcANAABABwAAQAAAAUAAAACAAAAAAAAAAMAAAA=","26;CgAAADEAXwA1ADcANAACABwAAAAAAAAAAAA=","78;AgAAADEA//8BAF/X5hsU5QEAOQEAAAIAAAAGAAAABgAAAAYAAAAdAAAAHQAAABwAAAA1AC4ANAAuADIALgA0ADYALgBAAEAAUgBlAHYA"],"/NEXTCLOUD-DATA/data/appdata_ocl353ioyjno/documentserver_community/doc_4198266707/saved.docx","docx"]},{"file":"/var/www/nextcloud/apps/documentserver_community/lib/Document/SaveHandler.php","line":56,"function":"saveChanges","class":"OCA\\DocumentServer\\Document\\DocumentStore","type":"->","args":[4198266707,[{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"},{"__class__":"OCA\\DocumentServer\\Document\\Change"}]]},{"file":"/var/www/nextcloud/apps/documentserver_community/lib/BackgroundJob/Cleanup.php","line":69,"function":"flushChanges","class":"OCA\\DocumentServer\\Document\\SaveHandler","type":"->","args":[4198266707]},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":79,"function":"run","class":"OCA\\DocumentServer\\BackgroundJob\\Cleanup","type":"->","args":[null]},{"file":"/var/www/nextcloud/cron.php","line":125,"function":"execute","class":"OCP\\BackgroundJob\\Job","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"},{"__class__":"OC\\Log"}]}],"File":"/var/www/nextcloud/apps/documentserver_community/lib/Document/ConverterBinary.php","Line":56,"CustomMessage":"Error while applying changes for document 4198266707"},"userAgent":"--","version":"18.0.0.10","id":"5e27f8380f4c6"}

apg1980 avatar Jan 22 '20 07:01 apg1980

I also have this bug on three different Nextcloud instances, a completely fresh new installation, two upgrade versions. All on Ubuntu server 18.04. Program cannot be used. Are there already solutions here?

Digiseb avatar Jan 23 '20 10:01 Digiseb

Can confirm it too, Ubuntu 18.04 different instances.

hendrikreimers avatar Jan 24 '20 12:01 hendrikreimers

same here, Gentoo x86_64, MariaDB, updated instance ...

dheule avatar Jan 24 '20 20:01 dheule

same here, NC18release on current Arch, NGINX, mariadb, documentserver 0.1.3, onlyoffice 4.1.2:

  • click on .odt (file opens in onlyoffice/communityeditionserver), edit it, press "x" to close app, all fine
  • reload files page, timestamp of just edited file is old
  • reopen file in onlyoffice: recent modifications are there
  • download file and open in libreoffice: recent modifications are NOT there

Edit: Next day (!) the file timestamp has been updated and changes are visible to synced files also. New changes are not saved to the file to file but cached in OO again.

Sidenote: "Convert using Onlyoffice" (from 3dot-menu) gives me "Bad response: Start tag expected, '<' not found" Edit: → This has been fixed in 0.1.4, at least for me it's working now: e.g. applying "Convert using Onlyoffice' on a .otd creates a .docx.

nursoda avatar Jan 25 '20 16:01 nursoda

Same bug -- Upgraded Nextcloud18 on Ubuntu 18.04 However, I notice that when I leave the browser tab with Onlyoffice in it sitting there, it appears to autosave every half hour or so. File gets written to disk with updated timestamp at :00 and :30 when changes are made in the meantime. So it appears, for me at least, that I cannot save manually ('Save' icon greyed out), and closing OnlyOffice loses changes. But waiting until scheduled :00/:30 autosave works?!

nonplusnl avatar Jan 26 '20 20:01 nonplusnl

Same bug -- Upgraded Nextcloud18 on Ubuntu 18.04 However, I notice that when I leave the browser tab with Onlyoffice in it sitting there, it appears to autosave every half hour or so. File gets written to disk with updated timestamp at :00 and :30 when changes are made in the meantime. So it appears, for me at least, that I cannot save manually ('Save' icon greyed out), and closing OnlyOffice loses changes. But waiting until scheduled :00/:30 autosave works?!

As a temporary solution you may uncheck Autosave. However, it should be fixed somewhere... Maybe this 30 minutes delay is hard coded somehwhere?...

image

oleua avatar Jan 28 '20 17:01 oleua

i can confirm that the saving behaviour in 0.1.4 is working quite better. file is saved after view seconds automatically. if you have disabled autosave in 0.1.3, the feature is set enabled after updating to 0.1.4.

apg1980 avatar Jan 29 '20 16:01 apg1980

Can't confirm that saving is any better. Still takes minutes at least until changes are visible via files app / webdav. But according to my (non-systematic) observations, it's not necessary to keep the Onlyoffice app open for the file to be saved. It just takes (way too much) time. Is that a conceptual issue? Edit: No change in respect to the "not saved timely" after update to 0.1.5 for me.

nursoda avatar Jan 29 '20 22:01 nursoda

I'm on 0.1.5 with the same issue, can't use it since I don't know it will save or not.

dasunsrule32 avatar Jan 31 '20 07:01 dasunsrule32

Ok, i think i figured it out. Changes will be written to nextcloud after the next nextcloud cronjob was compleately run.

apg1980 avatar Jan 31 '20 11:01 apg1980

This is where a hybrid background job mode between Cron and Ajax would be nice I suppose and then giving things like the document server the highest priority when it comes to Ajax. That way your files would always be up to date.

5+ minutes isn't good enough for saving of docs from the document server to nextcloud.

dasunsrule32 avatar Jan 31 '20 15:01 dasunsrule32

Triggering a mini-'save-this-document'-Ajax-Job would be sufficient. It doesn't have to be a full cron job after closing a document. But I definitely consider it a bug that changes are not saved upon Document/OnlyOffice-app-close if "real cron" is configured (which is recommended).

nursoda avatar Jan 31 '20 16:01 nursoda

Triggering a mini-'save-this-document'-Ajax-Job would be sufficient. It doesn't have to be a full cron job after closing a document. But I definitely consider it a bug that changes are not saved upon Document/OnlyOffice-app-close if "real cron" is configured (which is recommended).

Right, that's what I was leaning towards. I haven't looked at the nextcloud source, so I don't know exactly what would need to be done without looking into things.

I would prefer that job to run after every change in a document like Google Docs. Just having that revision history would be great.

dasunsrule32 avatar Jan 31 '20 16:01 dasunsrule32

Related issues: #55, #53

chrstn-hntschl avatar Feb 04 '20 14:02 chrstn-hntschl

This issue has been confirmed multiple times by now, there are 3 different issues reporting this behaviour. Any kind of feedback from the devs would be nice, the DocumentServer community is unusable due to unintended data loss.

rnwgnr avatar Feb 04 '20 15:02 rnwgnr

What ~~works~~ for my nextcloud instance is a cron job with

 *        *    *    *     *     php -f /var/www/yourdomain/occ documentserver:flush

~~But I would consider this just as a workaround...~~

EDIT: see https://github.com/nextcloud/documentserver_community/issues/12#issuecomment-584148660

googol42 avatar Feb 06 '20 20:02 googol42

@googol42: Good idea/workaround. Could you share an example how this would look like in my cron.php? I hope I'm making sense.

HugoPrinz avatar Feb 10 '20 14:02 HugoPrinz

@HugoPrinz this has nothing to do with the cron.php. I added an additional cronjob to execute the php file occ. See https://docs.nextcloud.com/server/18/admin_manual/configuration_server/occ_command.html

However, I had this cronjob active for some time, but it only helped somewhat... I deactivated it again, because suddenly saw errors I did not see before. Furthermore I did not find any documentation what this is supposed to do. I just tried it. I still have data losses btw.

googol42 avatar Feb 10 '20 14:02 googol42

@googol42 Thanks for sharing. I'll look into this.

HugoPrinz avatar Feb 10 '20 21:02 HugoPrinz

Same problem here, using the nextcloud 18.0.1 docker image with integrated community server. 0.1.5 on ubuntu 16.04 server. The issue renders the onlyoffice integration kind of useless, as people getting totally confused that they edit the document, but then download an empty file, as it never gets build and replicated back into the file space of nextcloud. Still if they open in nextcloud, onlyoffice is showing them all changes... If I look into the container I can see all the temp directories in the appdata with all the Editor.bin files relating to the files which are edited. Does anyone know how I can force to process them? I also see the topic that if I open and leave a document several times in the same session, it counts up and show that several users are working on the document, but it is always my account.

tjareson avatar Feb 18 '20 09:02 tjareson

I've used the cron job from @googol42 as well, and looks like working quite reliable so far. But in my case I had to implement it on the docker host, as somehow I couldn't get cron to work properly in the nextcloud container.

          • root /* * * * * root /usr/bin/docker exec -t containername sudo -u www-data php occ documentserver:flush

tjareson avatar Feb 18 '20 12:02 tjareson

@HugoPrinz this has nothing to do with the cron.php. I added an additional cronjob to execute the php file occ. See https://docs.nextcloud.com/server/18/admin_manual/configuration_server/occ_command.html

However, I had this cronjob active for some time, but it only helped somewhat... to put it in a nutshell: I still have data losses. @googol42 Are you aware of specific situations where you see changes not saved even with the cron job? (Just to be warned what better not to do...)

tjareson avatar Feb 18 '20 12:02 tjareson

@tjareson no, I don't have any further information :(

googol42 avatar Feb 18 '20 12:02 googol42

We have just noticed issues with the cron job workaround, if more than one user/session is editing the document. It can happen then that only the things which were edited/inserted by the second user/session remains in the document and everything previous is gone. So the workaround is a bit limited...

tjareson avatar Feb 18 '20 13:02 tjareson

Start begining Problems with the Cronjob Workarround. Cronjob ist blocket by this one of Errorcode..

In ConverterBinary.php line 64:
namespace error : Namespace prefix wp14 on sizeRelH is not defined now, compleat Workarround is broken maybe about one corrupt file in the Line..?

Digiseb avatar Feb 24 '20 11:02 Digiseb

found this in the original DocumentServer Issues: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/55 and https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/54#issuecomment-304230708

q-wertz avatar Feb 28 '20 09:02 q-wertz

Looks like there are a bunch of issues regarding this topic, some more the 2 years old: https://github.com/ONLYOFFICE/onlyoffice-owncloud/issues/27 https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/122 https://github.com/nextcloud/activity/issues/391 https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/241

rnwgnr avatar Feb 28 '20 09:02 rnwgnr