ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

No Message/Error Codes in My FTP Log

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • No Message/Error Codes in My FTP Log

    Hi Folks

    I've got several FTP scripts that run overnight, and if they fail I'd like to know about it.

    A quick search and I found out that all I needed to do was check the log for errors:

    It is a straightforward matter to write a program to process this file and display an error message on QSYSOPR if there are any error messages. FTP error messages have numbers that start with a 4 or 5.
    Great. I can do that. Only problem is that when I look at the log there are no message numbers. If I do the FTP interactively there are no message numbers. Each statement just starts right in at position 1 with the statement it's going to make.

    Is there a setting somewhere that controls this? I'm on 7.1

  • #2
    Addendum: Must be something to do with the server I'm attaching to - If I try other servers they send message numbers at the start of each line.

    So that changes the question a bit: Does anyone know the setting on an FTP server to control this? (I've never set up an FTP server)

    Comment


    • #3
      Mystery solved. In case anyone has the same problem, the story is that my script had failed to connect. This doesn't stop the script from executing all its lines, so each request was unanswered and no responses were returned.

      So, the info out there on various sites is somewhat incomplete. The full procedure should be to check for "Cannot connect to host ..." (no error message), then check for error messages starting with 4 or 5.

      Comment


      • #4
        There can be occasional problems with using the technique of checking for multiple error conditions because there may be an unanticipated error which would not be caught. I prefer to use a technique that checks for a successful transfer (which is code 226) and if that is not found, then signal an error.

        Comment


        • #5
          Originally posted by Brian Rusch View Post
          There can be occasional problems with using the technique of checking for multiple error conditions because there may be an unanticipated error which would not be caught. I prefer to use a technique that checks for a successful transfer (which is code 226) and if that is not found, then signal an error.
          Yes, and for another reason too: Looking for a line starting with 4 or 5 is pretty useless. My successful transfer (now that the server is up again) has two "errors"
          1. "500 'SITE': command not understood" [which results from issuing a NAMEFMT 1 command; there doesn't seem to be a way to stop the iSeries from sending it to BOTH parties even though I know in advance that the server won't understand it since it's a Windows box]
          2. "5398837 bytes transferred in ..." [which is completely valid even if it starts with 5]

          And of course the latter could start with a 4 as well. So forget about checking for 4 and 5.

          Comment

          Working...
          X