I am using webdav server pro from the Olive tree to connect my galaxy s8 to Ubuntu 24.04.2 as a webdav connection. I want to backup a particular folder as a zip file using this command:
I contacted the maintainers of info-zip and they said that info-zip is largely unchanged from 2008-2009 therefore the culprit could be webdav built into ubuntu. Can anyone help me shed some light on what changes webdav has gone through or why itâs failing?
It seems you are facing this problem since at least 2023. A user on askubuntu (maybe thatâs you too?) concluded itâs an issue with Samsung Galaxy S8.
Maybe (security) bugs in webdav implementation have been closed and interfere with file transfer on this old device. Maybe an Update to Android on the phone broke something. Maybe the phone is locking internal storage after a while and blocking access âŠ
Does the same procedure work with other phones based on Android?
I will try with a pixel 9 pro as well as another samsung phone
I dont think that android is the culprit since in that askubuntu forum post, ubuntu 20.04 webdav worked but not newer versions. I showed that any ubuntu distro including mint and zorin after 20.04 did not work so the configuration files or anything related to webdav implementation has changed. Im trying to piece together what has changed.
[edit] Okay so I tested with a samsung galaxy A70, and I got the same issues
What exit code do you get from zip ? You can find out by running âecho $?â after zip fails. The meanings of the codes are listed in the manual page for zip in the section âDIAGNOSTICSâ towards the end of the page. Iâm asking because the error message looks more like it has problems writing the archive than with reading from webdav.
Also, Iâd drop the âfindâ. âfind âdirectoryâ -maxdepth 0â always returns only the given directory, so itâs not useful. Just do 'zip -r -0 -v â~/Documents/test.zipâ â/run/user/1000/gvfs/dav:host=192.168.1.103,port=8080,ssl=false/sdcard/Downloadâ
In terms of the find command, I use it like that so I can combine it with zip -r because find by default does recursive search unless I use -maxdepth 0
using without find command and only zip command
zip -r -0 -v "/home/ubuntuvm/Documents/test.zip" sdcard
So does âzip -râ, so even if you donât use the maxdepth option âfindâ is completely useless here.
And it hides the error from zip, find returns an exit code of â0â - which always means success (and itâs right, âfindâ did what itâs supposed to do âŠ). If you ran the zip directly instead of calling it from zip youâd get some other code which might give us some insight into whatâs going on.
So I got error code 14. I didnât do the entire sdcard folder (even though I donât have an sdcard inserted into the galaxy A70) because it would take forever, so I just tried to zip the sdcard/DCIM folder since this is the most important folder to backup
So unless itâs writing some temporary file to the directory where the source files are this should not have anything to do with webdav.
You could try again with the -b or --temp-path option to zip to explicitly tell it where to put temporary files, e.g. âzip -r -0 -v --temp-path /tmp/ â~/Documents/test.zipâ â/run/user/1000/gvfs/dav:host=192.168.1.103,port=8080,ssl=false/sdcard/Downloadââ
Alternatively you could try some other program instead of zip, e.g. tar or - if you need zip-files - 7z with the option â-tzipâ (this makes 7z create zip files instead of 7z files).
zip creates a random character temporary file in the same folder as the zip archive is being created. Iâm assuming either zip or webdav has problems saving or closing the temporary file
Iâve tried the --temp-path /tmp/ option for zip and I got the same error.
On the one hand both programs produce write errors - which should not have anything to do with gvfs and / or webdav, but on the other hand I canât think of anything else both have in common, assuming itâs not some kind of problem with the file system your $HOME is on (when was the last time you did an fsck on that ?).
Does it work If you just copy everything first and zip it up locally ?
The file system is perfectly fine, the VMâs are installed on a internal ssd with no OS installed on it, so itâs just used as a storage. Also, I re-did the test on ubuntu 20.04, both zip and 7zip completed sucsessfully somehow, but not in the new ubuntu 24.04. THAT is very strange to me. This is why I suggested that there is something broken with gvfs or webdav. For additional information, I just did a random sudo apt install gvfs in both versions, and I found that gvfs is version 1.44 in ubuntu 20.04 and 1.54 in ubuntu 24.04. Does this shed any clue ?
I have both ubuntu 24.04 and Ubuntu 20.04 virtual machines in vmware for comparison.
How can I do a fsck ?
There are no issues with copy and pasting from WebDAV mounted folder into local directory then zipping it. Errors mainly occur from the gvfs it seems or when closing the temporary zip file
The changes that occurred between the older version & newer version will be listed there (in summary format anyway). There will be a lot of changes, as 20.04 to 24.04 is a total of 8 Ubuntu releases.
Didnât you say this happens with all your tested linux not only Ubuntu? And I doubt itâs something in gvfs / webdav implementation.
I guess there is something happening with the input stream to zip which zip doesnât recognise as such and instead reports an output error.
Just found another one of your postings (fedora) on this issue. You obviously nailed it already to be an issue with your Samsung Galaxy S8 but just donât accept it. Why?
Did you try reporting this to Samsung? What did they say?
thatâs correct and the same issue persists same like another samsung phone.
I guess I should rephrase, it happens with ubuntu and ubuntu based distroâs as well (or more broadly debian)
so what do you think it may be ? nothing else comes to my mind, something has to cause thisâŠ
Iâve contacted someone from Info-zip using their mailing address and weâve narrowed down the possibilities to either webdav or gvfs itself, Iâve even given over 80 messages of email chain with screenshots proving the same copy operations donât work after ubuntu 20.04, whereas in ubuntu 20.04 it all worked, even with 7zip and the normal zip, so the conclusion seems pretty clear to me.
Actually the issue wasnt the galaxy s8 afterall, if you read alot further down, the issue is still unresolved and a few more posts up concludes that the problem is with ubuntu versions greater than 20.04.
Samsung wasnât the issue, the issue was something with zip, gfvs or webdav mount in linux
In the end, the process to find what exactly has changed and how to fix or identify the problem continues
No. The fact that it is working with other phones (there is nothing to read that excludes an issue with Galaxy S8) points to Samsungâs Android implementation and / or the server implementation of webdav on Android.
You even proved that itâs likely an issue with olive treeâs webdav server implementation in Android yourself (!), maybe in conjunction with Samsungâs Android implementation. You tested with another webdav server on your phone and it worked âŠ
I said its working with phones under ubuntu 20.04, not ubuntu 24.04. Fv file manage doesnât work actually, I verified it just now. FV file manager mounted as webav in ubuntu displays incorrect file/folder size along with timestamps from whatâs shown on the android device itself.
I doubt it because when I tried webdav server pro, it shows all the file and folder information correctly so itâs not the s8 or the app, but I do think itâs something in linux thatâs not properly configured or overlooked