You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
With up-to-date versions of nextcloud (18.0.2) and documentserver_community (0.1.5) (and onlyoffice app 4.1.4) we experience some weird behavior when the online editor is used by an user that is not the owner of the file.
What happens is that the doc_$documentid folder is not populated with the files owner and fileid, thus making the occ documentserver:flush procedure stop with an error like:
It took a lot of time to debug and a (quick and dirty) workaround is provided below. I believe this should be fixed because it yields to documents which are persistently out-of-date on the filesystem and a constantly growing oc_documentserver_changes table in the database. Apologies for the long issue, but I would like to share the workaround with other users affected by this bug.
The workaround is to build a map between the documentid and the fileid, in order to do so we need the instance-id (from the config.php file) and the ETag for each affected file. The ETag is available in the oc_filecache table, where the fileid is also specified.
The owner might then be retrieved from the oc_share table (but there are no direct hits if a whole directory was shared and not the specific file, there are possibily other places where this information is available but I am not an expert in the nextcloud DB). But even if it's wrong, the saveChanges function is able to find the file anyway, hence the owner file may contain any user known to nextcloud.
The workaround we are using is to export all the files and etags with this query:
SELECT DISTINCTof.fileid, of.etag, of.path, os.uid_ownerFROM oc_filecache of
JOIN oc_share os ON (of.fileid=os.file_source)
INTO OUTFILE '/tmp/files.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';
then a very basic php script that mimics the procedures linked above is used:
Execute this php and save the output to a file (in my case /tmp/mappings.txt), then go the documenserver_community folder within your installation (the one containing lots of "doc_documentid" files) and do something like this:
ls |whileread dir;do grep $dir /tmp/mappings.txt;done
Now review the rows that are outputted to the console and - if you are fine with their content - execute them: the effect is to populate each directory with the two missing files.
Finally you will be able to execute occ documentserver:flush without issues.
The text was updated successfully, but these errors were encountered:
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.
Hi!
With up-to-date versions of nextcloud (18.0.2) and documentserver_community (0.1.5) (and onlyoffice app 4.1.4) we experience some weird behavior when the online editor is used by an user that is not the owner of the file.
What happens is that the
doc_$documentid
folder is not populated with the filesowner
andfileid
, thus making theocc documentserver:flush
procedure stop with an error like:It took a lot of time to debug and a (quick and dirty) workaround is provided below. I believe this should be fixed because it yields to documents which are persistently out-of-date on the filesystem and a constantly growing
oc_documentserver_changes
table in the database. Apologies for the long issue, but I would like to share the workaround with other users affected by this bug.The workaround is to build a map between the
documentid
and thefileid
, in order to do so we need theinstance-id
(from theconfig.php
file) and the ETag for each affected file. The ETag is available in theoc_filecache
table, where thefileid
is also specified.In order to reconstruct how to build the mapping, I observed that the
onlyoffice
app is able to return thedocumentid
from thefileid
(see controller/editorcontroller.php and documentservice.php )The
owner
might then be retrieved from theoc_share
table (but there are no direct hits if a whole directory was shared and not the specific file, there are possibily other places where this information is available but I am not an expert in the nextcloud DB). But even if it's wrong, the saveChanges function is able to find the file anyway, hence theowner
file may contain any user known to nextcloud.The workaround we are using is to export all the files and etags with this query:
then a very basic php script that mimics the procedures linked above is used:
Execute this php and save the output to a file (in my case
/tmp/mappings.txt
), then go thedocumenserver_community
folder within your installation (the one containing lots of "doc_documentid
" files) and do something like this:Now review the rows that are outputted to the console and - if you are fine with their content - execute them: the effect is to populate each directory with the two missing files.
Finally you will be able to execute
occ documentserver:flush
without issues.The text was updated successfully, but these errors were encountered: