webdav file recreation issue
Unable to delete a file then create a new file with the same name. Using davfs2 on CentOS.
cd /dav/site0/ mkdir home cd home echo "Hello World" > index.html cat index.html Hello World rm index.html rm: remove regular file `index.html'? y ll total 0 echo "Hello World Again" > index.html cat index.html cat: index.html: No such file or directory
In a related issue, deleting and recreating a folder with webdav can cause issues with push publishing:
Create a new host 'testhost' - ok
Mount webDAV - ok
Via webdav, create folder 'folder' with a file 'testfile' in it - ok cd ~/dotcms_webdav/testhost mkdir folder echo 1 > folder/testfile
Via admin interface, go to site browser, right-click on 'folder' and select 'edit folder' Look up the folder identity (for example, Identity: 4c11a94f-e737-4d40-9c21-3f97e3910cd7)
Push publish the testhost - ok
Check that testhost and folder are availabe on target dotCMS. Note that folder identifiy on target is the same (for example, Identity:4c11a94f-e737-4d40-9c21-3f97e3910cd7)
On a source dotCMS, via webdav, delete/create folder with testfile - ok rm -rf folder mkdir folder echo 2 > folder/testfile
On a source dotCMS, look up the new folder identity - it will be different from the first one (Identity:bc85cc9c-0b53-42cb-af0e-10527245e9fb)
Push publish the testhost - not ok
OK so a few things.
Webdav is archiving your stuff which is why you cannot recreate it. We need to get smarter here and I will mark this an an improvement to fix
But your push publish case is as expected. You created a new folder after deleting and trying to push it but it doesn't match. This is expected to break.
Again we can try to reuse the folder in push publish but getting a new identity is correct. We do not save them on delete. It is a new folder that will break on the receiving end.
We will fix this also but it is expected not to work currently
This issue has been automatically marked as stale because it has not had activity within the past 90 days. It will be closed in 30 days no further activity occurs. Thank you.