-
-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed file upload returns an FtpResult with neither IsFailed nor IsSuccess flags set to true #1671
Comments
Thanks for this input. I have made some initial changes to take the IsFailed() fact, just as you suggested, and merged those changes. Perhaps you could try out the current master instead of Nuget and we can take this from there to see if we can percolate the failure reason into the FtpResult as a next step. Note that I can find "550 Device Function Code invalid" in Google - especially in FANUC and Robotics contexts, just as an aside. |
I feel that IsFailed is sort of redundant, in that IsFailed is in effect <---- not IsSuccess and not IsSkipped, but I suppose it is included more or less for completeness. |
Yeah that makes sense. My concern was that we were also seeing some situations where we were successfully copying but not getting the IsSuccess flag (nor any other flag). I'll need to look into that some more though, because later I was getting the IsSuccess flag. Not sure yet if we can recreate it or not... We're working on testing with the current master. |
We tested with those changes and we are now getting IsSuccess and IsFailed as expected.
That would be great! |
I just realised that there might already be a nice way for you to check "what happened". About a year or even longer ago, I put a property into the client called /// <summary> Gets the last replies received from the server</summary>
public List<FtpReply> LastReplies { get; set; } This will supply you with the last 5 I think, at the time, I needed more information myself in an application I was coding - especially as sometimes a failure message may be preceeded by more information (otherwise lost). |
Could we assign the If we only have the I appreciate your time helping us out here and I would be willing to do a PR to make these changes if you want. Thanks! |
Oops, my bad. I totally forgot that we are populating this list. And yes, one would need to add the LastReplies list to the FtpReply list. I think I also want to investigate passing other errors (beyond FTP server error replies) up to the top. Think of I/O errors, timeouts and so on. So my previous suggestions was simply premature and born out of over-enthusiasm.
Always appreciated. But let's find the most beautiful way do fix this first. |
I've been playing around with the current code (with our recent addition). Look - failures should be found in the
Need to look at that in more detail. |
Can you also check what I mentioned in my last post? |
FTP Server OS: Windows
FTP Server Type: The FTP server is running on FANUC R-30iB/R-30iB+ Robot Controllers. I'm not sure about what exactly our FTP server is, but my best guess is that it's a custom FTP implementation.
Client Computer OS: Windows
FluentFTP Version: 51.1.0
Framework: .NET 8
We're attempting to upload a set of files to our Robot Controller using the
UploadFiles
method on theAsyncFtpClient
. We are using the returned list ofFtpResult
instances to determine whether each file was successful or not with theIsSuccess
andIsFailed
flags. In the Fluent FTP logging we're seeing that the file failed to upload due with error code 550 "Device Function Code invalid". Despite the failure, we're not seeing theIsFailed
flag as true in theFtpResult
object.Looking into the source code, it looks like the IsFailed flag only gets set to true if an exception occurs and the
FtpStatus.Failed
result we were returned from theUploadFileFromFile
method is not reflected in the FtpResult if it fails.Would something like this make sense to do?
UploadFiles.cs ->
AsyncFtpClient.UploadFiles
-> Line 99I'd also like to have the information of why the file failed top copy, in this case the 550 error
Logs :
[Edited to remove some private information]
To give a little more information, we don't have a problem with the FTP process itself. I believe our Robot Controller is denying this file to be copied for a legitimate reason. We are able to successfully download and upload other legitimate files. Our concern is only with the reporting so that we can display why things failed: display the 550 error, etc.
If you need any additional information, please let me know. Thanks!
The text was updated successfully, but these errors were encountered: