upa / mscp

mscp: transfer files over multiple SSH (SFTP) connections
GNU General Public License v3.0
128 stars 13 forks source link

Host runs out of memory resulting in mscp being killed #8

Closed ayushbindlish closed 9 months ago

ayushbindlish commented 9 months ago

System configuration:

NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

MSCP stack trace:

execve("/usr/local/bin/mscp", ["mscp", "-n", "1", "-i", "test.pem", "/localcache/", "ubuntu@172.31.1.70:/tmp/stash"], 0x7fffe1f95470 /* 13 vars */) = 0
mmap(NULL, 680, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f901349a000
arch_prctl(ARCH_SET_FS, 0x7f901349a1e0) = 0
set_tid_address(0x6dc2f0)               = 1265
brk(NULL)                               = 0x11ee000
brk(0x11f0000)                          = 0x11f0000
mmap(0x11ee000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x11ee000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013499000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013498000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013497000
pipe([3, 4])                            = 0
mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013493000
fcntl(4, F_GETFL)                       = 0x1 (flags O_WRONLY)
fcntl(4, F_SETFL, O_WRONLY|O_APPEND)    = 0
ioctl(4, TIOCGWINSZ, 0x7ffd178d4828)    = -1 ENOTTY (Inappropriate ioctl for device)
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013492000
getuid()                                = 0
open("/etc/passwd", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 5
fcntl(5, F_SETFD, FD_CLOEXEC)           = 0
fcntl(5, F_SETFD, FD_CLOEXEC)           = 0
read(5, "root:x:0:0:root:/root:/bin/bash\n"..., 1024) = 1024
lseek(5, -992, SEEK_CUR)                = 32
close(5)                                = 0
open("/root/.ssh/config", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/etc/ssh/ssh_config", O_RDONLY|O_LARGEFILE) = 5
read(5, "\n# This is the ssh client system"..., 1024) = 1024
open("/etc/ssh/ssh_config.d/*.conf", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
read(5, "#   AddressFamily any\n#   Connec"..., 1024) = 579
read(5, "", 1024)                       = 0
close(5)                                = 0
socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) = 5
fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 0
setsockopt(5, SOL_TCP, TCP_NODELAY, [1], 4) = 0
connect(5, {sa_family=AF_INET, sin_port=htons(22), sin_addr=inet_addr("172.31.1.70")}, 16) = -1 EINPROGRESS (Operation now in progress)
poll([{fd=5, events=POLLIN|POLLOUT}], 1, 10000) = 1 ([{fd=5, revents=POLLOUT}])
fcntl(5, F_SETFL, O_RDONLY|O_LARGEFILE) = 0
sendto(5, "SSH-2.0-libssh_0.10.4\r\n", 23, MSG_NOSIGNAL, NULL, 0) = 23
poll([{fd=5, events=POLLIN|POLLOUT}], 1, 9999) = 1 ([{fd=5, revents=POLLOUT}])
poll([{fd=5, events=POLLIN}], 1, 9999)  = 1 ([{fd=5, revents=POLLIN}])
mmap(NULL, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f901348b000
recvfrom(5, "SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ub"..., 4096, 0, NULL, NULL) = 41
getpid()                                = 1265
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f901348a000
getrandom("\xb1\x94\x4d\x01\xc4\x57\x2d\x8f\x46\xd9\x97\x3e\x5e\x6d\x5d\xbf\x94\x2a\xb9\x55\x14\x91\x6f\xb8\xb9\x02\x1d\x2d\xef\xa7\xc8\x6c", 32, 0) = 32
getpid()                                = 1265
getpid()                                = 1265
getpid()                                = 1265
getpid()                                = 1265
getpid()                                = 1265
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013489000
open("/root/.ssh/known_hosts", O_RDONLY|O_LARGEFILE) = 6
read(6, "172.31.1.70 ssh-ed25519 AAAAC3Nz"..., 1024) = 93
read(6, "", 1024)                       = 0
close(6)                                = 0
open("/etc/ssh/ssh_known_hosts", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013488000
sendto(5, "\0\0\3T\7\24L3\24\272[{\237w\224i]\215\5\364\216\33\0\0\0\361curve2"..., 856, MSG_NOSIGNAL, NULL, 0) = 856
poll([{fd=5, events=POLLIN|POLLOUT}], 1, 9982) = 1 ([{fd=5, revents=POLLIN|POLLOUT}])
recvfrom(5, "\0\0\4\34\n\24>\3310\377\2745\313\354\272+\217\261\270\316\35\246\0\0\0\346curve2"..., 4096, 0, NULL, NULL) = 1056
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013486000
getpid()                                = 1265
getpid()                                = 1265
sendto(5, "\0\0\0,\6\36\0\0\0 \35\1\354\213\16deA-og\240D(\375T\307\274\311\210\350\207"..., 48, MSG_NOSIGNAL, NULL, 0) = 48
poll([{fd=5, events=POLLIN|POLLOUT}], 1, 9978) = 1 ([{fd=5, revents=POLLOUT}])
poll([{fd=5, events=POLLIN}], 1, 9977)  = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "\0\0\0\274\10\37\0\0\0003\0\0\0\vssh-ed25519\0\0\0 \372i\367"..., 4096, 0, NULL, NULL) = 436
sendto(5, "\0\0\0\f\n\25\0\0\0\0\0\0\0\0\0\0", 16, MSG_NOSIGNAL, NULL, 0) = 16
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013485000
munmap(0x7f9013485000, 4096)            = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013485000
munmap(0x7f9013485000, 4096)            = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013485000
munmap(0x7f9013485000, 4096)            = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013485000
munmap(0x7f9013485000, 4096)            = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013485000
munmap(0x7f9013485000, 4096)            = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013485000
munmap(0x7f9013485000, 4096)            = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013485000
munmap(0x7f9013485000, 4096)            = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013485000
munmap(0x7f9013485000, 4096)            = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013485000
munmap(0x7f9013485000, 4096)            = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013485000
munmap(0x7f9013485000, 4096)            = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013485000
getpid()                                = 1265
getpid()                                = 1265
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
sendto(5, "#\f(\277\23\23J\25^%\277\212\331)M\5\361{\312\311\31\6*Mg]\300\211\251\230^\230"..., 44, MSG_NOSIGNAL, NULL, 0) = 44
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLIN|POLLOUT}])
recvfrom(5, "\300~\315(\341i\257\250\v\253\215cO[K\2200\345kZ\210:8\371/\305\263\tGMN<"..., 4096, 0, NULL, NULL) = 44
getpid()                                = 1265
getpid()                                = 1265
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013484000
munmap(0x7f9013484000, 4096)            = 0
sendto(5, "\325\202v\257,i \303\346\240v\25\336\363\n\245A\347\r85\345\257$\205\204\320\21)\344\277\246"..., 68, MSG_NOSIGNAL, NULL, 0) = 68
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
poll([{fd=5, events=POLLIN}], 1, -1)    = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "hn\17\246\213>\342Hcx'\220\315\205\373j(\314r$\216g\346_\212\377!\308\317/a"..., 4096, 0, NULL, NULL) = 44
open("test.pem.pub", O_RDONLY|O_LARGEFILE) = 6
fstat(6, {st_mode=S_IFREG|0664, st_size=404, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013484000
readv(6, [{iov_base="ssh-rsa AAAAB3NzaC1yc2EAAAADAQAB"..., iov_len=403}, {iov_base="\n", iov_len=1024}], 2) = 404
close(6)                                = 0
getpid()                                = 1265
getpid()                                = 1265
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013483000
munmap(0x7f9013483000, 4096)            = 0
sendto(5, "\n\332\313i|\216g\317\17\222\250\231\354\305RHO\350:8\264\312F\376\351.\320e\313\253%\336"..., 372, MSG_NOSIGNAL, NULL, 0) = 372
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
poll([{fd=5, events=POLLIN}], 1, -1)    = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "\321\264\262\273B\36o\377\343\263\206\211\207\314Z\341\200\\\3308\251r\212\313E\10v\206\354\245\10\200"..., 4096, 0, NULL, NULL) = 332
open("test.pem", O_RDONLY|O_LARGEFILE)  = 6
fstat(6, {st_mode=S_IFREG|0600, st_size=1679, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013483000
readv(6, [{iov_base="-----BEGIN RSA PRIVATE KEY-----\n"..., iov_len=1678}, {iov_base="\n", iov_len=1024}], 2) = 1679
close(6)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013482000
munmap(0x7f9013482000, 4096)            = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013482000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013480000
getpid()                                = 1265
getpid()                                = 1265
getpid()                                = 1265
getpid()                                = 1265
getpid()                                = 1265
getpid()                                = 1265
sendto(5, "#*\234?Q\377\206<\347\16`\346]\256Q\3143\247\202L\306]\315(M\3731\224\261#\362+"..., 652, MSG_NOSIGNAL, NULL, 0) = 652
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
poll([{fd=5, events=POLLIN}], 1, -1)    = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "\253Yf\34\211\204\273\240\6\rW\2719\311\275\277\337\323\203\345q\23\340^\372\1w@", 4096, 0, NULL, NULL) = 28
open("/root/.ssh/known_hosts", O_RDONLY|O_LARGEFILE) = 6
read(6, "172.31.1.70 ssh-ed25519 AAAAC3Nz"..., 1024) = 93
read(6, "", 1024)                       = 0
close(6)                                = 0
getpid()                                = 1265
getpid()                                = 1265
sendto(5, "^\236{Ji;>\323Ztc\246\215\225\27\240\300]X\247k\265\267\5\253\242\315\371\364\255\3074"..., 52, MSG_NOSIGNAL, NULL, 0) = 52
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
poll([{fd=5, events=POLLIN}], 1, -1)    = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "\266\311\316\30iJ^!Q0Ci}\211\366\"J\247y\254\204\264;3\357\r\27\252\236Zm0"..., 4096, 0, NULL, NULL) = 776
getpid()                                = 1265
getpid()                                = 1265
sendto(5, "L\"\214\250m\346\34\331\232\373Ts\264\6?\v\367\177w\363\377)\233\340Z\364\376\370\2006\3544"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
poll([{fd=5, events=POLLIN}], 1, -1)    = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "\353\225p\367\317\327\250\371w\340}\266G\300\222\6h|8,~\313-\270`-\341Ki=I\0"..., 4096, 0, NULL, NULL) = 192
getpid()                                = 1265
getpid()                                = 1265
sendto(5, "1o\263\244\356\36\376\275\336\363\36\326\2\232\317\301\177\374\305z\276\22Xgg\376\256k\323m \373"..., 52, MSG_NOSIGNAL, NULL, 0) = 52
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
poll([{fd=5, events=POLLIN}], 1, -1)    = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "Q\340\340\363\303#\364:~\213\216\222A\23vUUl-\16g_\231\333\23^\25\t%\210\21\204"..., 4096, 0, NULL, NULL) = 72
getpid()                                = 1265
getpid()                                = 1265
sendto(5, "`\37~Y\326\313\252\\{7\200\327\1\344\223\215\312p\"\256\365\5\321K\216\335ve\362S#\4"..., 44, MSG_NOSIGNAL, NULL, 0) = 44
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
poll([{fd=5, events=POLLIN}], 1, -1)    = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "&]>\356.1@\305\320\335\313\23\355\204\255\356%Ny\345$yTq\340\200\256 P\335\325W"..., 4096, 0, NULL, NULL) = 220
getpid()                                = 1265
getpid()                                = 1265
sendto(5, "\232F\375\361k\274u\265\223\256\275*\17\267&\231%\270\333\323;\rKy\367\206%\fC\373\360B"..., 36, MSG_NOSIGNAL, NULL, 0) = 36
rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 8) = 0
mmap(NULL, 143360, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f901345d000
mprotect(0x7f901345f000, 135168, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 8) = 0
clone(child_stack=0x7f901347f928, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|0x400000, parent_tid=[1287], tls=0x7f901347fb30, child_tidptr=0x6dc2f0) = 1287
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({tv_sec=0, tv_nsec=100000}, 0x7ffd178d4880) = 0
nanosleep({tv_sec=0, tv_nsec=100000}, 0x7ffd178d4880) = 0
nanosleep({tv_sec=0, tv_nsec=100000}, 0x7ffd178d4880) = 0
nanosleep({tv_sec=0, tv_nsec=100000}, 0x7ffd178d4880) = 0
nanosleep({tv_sec=0, tv_nsec=100000}, 0x7ffd178d4880) = 0
nanosleep({tv_sec=0, tv_nsec=100000}, 0x7ffd178d4880) = 0
nanosleep({tv_sec=0, tv_nsec=100000}, 0x7ffd178d4880) = 0
nanosleep({tv_sec=0, tv_nsec=100000}, 0x7ffd178d4880) = 0
mmap(NULL, 143360, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f901343a000
mprotect(0x7f901343c000, 135168, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 8) = 0
clone(child_stack=0x7f901345c928, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|0x400000, parent_tid=[1288], tls=0x7f901345cb30, child_tidptr=0x6dc2f0) = 1288
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigaction(SIGINT, {sa_handler=0x402a40, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x5ea1ae}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
mmap(NULL, 143360, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9013417000
mprotect(0x7f9013419000, 135168, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 8) = 0
clone(child_stack=0x7f9013439928, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|0x400000, parent_tid=[1289], tls=0x7f9013439b30, child_tidptr=0x6dc2f0) = 1289
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
futex(0x7f901347fb68, FUTEX_WAIT_PRIVATE, 2, NULL) = ?
+++ killed by SIGKILL +++
upa commented 9 months ago

Hi,

Could you please show the output of mscp with -vvv option and the output of ls -l /localcache/** to investigate the issue.

ayushbindlish commented 9 months ago

@upa This is just before the kill: image

 ls -l /localcache/**
-rw-r--r-- 1 root root     0 Dec 11 11:27 /localcache/245ceadc-de14-43dd-856c-cdf2b13c41b4.aux
-rw-r--r-- 1 root root     0 Dec 11 11:27 /localcache/245ceadc-de14-43dd-856c-cdf2b13c41b4.value
-rw-r--r-- 1 root root     0 Dec 11 11:27 /localcache/8efbfc36-40e6-47c2-9b4a-57b95171bcb4.aux
-rw-r--r-- 1 root root     0 Dec 11 11:27 /localcache/8efbfc36-40e6-47c2-9b4a-57b95171bcb4.value
-rw-r--r-- 1 root root 20480 Dec 11 11:27 /localcache/cache.db
-rw-r--r-- 1 root root    33 Dec 28 08:44 /localcache/dovertestbucket.md5sum
-rw-r--r-- 1 root root     0 Dec 11 06:06 /localcache/nvme_stash

/localcache/dovertestbucket:
total 4
drwxr-xr-x 56 root root 4096 Dec 20 11:40 atlassian

mscp_verbose.log.tar.gz

Also, another observation is that if the directory already exists at the destination, it messes up the location.

This is the command I used: mscp -vvv -i test.pem /localcache/ ubuntu@34.200.244.87:/tmp/stash |tee mscp_verbose.log

On the second run it created ocalcache dir on remote host:

 ls -lart ./**
-rw-r--r-- 1 ubuntu ubuntu    0 Jan  9 20:17 ./245ceadc-de14-43dd-856c-cdf2b13c41b4.aux
-rw-r--r-- 1 ubuntu ubuntu   33 Jan  9 20:17 ./dovertestbucket.md5sum

./dovertestbucket:
total 12
drwxrwxr-x  3 ubuntu ubuntu 4096 Jan  9 20:17 .
drwxrwxr-x 12 ubuntu ubuntu 4096 Jan  9 20:17 atlassian
drwxrwxr-x  4 ubuntu ubuntu 4096 Jan  9 20:18 ..

./ocalcache:
total 16
drwxrwxr-x 4 ubuntu ubuntu 4096 Jan  9 20:18 ..
-rw-r--r-- 1 ubuntu ubuntu   33 Jan  9 20:18 dovertestbucket.md5sum
-rw-r--r-- 1 ubuntu ubuntu    0 Jan  9 20:18 245ceadc-de14-43dd-856c-cdf2b13c41b4.aux
drwxrwxr-x 3 ubuntu ubuntu 4096 Jan  9 20:18 .
drwxrwxr-x 3 ubuntu ubuntu 4096 Jan  9 20:18 dovertestbucket
upa commented 9 months ago

Hi,

Thank you for the screenshot and logs. I have determined the reason of OOM. I will fix it soon.

On the second run it created ocalcache dir on remote host:

This is an expected behavior. scp also does so.

# Initial setup: There is srcdir and no dstdir.
ryzen1 ~ > mkdir srcdir
ryzen1 ~ > echo asdf > srcdir/asdf
ryzen1 ~ > ll srcdir
total 4.0K
-rw-rw-r-- 1 upa upa 5 Jan 10 21:18 asdf
ryzen1 ~ > ll dstdir
ls: cannot access 'dstdir': No such file or directory

# scp srcdir as dstdir. So, there is dstdir including the file asdf.
ryzen1 ~ > scp -r srcdir localhost:dstdir
asdf                                          100%    5    63.2KB/s   00:00    
ryzen1 ~ > ll dstdir
total 4.0K
-rw-rw-r-- 1 upa upa 5 Jan 10 21:18 asdf

# scp srcdir as dstdir again. As a result, there is srcdir under dstdir.
ryzen1 ~ > scp -r srcdir localhost:dstdir
asdf                                          100%    5    65.0KB/s   00:00    
ryzen1 ~ > ll dstdir/
total 8.0K
-rw-rw-r-- 1 upa upa    5 Jan 10 21:18 asdf
drwxrwxr-x 2 upa upa 4.0K Jan 10 21:18 srcdir
ayushbindlish commented 9 months ago

@upa For the second issue mscp seems to be creating the dir with a wrong name. The expected dir is "localcache" and it ends up creating "ocalcache"

upa commented 9 months ago

Oh, I see. will investigate.

upa commented 9 months ago

The dev branch now includes the fixes for both issues (the truncated remote dir name and OOM). Could you clone and build the dev branch, and test it in your environment? The OOM issue depends on the number of files being copied. I guess the fixed version should be suitable for almost all cases including yours. If it is ok, I will merge it into the main branch and make a new release.

upa commented 9 months ago

Hi @ayushbindlish

I created the new release v0.1.3 including the fixes for this issue, and it is available on homebrew and ubuntu ppa. I believe the issues are resolved in your env, but if not, please make a new issue with detailed information.

Thanks.