lavv17 / lftp

sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)
http://lftp.yar.ru
GNU General Public License v3.0
1.08k stars 159 forks source link

lftp, parallel mirror prints garbage and corrupts files while downloading over fish:// #36

Closed arekm closed 11 years ago

arekm commented 11 years ago

When downloading (queue mirror -c xyz; queue mirror -c abc and so on) bunch of directories with files over fish:// then lftp (tested on 4.3.1 , 4.4.5) sometimes it doesn't download one or two files correctly

Without "set mirror:parallel-transfer-count 10" I didn't have this problem, so something looks broken in parallel handling.

"Brak dostępu" means "Permission denied" but I have full access to all files and directories on both sides.

lftp prints on console:

mirror: Brak dostępu: H�b���ᖚ/�+9��?@���W4�z�TgR���kԁ�?� ���ގ�"7G�82'�N��\/o @+�Ē�J��': �T�~/���8��t�5OP x͜y�Ԗ�t@!৫%2�b��>< T?�DheΓ�� ���>�t}�S$�[Zr�N]�KS�G>��/���mp�o��~�Q?f�Y~�� ���AS4����P�rZ�@e�J�]@ʗ�4P&l��إ��S�a#Ä ���]�aآq�٧R�u�tU� �o��W/RLH ��C�ς5�^���y���Yض۩�M�I�y�S��a�O00dc�
M׭$[Q}}����]0�T<4�^�!����5<��kԈ�WeE�(m��0�ۍ��AШ} */�ZyUr���<��I=�P���Pt�z%�£�2��
�j+��]Ω,T0-q| z�U�����D������� B|2�;јl1����@����RyVp:9,�JYTt�f�d���.�DU bIv�A�Z(�˚�

����W�y�

�ifJV�x�ڽ�zDCW�:�L<�ёm۶L�����e��>,�C�K1��H~$�j<H��j��A�xtM����C%���q't�׈���n �8��2K"t�jI�<��A�P�(/>��i�~�0@���W�����?�C+�p7��W���?��p0���Ay��bN�ӥ)GM@��� ���#���|M_�d�%��O��}��xm��y���0�����C(g�9-7��ɕ�y5+�v,E���dQ�<��dI�[iÕ\�_I�?GH� ��k�yРQޝ}7Y�U��AX~�+OI�:�QzHJF:lI�,��Zp�i��DJe�^��ΔQ�\�5��a@S�ZbCυL&�g ��3��7�J���B2�<�n#�ȅ�Ȝ��>���i��%<d�Ke,��")�L� ���U /��J�����%p +T^����n���_?�>C�Yl�����ꥯ��V��ǖ���#�L".�� ��RP�_ӑE10՟� �(��/�F˄�K� H�&:�b����L<|<�lիn��Uo�>����xc��;�Yr� R����"X.�m��Us�T]��z��L�Ӄ;����Q�u2<�{��%i�T�Ӧ�fF��8��tR%ՙ(��FTE���=Ԋ0,�VD!TP�"��?O�=|�\牢��^� s��@��R��x���~WW�����a�@�@��O"~>"�:<�5��h�?.N��[�AʢI5�D�"(��7K���rx�^��\Y�vD0�"%(t�C�5V0yV)kv�蚂 B�{�%�#,3IE������AL8Q��U�|p�� "P�!j�'R�)R��!� @��1�/A !����Hp�pP p�h=�|<�E�ޣA���04H�lRFN!��A�U�[E����l��,����Xj<K����U��3H⩞��h�$,���\�29N�.��?j�F^�� �I]@d> A@d�硅 j��4��h�I.�����G�<�(�Ν.�������e���!��!M���Ԗ��(�C�,��vS_�f�p�-�D�SJ @��턕�F<<�Q� ��tT���:t��C�R��g�������#��?���� q�qA{�=~����E�^���eF�EG�}@�R�>�Dn�6��Nځ([vI�dRG���ճ6>�x!��P��mU�>�V<�=����x��Ҽfb ?.�N]�9�].V%2]��0V|/����k��d��R�x!�,d��p���D��U8��)��M�z:��Fߪ� e�����J���]V�R�l�A��+Y��BÑ����S�
�����oLy�i�~�J^hGU��6RC˶�3�����)��+��� 9��'��5�7"w ������,����m�
~c˕O@5}���ش���O�Fe0�0��N8 ?�%�"�7��+ԙ+l|U���bĕ�- wbP HG�P8�y�CNx�듯���e)�Ce�x\�$<"!��g���:6�S������5���nA�Nd�6N�V�}���[�b�l���&'�O4�S���:x�Tl�7�9Ly�w� 8,�D>�0��!߳R=�ჯǽK���$��~g�R te9ew��@$.JJE�$t����r>�v���,�c�qを�� oWu ��t�N���њ%Q�$�RWƴ�H1=wE::0��RH���H I. ����FR"ݹ�x�!$W �nRG��;[v�g)��u#L���f��M1ra�0�C��7�\N>S�Yi_ח� UQ{� 1I呄D�,��f�tG� �zm�B"j� ��{��=f�00����vN�t� ��t=��/@��!���U{����������z��2 Bl)�o����p�8�^��ꮁqc#Eҭ{���$�>��U���R��h�������u������N�HZp��u�9��h���8&{���M�?�������)�9���#�1p7��BQ��%����~ω ��=.�6�?����1���t{k%��v�N���=�� � ��R��ƕz�+v�`!�G8 ��+�Tc�s48���l�"��X�&��F%��{�����]DyQ9��+�0ɫ�h����Z�y�jS����a����XR /���<N�S�ǛD�U@�@����3S�Zp�\m��@3'a��'ފ\�R9���ۋ�ͺƬ' +��6�������KKI��9:]_8>�_��I3�/xPo 5Ӛ�(�,A�ꁇ@~�~O��/C�)�K��A :RN�:t�Ӆ�p�0�34뵪@�)��&IF�i�ؔ�||fI8��G��e����������:�����I�������Q �0�6���Ӫ�^�nRu� �<$8iX�j�4�u�bX�#�:�X����W��wJ�G9;�J_�NQmC9 �:iL:J��5���/b-j>M4<�w��[jЋ%����nK�bʸV�- Z����[�8<�0x#-%�#�E�j[k�͒��'�7%��7ر��Tt,8{յN�J�����c'e���{�+�У�؝�!��ӧJii6�Ji�隙i3�C�$�(�Ud��B �!�4�:p��w���- �nFnwcsWQZ�1��ŏ������]�sV���%޺�� h,M 6�܄H���$�Pӆh�^\$|��@6�ry���D������6^����H ��p s���)���˽(�Ͷ^"�k6���u� �G�@_��v�i��"aQ�&�IK�ר� ��uS�_b�S<=�n�shO����n�N���e�����Q<sh0�.9"�+�&��f���МUБy�/0����qǠ=- �NFpX��.ErӤ.M�G���8�"Rx�!�N �.���JyxX5>�P9�}��+O|��~�V��{�V�Bum�vk/yJ�gcdQ����)��iYHyN+QgGYH��~�p�; -rw-r--r-- 1 arekm users 15000000 Jul 21 03:55 kmd-pgtb.r09 ��4w 2Qh�ؘ�:o��,k���3�<6����3f/T�7���ĭp�KS��E�䬸J���+���)x��3Pa�����Ix�>QbĢ/�r�ĺĥ�q�S(�o -rw-r--r-- 1 arekm users 15000000 Jul 21 08:32 kmd-pgtb.r40 mirror: Brak dostępu: �����"4���S�桖��~���/��}r�=�a��+�}�����X�v�J�n1�uJ-�()�2�C`��\��U�l⋥� (kmd-pgta.r03) mirror: Brak dostępu: ���>.��eڭ]DHbn��d"Mo?�PI��K��%�3�����%[��E����CnG�n���)�@�!6�3u?T�h@Ue6o�Ka�b]o ��a0��S%� (kmd- pgta.r39) lftp arekm@somehost:~/t/download>

or

mirror: Brak dostępu: �= -rw-r--r-- 1 arekm users 50000000 May 18 01:00 somefile.r12 mirror: Brak dostępu: �5�5�w�7j K䣖�-�H@�O��d�?,&{�U��g�+�'�s0�xb8 (somefile.r13) lftp arekm@somehost:~/download>

~/.lftp/rc: set net:timeout 30 set cmd:move-background false set cmd:queue-parallel 4 set mirror:parallel-transfer-count 6

Linux, openssh 6.1p1, bash 4.2.45 on remote side

lavv17 commented 11 years ago

I could not reproduce the problem. But in ec49c021ef83e70ab1d2d111d6b63eddf9cd3e93 I have made Fish disconnect in more cases, which should make protocol desync less likely. Please test.

arekm commented 11 years ago

Was able to reproduce with 4.4.6 and ec49c02. lftp over fish, queue get onefile; queue mirror -c dir-with-55-files-of-15MB-size. Below is part of "debug 10 -o logfile". Also seems that garbage is much more often logged inside of debug logfile than it is on stdout

<--- ### 100 0:0 translated to pair 0:0 (0,0) 0 translated to pair 0:0 (0,0) copy: put confirmed store copy: get is finished - all done copy: put confirmed store copy: get is finished - all done ---> #RETR something.r05 ls -lLd something.r05; echo '### 100'; cat something.r05; echo '### 200' ---> #RETR something.r04 ls -lLd something.r04; echo '### 100'; cat something.r04; echo '### 200' <--- -rw-r--r-- 1 arekm users 15000000 May 20 15:00 something.r03 <--- -rw-r--r-- 1 arekm users 15000000 May 20 15:00 something.r05 <--- ### 100 <--- ### 100 <--- -rw-r--r-- 1 arekm users 15000000 May 20 15:00 something.r04 <--- ### 100 copy: get hit eof copy: waiting for put confirmation copy: put confirmed store copy: get is finished - all done copy: get hit eof copy: waiting for put confirmation copy: put confirmed store copy: get is finished - all done <--- ### 200 copy: get hit eof copy: waiting for put confirmation copy: put confirmed store copy: get is finished - all done ---> #RETR something.r06 ls -lLd something.r06; echo '### 100'; cat something.r06; echo '### 200' <--- -rw-r--r-- 1 arekm users 15000000 May 20 15:00 something.r06 <--- ### 100 <---� �F2yZ�0��l�2޻�{�MEh�Z��Ś~Q��^0��muF1%ʇ���nj��rԨ[�3����}ά?��8�:��od��Ddj� I]t�'ґ�:�αi�ni� ��9��#<�Q�TA(C��;�K,)�t�ED$<x!D�g��1z�f٤�e��J'iʯ���w�˽�����▒5�y▒d�p����P��{C VZ�.�_���joAq����rE����N��2� copy: get hit eof copy: waiting for put confirmation copy: put confirmed store copy: get is finished - all done <--- ### 200 copy: get hit eof copy: waiting for put confirmation copy: put confirmed store copy: get is finished - all done

OR

copy: get hit eof copy: waiting for put confirmation copy: put confirmed store copy: get is finished - all done ---> #RETR something.r19 ls -lLd something.r19; echo '### 100'; cat something.r19; echo '### 200' <--- -rw-r--r-- 1 arekm users 15000000 May 20 15:00 something.r19 <--- ### 100 <--- �Z�yq lb��F�OI�0Lܧ���b�~��ɡ2M���y��#�$'��1��'reF���▒}b�k�ra�� <--- ### 200 copy: get hit eof copy: waiting for put confirmation copy: put confirmed store copy: get is finished - all done ---> #RETR something.r20 ls -lLd something.r20; echo '### 100'; cat something.r20; echo '### 200' <--- -rw-r--r-- 1 arekm users 15000000 May 20 15:00 something.r20 <--- ### 100 <--- ### 200 copy: get hit eof copy: waiting for put confirmation copy: put confirmed store

OR

copy: get hit eof copy: waiting for put confirmation copy: put confirmed store copy: get is finished - all done ---> #RETR something.r52 ls -lLd something.r52; echo '### 100'; cat something.r52; echo '### 200' <--- -rw-r--r-- 1 arekm users 15000000 May 20 15:00 something.r52 <--- ### 100 <--- �n��J���!�qS���ܑm�wf[�(�����m�0)���%�"? ���iǨ���8ϰ��t�P#���w�a{��l��s�^�Z�V�Ns <--- ### 200 copy: get hit eof copy: waiting for put confirmation copy: put confirmed store copy: get is finished - all done ---> #RETR something.r53

lavv17 commented 11 years ago

Should be fixed in d3cf34f, please try.

arekm commented 11 years ago

Now it doesn't see contents of directory (probably parses it incorrectly). It sees things like " total 77064192", so files are there:

lftp arekm@somehost:~> cd t/download cd ok, cwd=/home/users/arekm/t/download lftp arekm@somehost:~/t/download> ls ls: Access failed: total 77064192 drwxr-xr-x 354 arekm users 28672 May 21 08:38 . lftp arekm@somehost:~/t/download>

and in debug log:

---- attempt number 0 ---- attempt number 1 ---- Running connect program (ssh -a -x -l arekm somehost echo FISH:;/bin/sh) <--- Password: XXXX <--- FISH: ---> #FISH TZ=GMT;export TZ;LC_ALL=C;export LC_ALL;exec 2>&1;echo;start_fish_server;echo '### 200' ---> #VER 0.0.2 echo '### 000' ---> #PWD pwd; echo '### 200' <--- <--- /bin/sh: [2]: start_fish_server: not found <--- ### 200 <--- ### 000 <--- /home/users/arekm <--- ### 200 ---- home set to /home/users/arekm ---> #CWD /home/users/arekm/t/download cd /home/users/arekm/t/download; echo '### 000' <--- ### 000 ---> #LIST ls -la ; echo '### 200' 0:0 translated to pair 0:0 (0,0) 0 translated to pair 0:0 (0,0) 0:0 translated to pair 0:0 (0,0) 0 translated to pair 0:0 (0,0) <--- total 77064192 <--- drwxr-xr-x 354 arekm users 28672 May 21 08:38 . ---- Disconnecting

arekm commented 11 years ago

Note: using 4.4.6 + all new changes from git, not only d3cf34f.

lavv17 commented 11 years ago

Please try 0f6f620 (the previous change was overdone)

arekm commented 11 years ago

No garbage and no corruption in last few hours with these fixes.

I think the bug can be closed and if corruption becomes visible again I'll open new one with new details.

Thanks!

lavv17 commented 11 years ago

Thank you!