Score:0

"zip I/O error: Bad address" error during zipping process

im flag

I have a Samsung Galaxy S8 with The Olive Tree's WebDAV app called WebDAV Server Pro (https://play.google.com/store/apps/details?id=com.theolivetree.webdavserverpro) which I used to mount my Android's internal storage on ubuntu 23.04. Next, I connected the webdav server to ubuntu using

dav://10.0.0.132:8080 

10.0.0.132 is the server ip address auto assigned by the webdav app

I cd'd into the active directory:

cd "/run/user/1000/gvfs/dav:host=10.0.0.132,port=8080,ssl=false"

which is the root of the Android folder. Then I ran

find ./sdcard/DCIM/Camera -exec zip -0 -r "/home/username/Downloads/test.zip" {} +

It zipped some files but then ran into an error

zip I/O error: Bad address
zip error: Output file write failure (write error on zip file)

Why am I getting this error?

ghostanime2001 avatar
im flag
any suggestions for this?
ghostanime2001 avatar
im flag
Does anyone know how to deal with this error or why its occuring ?
cn flag
That invocation is going to annoy the ftp server, because you open and close the zip file for every file you add to it, so the file needs to be rewritten quite often. You can use the `-@` option to zip to read the file list from stdin, then pipe the find output into it directly: `find ./sdcard/DCIM/Camera | zip -0 /home/username/Downloads/test.zip`. Of course, since you're not filtering the list of names, a simple `zip -0 -r /home/username/Downloads/test.zip sdcard/DCIM/Camera` also works.
ghostanime2001 avatar
im flag
I am getting a zip error: Nothing to do! (/home/username/Downloads/test.zip) using the normal zip line also gives me zip I/O error: Bad address zip error: Output file write failure (write error on zip file)
cn flag
Sorry, forgot the `-@` at the end of that line. The single zip invocation should definitely work, apparently it cannot write to that output file. Can you create it with `touch /home/username/Downloads/test.zip` ?
ghostanime2001 avatar
im flag
''' find ./sdcard/DCIM/Camera | zip -0 /home/username/Downloads/test.zip -@ '''
ghostanime2001 avatar
im flag
` find ./sdcard/Snapchat | zip -0 /home/username/Documents/test.zip -@ ` using something like this failed again giving zip I/O error: Bad address zip error: Output file write failure (write error on zip file) The single zip line also fails returning the same error as above. doing the touch command creates a zip file but it reports an error when opening
cn flag
Yes, I believe that's not a zip problem, but simply that the output file is not accessible. Does `/home/username` actually exist, or have you copied verbatim from an example and missed the instruction to replace this with your actual home directory? What does `echo ~` output?
ghostanime2001 avatar
im flag
/home/username does exist but for privacy reasons only here I put username. Username is placeholder for my actual name. I've followed the instructions from before substituting username for my actual named directory on ubuntu system. If you must know echo ~ outputs bash: /home/azeem: Is a directory
cn flag
Ah good, just wanted to double-check that this wasn't something unrelated. I wonder why it gives "Is a directory" as an output -- it should only resolve the name in the shell and output the name of the directory, not try to open the directory itself.
ghostanime2001 avatar
im flag
I'm trying to figure out why there are so many bugs with this zip also doesn't work and now the output for this is also wonky..is there something else going on? on a deeper level ?
cn flag
Yes, that's my suspicion. The `zip` tool is rather straightforward in the way it does disk access -- new archives are written front to back, and opening accesses the end of the file first (the file index is kept there), so the only thing that's wonky over DAV is that opening the file requires it to be transferred completely first (few DAV clients do partial transfers).
ghostanime2001 avatar
im flag
You have a try with webdav server pro from the olive tree and try to connect your android and set your home folder to / then try the zip and find command together and see if you get any errors. I've found that .jpg files work for the most part but as soon as a .mp4 file is read or accessed from the dav client it fails. Which dav clients do partial transfer? Is webdav server app opening and transferring the entire zip file first before adding new files into it?
ghostanime2001 avatar
im flag
Does anyone have ideas to trace where the problem is occuring or any logs to see to diagnose this problem?
ghostanime2001 avatar
im flag
Any suggestions ? +1
Score:0
kp flag

This seems to be a problem with the software on your phone.

I would recommend using a local FTP server application (You can find them on the app store of your choice except for Galaxy Store because not a damn soul develops for Galaxy Store anymore) and transferring files that way. Using a USB cable always works wonders as well.

ghostanime2001 avatar
im flag
I've tried using a ftp server app like the same one from the olive tree, they have ftp server pro as well but what I found was that the date modified of the files/folders would be rounded to the nearest midnight hour at 12 AM or 1AM. Is there another app that functions like a ftp but has the right correct timestamps as in samsung my files app ?
ghostanime2001 avatar
im flag
what software is causing this problem ?
ghostanime2001 avatar
im flag
update: I just did the same command with my new pixel 7 device and it seems that it is zipping .mp4 files and .jpg files without any problems so far (it is zipping right now as we speak). So it seems to me that there is an actual problem on the s8 weather its conflicting apps or a software issue with android 9 which needs to be determined. Btw, in addition I have many ftp and smb and file manager apps installed including es explorer and Rs explorer. Maybe there is a conflict
Damian Garcia avatar
kp flag
@ghostanime2001 I am not sure. I am not experienced with The Olive Tree's software. I would recommend using a USB cable or microSD card to copy files from phone to computer, as middle-man software can interfere with timestamps, and cause all-around reliability issues with file transferring.
ghostanime2001 avatar
im flag
as a test drive, can you please try webdav server from the olive tree on your android phone if you have one and try it with the find and zip command above to see if you encounter any errors so that I know it's not just an isolated problem ? (if you wish to)
ghostanime2001 avatar
im flag
have you tried it yet ?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.