5.3.z commits: 2c8fb4b Update tests to reflect the intermediate directory creation. a4c1f87 Update FileDepotFtpAnonymous to match changes to FileDepotFtp. 05d6825 Rewrite file/directory existence and upload mechanisms. a222a41 Change base_path and destination_path to return Pathnames. 91e662c Expose @ftp as an attr_reader so we don't need to pass it around. 0513e87 Refactor log_header into a method
Jan, can you post the full log? It appears like the code thinks the current logs are already posted but we're not logging it. Can you try modifying the code to log when the file already exists? Basically here: https://github.com/ManageIQ/manageiq/blob/d94823188f4e3a83b0250ea9929fdd6226580d3c/vmdb/app/models/file_depot_ftp.rb#L23 Change: return if file_exists?(destination_file) To: if file_exists?(destination_file) $log.warn("XXX File already exists: #{destination_file}) return end Is that what is happening?
Upstream pull request: https://github.com/ManageIQ/manageiq/pull/1677 Net::FTP#nlst returns an array, so check for empty. Some ftp servers return an error when you ask for nlst on a missing file/directory. Others, will return normally with an empty list. We had tested with an ftp that does the error situation. This commit fixes the "empty list" situation.
Hi Jan, If you could confirm that changing this single line: From: !!ftp.nlst(file_or_directory.to_s) To: !ftp.nlst(file_or_directory.to_s).empty? (see https://github.com/jrafanie/manageiq/commit/7806260dda49949fb6dee9a8f833529bf262412e) I was able to recreate the issue on a different ftp server so I'm pretty confident it will fix it. Thanks!
Hey Joe, yes, this change indeed fixed the issue for me.
New commit detected on manageiq/master: https://github.com/ManageIQ/manageiq/commit/230872902234a8057f7d95fa763cede79966f809 commit 230872902234a8057f7d95fa763cede79966f809 Author: Joe Rafaniello <jrafanie> AuthorDate: Thu Feb 12 16:49:20 2015 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Thu Feb 12 16:50:31 2015 -0500 For testing, add ftp setter and mark file_exists? as public https://bugzilla.redhat.com/show_bug.cgi?id=1190812 vmdb/app/models/file_depot_ftp.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
New commit detected on manageiq/master: https://github.com/ManageIQ/manageiq/commit/7806260dda49949fb6dee9a8f833529bf262412e commit 7806260dda49949fb6dee9a8f833529bf262412e Author: Joe Rafaniello <jrafanie> AuthorDate: Thu Feb 12 16:56:24 2015 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Thu Feb 12 16:56:24 2015 -0500 Net::FTP#nlst returns an array, so check for empty. Some ftp servers return an error when you ask for nlst on a missing file/directory. Others, will return normally with an empty list. We had tested with an ftp that does the error situation. This commit fixes the "empty list" situation. https://bugzilla.redhat.com/show_bug.cgi?id=1190812 vmdb/app/models/file_depot_ftp.rb | 2 +- vmdb/spec/models/file_depot_ftp_spec.rb | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-)
New commit detected on cfme/5.3.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=b765dc9dad6e77079fdad75dbc34c73ffff2c290 commit b765dc9dad6e77079fdad75dbc34c73ffff2c290 Author: Joe Rafaniello <jrafanie> AuthorDate: Thu Feb 12 16:49:20 2015 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Fri Feb 13 10:00:44 2015 -0500 For testing, add ftp setter and mark file_exists? as public https://bugzilla.redhat.com/show_bug.cgi?id=1190812 vmdb/app/models/file_depot_ftp.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
New commit detected on cfme/5.3.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=c0ac477beb150862907cd43eebdff34c9b78f843 commit c0ac477beb150862907cd43eebdff34c9b78f843 Author: Joe Rafaniello <jrafanie> AuthorDate: Thu Feb 12 16:56:24 2015 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Fri Feb 13 10:00:44 2015 -0500 Net::FTP#nlst returns an array, so check for empty. Some ftp servers return an error when you ask for nlst on a missing file/directory. Others, will return normally with an empty list. We had tested with an ftp that does the error situation. This commit fixes the "empty list" situation. https://bugzilla.redhat.com/show_bug.cgi?id=1190812 vmdb/app/models/file_depot_ftp.rb | 2 +- vmdb/spec/models/file_depot_ftp_spec.rb | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-)
Joe: Can you cherry-pick this to 5.3.3,..DaJo gave the okay,.and the 5.3.3. branch is open.
New commit detected on cfme/5.3.3: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=8075a1c6e96169b2189eeb9600f56f4760136826 commit 8075a1c6e96169b2189eeb9600f56f4760136826 Author: Joe Rafaniello <jrafanie> AuthorDate: Thu Feb 12 16:49:20 2015 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Tue Feb 17 11:05:03 2015 -0500 For testing, add ftp setter and mark file_exists? as public https://bugzilla.redhat.com/show_bug.cgi?id=1190812 vmdb/app/models/file_depot_ftp.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
New commit detected on cfme/5.3.3: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=09bf38c6ac21888cba5b58a2fab28e34792bfdcf commit 09bf38c6ac21888cba5b58a2fab28e34792bfdcf Author: Joe Rafaniello <jrafanie> AuthorDate: Thu Feb 12 16:56:24 2015 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Tue Feb 17 11:05:08 2015 -0500 Net::FTP#nlst returns an array, so check for empty. Some ftp servers return an error when you ask for nlst on a missing file/directory. Others, will return normally with an empty list. We had tested with an ftp that does the error situation. This commit fixes the "empty list" situation. https://bugzilla.redhat.com/show_bug.cgi?id=1190812 vmdb/app/models/file_depot_ftp.rb | 2 +- vmdb/spec/models/file_depot_ftp_spec.rb | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-)
Verified - fixed in 5.3.3.2 (5.3.3.2.20150217120931_a465215). Log collection using FTP now works as expected.
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://rhn.redhat.com/errata/RHBA-2015-0261.html