Bug 1341502 - Can't collect logs to subfolder using anonymous ftp connection
Summary: Can't collect logs to subfolder using anonymous ftp connection
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.5.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.9.0
Assignee: Šimon Lukašík
QA Contact: Oleksii Tsuman
URL:
Whiteboard: appliance:depot:maintenance
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-01 08:12 UTC by Kyrylo Zvyagintsev
Modified: 2018-03-01 13:06 UTC (History)
9 users (show)

Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-01 13:06:56 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:
kzvyahin: automate_bug+
otsuman: needinfo+


Attachments (Terms of Use)
success (79.37 KB, image/png)
2016-06-01 08:13 UTC, Kyrylo Zvyagintsev
no flags Details
manually (49.33 KB, image/png)
2016-06-01 08:14 UTC, Kyrylo Zvyagintsev
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:0380 0 normal SHIPPED_LIVE Moderate: Red Hat CloudForms security, bug fix, and enhancement update 2018-03-01 18:37:12 UTC

Comment 2 Kyrylo Zvyagintsev 2016-06-01 08:13:15 UTC
Created attachment 1163505 [details]
success

Comment 3 Kyrylo Zvyagintsev 2016-06-01 08:14:05 UTC
Created attachment 1163506 [details]
manually

Comment 4 Šimon Lukašík 2016-06-02 14:05:00 UTC
Weird. The log transfer goes fine when I set 

   dual_log_enable=YES

on the vsftpd server.

Comment 6 Šimon Lukašík 2016-06-03 14:19:03 UTC
Ok, so it turned out that server logging has nothing to do with this bug.

There seems to be subtle differences between ftp servers. It would be great if QE could verify this bug with vsftpd and at least one other ftp server.

Comment 9 Oleksii Tsuman 2016-12-20 12:51:50 UTC
version: 5.7.0.16.20161213213754_1ad3545

MS IIS and FileZilla on Win works as defined even with subfolders(with empty folder and with some files in it) 

vsftpd: 

As Kyrylo said, if incoming folder is empty - error occur (Error '550 Permission denied.', writing to FTP: [ftp://10.36.4.30], Username: []). If at least one file present in this folder - logs collected successfully. 

vsftpd config:
listen=NO
listen_ipv6=YES
anonymous_enable=YES
anon_root=/srv/ftp/
local_enable=NO
no_anon_password=YES
write_enable=YES
dual_log_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
allow_writeable_chroot=YES

In "/srv/ftp" present folder "pub" with 777 access rights. So if you set log collection to 10.36.4.30/pub and "pub" folder is empty - error will occur. But if you create at least one file - you will be able to collect the logs.

Comment 10 CFME Bot 2017-06-15 18:01:43 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/f87471adff09ee5316165ae906fc8e3705796868

commit f87471adff09ee5316165ae906fc8e3705796868
Author:     Šimon Lukašík <isimluk>
AuthorDate: Fri Jun 3 14:53:43 2016 +0200
Commit:     Šimon Lukašík <isimluk>
CommitDate: Tue Jun 7 17:48:19 2016 +0200

    Start mocking specific behavior of remote ftp servers
    
    I feel we need some better mocking then just rspec's double. There are
    differences between various ftp servers and we keep touching
    FileDepotFtp code as we see saw these differences comming.
    
    The tests based on rspec's double are not the useful in this case
    as they need to be rewritten each time we change the code logic. At that
    point we may re-introduce bugs for certain ftp servers.
    
    Let's build the knowledge about specific servers behavior in the spec.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1341502

 spec/models/file_depot_ftp_spec.rb | 76 +++++++++++++++++++++++++++++++++-----
 1 file changed, 67 insertions(+), 9 deletions(-)

Comment 11 CFME Bot 2017-06-15 18:01:48 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/f40f36a53e78e1bb2afa5baa76c1bd1d35d97c5b

commit f40f36a53e78e1bb2afa5baa76c1bd1d35d97c5b
Author:     Šimon Lukašík <isimluk>
AuthorDate: Fri Jun 3 11:02:50 2016 +0200
Commit:     Šimon Lukašík <isimluk>
CommitDate: Tue Jun 7 17:48:19 2016 +0200

    AnonFTP: Create directory structure by descending down
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1341502
    
    The problem is that we cannot rely on fpt.nlst to give exception when
    file is not available. With vsftpd 3.0.2-14.fc23 and Ruby-2.2.0 Net::FTP
    I get behaviour like the following
    
        ftp.nlst('/')
        => ["/incoming", "/pub"]
        ftp.nlst('/incomming')
        => []
        ftp.nlst('/non-existent')
        => []

 app/models/file_depot_ftp.rb | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comment 12 Šimon Lukašík 2017-06-16 05:34:56 UTC
This should be now fixed.

If possible, could you please test with both MS ftp server and vsftpd?

Thanks!

Comment 13 Oleksii Tsuman 2017-10-27 15:25:21 UTC
verified in 5.9.0.4.20171024163837_ef71ea6 with both vsftpd and MS ftp

Comment 16 errata-xmlrpc 2018-03-01 13:06:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0380


Note You need to log in before you can comment on or make changes to this bug.