LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 05-24-2023, 07:37 PM   #1
anmac1789
Member
 
Registered: May 2023
Posts: 43

Rep: Reputation: 0
Why using find and zip gives zip I/O error?


Hello, I am using a webdav server pro from the olive tree to mount my galaxy s8's internal storage. When I try to zip a folder using this command
Code:
find ."/sdcard/DCIM/Camera" -exec zip -0 -r "/home/ubuntu/Documents/test.zip" {} +
I receive an error saying

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

please see the attachment

Why?
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2023-05-24 20-33-57.png
Views:	38
Size:	169.3 KB
ID:	41103  
 
Old 05-25-2023, 12:20 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
I guess it is a disk full or something similar. Or probably a permission issue.
 
Old 05-25-2023, 12:31 AM   #3
lvm_
Member
 
Registered: Jul 2020
Posts: 983

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
This could be caused by insufficient space on /tmp, try issuing 'export TMPDIR=<directory with lots of space>' before running this command or use tar since you are storing anyway.
 
Old 05-25-2023, 12:42 AM   #4
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
how do I change permission or change the storage space of /tmp ? is this done in terminal ?

Last edited by anmac1789; 05-25-2023 at 03:04 AM.
 
Old 05-25-2023, 08:11 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,753

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by anmac1789 View Post
Hello, I am using a webdav server pro from the olive tree to mount my galaxy s8's internal storage. When I try to zip a folder using this command
Code:
find ."/sdcard/DCIM/Camera" -exec zip -0 -r "/home/ubuntu/Documents/test.zip" {} +
I receive an error saying

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

please see the attachment Why?
Could also be that the device is mounted read-only, or a permissions issue (as noted by others). But I'd also examine the command-line you're using...the find command is only going to find you a folder called Camera...and if you know you want to zip EVERYTHING from that folder, why bother with a find (since you know the location)? Why not just type in
Code:
zip -r /home/ubuntu/Documents/test.zip /sdcard/DCIM/Camera/*
 
Old 05-25-2023, 08:43 AM   #6
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
Could also be that the device is mounted read-only, or a permissions issue (as noted by others). But I'd also examine the command-line you're using...the find command is only going to find you a folder called Camera...and if you know you want to zip EVERYTHING from that folder, why bother with a find (since you know the location)? Why not just type in
Code:
zip -r /home/ubuntu/Documents/test.zip /sdcard/DCIM/Camera/*
Using zip also fails and gives me the same error hence this os why i want to know why it fails — for both find and zip
I can copy files to and from the android device when its mounted as a network webdav share because i already tested it with a small sample file. How can i change the permissions and for which file or folder specifically ? os it a global permissions issue on a vm ?
 
Old 05-25-2023, 09:31 AM   #7
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
Could also be that the device is mounted read-only, or a permissions issue (as noted by others). But I'd also examine the command-line you're using...the find command is only going to find you a folder called Camera...and if you know you want to zip EVERYTHING from that folder, why bother with a find (since you know the location)? Why not just type in
Code:
zip -r /home/ubuntu/Documents/test.zip /sdcard/DCIM/Camera/*
I try to see how much the temporary folder is being used using this command
Code:
df -h /tmp
please see the attachment
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2023-05-25 10-29-20.png
Views:	22
Size:	29.8 KB
ID:	41104  
 
Old 05-25-2023, 10:18 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
you ought to run that df when the error occurred, which is impossible. You might try strace -o /tmp/strace.out -f zip .....
and check /tmp/strace.out to see what call caused that i/o error.
 
Old 05-25-2023, 12:25 PM   #9
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
you ought to run that df when the error occurred, which is impossible. You might try strace -o /tmp/strace.out -f zip .....
and check /tmp/strace.out to see what call caused that i/o error.
Here is the log


13477 execve("/usr/bin/zip", ["zip"], 0x7fff7709c8a8 /* 47 vars */) = 0
13477 brk(NULL) = 0x557535810000
13477 arch_prctl(0x3001 /* ARCH_??? */, 0x7fff4e0e0a20) = -1 EINVAL (Invalid argument)
13477 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd966b3c000
13477 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
13477 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
13477 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=61257, ...}, AT_EMPTY_PATH) = 0
13477 mmap(NULL, 61257, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fd966af2000
13477 close(3) = 0
13477 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libbz2.so.1.0", O_RDONLY|O_CLOEXEC) = 3
13477 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
13477 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=74848, ...}, AT_EMPTY_PATH) = 0
13477 mmap(NULL, 76840, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fd966ada000
13477 mmap(0x7fd966adc000, 53248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fd966adc000
13477 mmap(0x7fd966ae9000, 8192, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7fd966ae9000
13477 mmap(0x7fd966aeb000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x7fd966aeb000
13477 close(3) = 0
13477 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
13477 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P<\2\0\0\0\0\0"..., 832) = 832
13477 pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
13477 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=2072888, ...}, AT_EMPTY_PATH) = 0
13477 pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
13477 mmap(NULL, 2117488, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fd966800000
13477 mmap(0x7fd966822000, 1540096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7fd966822000
13477 mmap(0x7fd96699a000, 360448, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19a000) = 0x7fd96699a000
13477 mmap(0x7fd9669f2000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f1000) = 0x7fd9669f2000
13477 mmap(0x7fd9669f8000, 53104, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fd9669f8000
13477 close(3) = 0
13477 mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd966b39000
13477 arch_prctl(ARCH_SET_FS, 0x7fd966b39740) = 0
13477 set_tid_address(0x7fd966b39a10) = 13477
13477 set_robust_list(0x7fd966b39a20, 24) = 0
13477 rseq(0x7fd966b3a060, 0x20, 0, 0x53053053) = 0
13477 mprotect(0x7fd9669f2000, 16384, PROT_READ) = 0
13477 mprotect(0x7fd966aeb000, 4096, PROT_READ) = 0
13477 mprotect(0x5575355f3000, 12288, PROT_READ) = 0
13477 mprotect(0x7fd966b35000, 8192, PROT_READ) = 0
13477 prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
13477 munmap(0x7fd966af2000, 61257) = 0
13477 getrandom("\x4f\xb1\x64\x17\x11\xda\x17\x08", 8, GRND_NONBLOCK) = 8
13477 brk(NULL) = 0x557535810000
13477 brk(0x557535831000) = 0x557535831000
13477 openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
13477 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=14588416, ...}, AT_EMPTY_PATH) = 0
13477 mmap(NULL, 14588416, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fd965a00000
13477 close(3) = 0
13477 openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = 3
13477 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=3494, ...}, AT_EMPTY_PATH) = 0
13477 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=3494, ...}, AT_EMPTY_PATH) = 0
13477 read(3, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0\5\0\0\0\0"..., 4096) = 3494
13477 lseek(3, -2225, SEEK_CUR) = 1269
13477 read(3, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0\5\0\0\0\0"..., 4096) = 2225
13477 close(3) = 0
13477 ioctl(1, TCGETS, {c_iflag=ICRNL|IXON|IUTF8, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lflag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
13477 newfstatat(1, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}, AT_EMPTY_PATH) = 0
13477 write(1, "Copyright (c) 1990-2008 Info-ZIP"..., 73) = 73
13477 write(1, "Zip 3.0 (July 5th 2008). Usage:\n", 32) = 32
13477 write(1, "zip [-options] [-b path] [-t mmd"..., 79) = 79
13477 write(1, " The default action is to add o"..., 75) = 75
13477 write(1, " can include the special name -"..., 61) = 61
13477 write(1, " If zipfile and list are omitte"..., 67) = 67
13477 write(1, " -f freshen: only changed fil"..., 75) = 75
13477 write(1, " -d delete entries in zipfile"..., 77) = 77
13477 write(1, " -r recurse into directories "..., 77) = 77
13477 write(1, " -0 store only "..., 79) = 79
13477 write(1, " -1 compress faster "..., 57) = 57
13477 write(1, " -q quiet operation "..., 78) = 78
13477 write(1, " -c add one-line comments "..., 61) = 61
13477 write(1, " -@ read names from stdin "..., 77) = 77
13477 write(1, " -x exclude the following nam"..., 74) = 74
13477 write(1, " -F fix zipfile (-FF try hard"..., 70) = 70
13477 write(1, " -A adjust self-extracting ex"..., 72) = 72
13477 write(1, " -T test zipfile integrity "..., 71) = 71
13477 write(1, " -y store symbolic links as t"..., 71) = 71
13477 write(1, " -e encrypt "..., 71) = 71
13477 write(1, " -h2 show more help\n", 22) = 22
13477 write(1, " \n", 3) = 3
13477 exit_group(0) = ?
13477 +++ exited with 0 +++


please see the attachment. Even when using -type d switch, find still tried zipping a file instead of just the folder. Something seems broken. I've also added myself to the vboxsf users group. I'm not sure what the 992 means. Is there a higher level of permissions than 992 ?

df -h /tmp gives me:
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 99G 34G 61G 36% /

since I've increased virtualbox total hdd space from 50 GB to 100 GB
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2023-05-25 13-26-09.png
Views:	9
Size:	180.0 KB
ID:	41105   Click image for larger version

Name:	Screenshot from 2023-05-25 13-34-06.png
Views:	7
Size:	113.6 KB
ID:	41106  

Last edited by anmac1789; 05-25-2023 at 12:37 PM.
 
Old 05-25-2023, 11:49 PM   #10
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
I can't find any error in that strace log.
 
Old 05-26-2023, 12:49 AM   #11
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
I can't find any error in that strace log.
Can you try from your end using your virtual machine and see if it works for you. I know there is something wrong but I dont have deep knowledge about linux. How can I diagnose when and where this error is occuring and how do I properly use strace for this instance? Maybe instead of a virtualisation it needs a proper linux install on a seperate hard drive to use the find command? Funny thing is, I installed linux mint on vmware and tried the same thing, I am still getting the same type of error

Last edited by anmac1789; 05-26-2023 at 01:13 AM.
 
Old 05-26-2023, 01:28 AM   #12
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
No, I can't reproduce it. But you need to execute the full command, like this:
Code:
strace -o /tmp/strace.out -f zip -r /home/ubuntu/Documents/test.zip /sdcard/DCIM/Camera/*
                             ============================================================  << this is the original zip command
And you need to check the file strace.out, and look for i/o error inside. Do not post the full file here, that will be huge.
 
Old 05-26-2023, 02:10 AM   #13
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
No, I can't reproduce it. But you need to execute the full command, like this:
Code:
strace -o /tmp/strace.out -f zip -r /home/ubuntu/Documents/test.zip /sdcard/DCIM/Camera/*
                             ============================================================  << this is the original zip command
And you need to check the file strace.out, and look for i/o error inside. Do not post the full file here, that will be huge.
Are you saying that you don't get any error or that you don't want to try it ? lol..
 
Old 05-26-2023, 02:17 AM   #14
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
To be able to reproduce it I need to recreate your environment, and 1. I don't know it, 2. I have no virtualbox.
But anyway, it is quite obvious something is incorrect in your setup and I have no any chance to [re]produce the same situation without knowing it.
 
Old 05-26-2023, 02:35 AM   #15
anmac1789
Member
 
Registered: May 2023
Posts: 43

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
To be able to reproduce it I need to recreate your environment, and 1. I don't know it, 2. I have no virtualbox.
But anyway, it is quite obvious something is incorrect in your setup and I have no any chance to [re]produce the same situation without knowing it.
Well for one thing, if you'd like to know my setup is done with ubuntu 23.04 on virtualbox with basic settings and using webdav server (https://play.google.com/store/apps/d...hl=en_US&gl=US) and then setting the home directory on the app to the root. Then on ubuntu vm --> other locations and using the ip address that's displayed on the app to set up a webdav connection. For me on the app it says

WebDAV server available on:
http://10.0.0.132:8080

Home directory: /
Password disabled

on ubuntu I connected the android phone with dav://10.0.0.132:8080 and opened the root folder with "open in terminal"

Another possibility is if you'd like to set up a microsoft teams meeting with me and see it that way which is alot faster.

Btw, which working directory am I supposed to be in to execute this command

strace -o /tmp/strace.out -f zip -r -0 /home/azeem/Documents/example.zip /sdcard/DCIM/Camera/*

Maybe this will help:

Code:
"b\224\202)\216\304z\34\240/\261\323\244ye\17\31\201\277]\221\206\244U\19k>Y\332\271\316"..., 16384) = 16384
5539  write(3, "\n\376\376\265\262P,5\1\226\243\266\211\263\236\246\216\315\321\307\215G\343\307\353c;M\312:-\210"..., 16384) = 16384
5539  read(4, "\341\235V\5aFi\332\256\356\245R\231DM\351hI\20\31\4\r\334\357\213\323\207\241\315\224M8"..., 16384) = 16384
5539  write(3, "\210\21\216\345\335\31\266\355\3e\4L6\26q%\2179\225\232\22\220<\262\330\323\264\241M4\34\205"..., 16384) = 16384
5539  read(4, "qJ\353\204\231\362Dp!\234\221S\357\21y\2235S\2012m\336\367\276us\334\2218(\6\270"..., 16384) = 16384
5539  write(3, "\310\263\215\303\340P\247\242\313)bX\335\324\2\23[\0230\t\301UOG\32\346CG\0\204\3K"..., 16384) = 16384
5539  read(4, "\0\0\0\30ftypmp42\0\0\0\0isommp42\1\257P<mdat"..., 16384) = 16384
5539  write(3, "\337\307\222@\310\f\252\224:)\21\233\343l\327\206w$\323\355I\35\t!l\6\260\267\331\257 \374"..., 16384) = 16384
5539  read(4, 0x556c57299e80, 16384)    = -1 EIO (Input/output error)
5539  write(3, "J\266\352Nm\264+;)\261\331+\266%M\205D\323eS#\304\6\0015\370.i}a\275\210"..., 16384) = 16384
5539  write(3, "J\266\352Nm\264+;)\261\331+\266%M\205D\323eS#\304\6\0015\370.i}a\275\210"..., 4294950912) = 66009
5539  write(3, 0x556c572ae000, 4294884903) = -1 EFAULT (Bad address)
5539  write(1, "\n", 1)                 = 1
5539  write(1, "zip I/O error: Bad address", 26) = 26
5539  write(1, "\nzip error: Output file write fa"..., 64) = 64
5539  close(3)                          = 0
5539  unlink("/home/azeem/Documents/zietQlV3") = 0
5539  exit_group(14)                    = ?
5539  +++ exited with 14 +++
I am attaching a google drive link to the strace file https://drive.google.com/file/d/1VAH...ew?usp=sharing

Last edited by anmac1789; 05-26-2023 at 03:12 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can I have zip -d file.zip "__MACOSX*" work on all zip files in directory? thomwblair Linux - Newbie 10 10-08-2018 02:30 PM
Cannot zip a mutli-part archive, zip -FF command failing with out of memory error sanchit.sharma Linux - Newbie 8 05-21-2018 06:47 AM
Using zip to zip the contents of a directory to another? Paradigm6790 Linux - Newbie 2 07-25-2012 11:51 AM
How to find out a file in a WAR which in a zip without unzip the zip-file? thomas2004ch Linux - Software 3 09-30-2011 03:06 PM
Zip gives error "-bash: /usr/bin/zip: Argument list too long" konathamsrinu Programming 3 07-06-2006 10:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 02:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration