• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

File upload corrupts data

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

  • File upload corrupts data

    Hi,
    I tried, my first, file upload.
    Small files are transferred oke, larger files result in the message "API error encountered: TKUPLOAD1" in a browser window. The file is created on the as400 but the data is incomplete.
    I followed the instructions in https://www.cnxcorp.com/blog/quickly...ile-upload-app

    Kind regards,
    Theo


  • #2
    Hi Theo,

    What was the size of the file that wouldn’t completely upload and the file type?

    Thanks

    Comment


    • #3
      Hi Johnny,

      These are xml files:
      391.439 bytes - failed
      256.145 bytes - failed
      121.068 bytes - failed
      20.690 bytes - success
      2.516 bytes - success

      I analysed 1 failure:
      data is correct for the first 31.781 bytes
      followed by 32.800 blanks
      followed by
      {"metaData":{"totalProperty":"totalCount","root":" DSROOT","id":"readerDSROOT","fields":[{"name":"F1_ITHTRANS"},{"name":"F1_ITHNUMBE"},{"na me":"F1_ITHIDATE"},{"name":"F1_ITHCURRE"},{"name": "F1_ITHAMOUN","type":"float"},{"name":"F1_ITHTAXVA ","type":"float"},{"name":"RRN1","type":"int"}]},"DSROOT":[{"F1_ITHTRANS":"UPS","F1_ITHNUMBE":"020204463636", "F1_ITHIDATE":"2020-07-29","F1_ITHCURRE":"EUR","F1_ITHAMOUN":1802.16,"F1_ ITHTAXVA":-0.04,"RRN1":1}],"totalCount":1}

      followed by 326.391 asterix

      Comment


      • #4
        • I updated to the newest Valence 5.2 version, no change in this error.
        • I recreated the upload program from the new example EXNABBTN03 (there is a small bug in it vvIn.file(vvIn:'*NULL'); should be vvIn_file(vvIn:'*NULL');) no luck either.
        • Tried on a windows machine, different browsers: no change
        • There is no error in the error app
        • I did find this error twice in QSYSOPR, but I can't recreate it
          • Bericht-ID . . . . . . : RNQ0202
            Datum verzending . . . : 14/08/20 Tijdstip verzending . : 09:53:38

            Bericht . . . . : The call to VVIN_CHAR ended in error (C G D F).

            Cause . . . . . : RPG procedure VVVPORT in program OFFICE/VVVPORT at
            statement 011800 called program or procedure VVIN_CHAR, which ended in
            error. If the name is *N, the call was a bound call by procedure pointer.

        Comment


        • #5
          In case it matters:
          I placed the button at the App main section level, also tried row level
          Everything larger > 29K fails
          We are on V7R4

          One more discovery:
          I started a SEP debug on my upload program and noticed that I received the error:
          "API error encountered: TKUPLOAD1" in the browser
          before my debug screen activated in RDI. :confused:
          Last edited by Theo Kusters; 08-14-2020, 05:32 AM.

          Comment


          • #6
            Thanks for the info Theo, we will be looking into this further.

            Comment


            • #7
              Any update on this matter?
              This is a blocking issue for my current project and a solution or work around would be appreciated.

              Comment


              • #8
                Hi Theo -

                We have not been able to replicate this issue. We performed the following steps:
                • Created a "Prompt For More Information" form before an RPG call in NAB. Only asking for one field...upload file.
                • Copied EXNABBTN03 as the template and simply changed the vvIn.path to a hard coded IFS location.
                • Ran the NAB app and uploaded an 8MB XML file.
                • Downloaded the newly uploaded XML file and then compared the content to the original XML file and the results matched exactly.
                Can you post back the source to your RPG program? Can you verify that your program is compiled to run in the "Valence" activation group?

                Comment


                • #9
                  Code:
                  Program . . . . . . . : TKUPLOAD1 Library . . . . . . . : INTER_TST
                  Owner . . . . . . . . : QPGMR
                  Program attribute . . : RPGLE
                  Detail . . . . . . . . : *BASIC
                  
                  
                  Program creation information:
                  Program creation date/time . . . . . . . . . . : 19/08/20 14:19:06
                  Type of program . . . . . . . . . . . . . . . : ILE
                  Program entry procedure module . . . . . . . . : TKUPLOAD1
                  Library . . . . . . . . . . . . . . . . . . : QTEMP
                  Activation group attribute . . . . . . . . . . : VALENCE
                  Shared activation group . . . . . . . . . . . : *NO
                  User profile . . . . . . . . . . . . . . . . . : *USER
                  Use adopted authority . . . . . . . . . . . . : *YES
                  Coded character set identifier . . . . . . . . : 65535
                  Number of modules . . . . . . . . . . . . . . : 1
                  Attached Files

                  Comment


                  • #10
                    I do not understand how it is possible that I receive the error "API error encountered: TKUPLOAD1" in the browser while my debug session is still active. Could it be a V7R4 related error?

                    Can we setup a teamviewer session for debugging?

                    Comment


                    • #11
                      Hi Theo -

                      We will reach out to you to setup a call.

                      Comment


                      • #12
                        Hi Theo,

                        I understand we have determined that this problem only occurs when you have SSL turned on in the Apache server instance. The use of SSL should be entirely transparent to Valence, since the encryption is occurring between the browser and Apache.

                        We tested your identical setup today at CNX and we were able to upload large files through an instance with SSL with no issue. However, we are using IBM i 7.3 and I know you have 7.4. Do you have access to a test system running 7.3 or earlier? It might be interesting to see if you can run the same upload on one of those systems to rule out the IBM i OS level.

                        Also I have seen firewalls mess up SSL communications at other customers. I'm not a network engineer so I'm not sure what exact setting to tell you to look at, but there might be settings on your network firewall that will restrict large file uploads if it can not inspect the file (which it can not because it's encrypted). Can you check with your network administrator to see if the firewall is generating any error logs that might be helpful?

                        Comment


                        • #13
                          I contacted IBM and we found the solution: ptf 5770DG1/SI72301

                          Code:
                          TLSV1.3 PHASE 2 SUPPORT
                          SSL READ FAILED WITH RETURN CODE 502
                          HTTPSVR-THREADS-F/QZSRAPR-T/QZSRAPR-RCX-MSGMCH3601 HTTP APAC
                          HTTPSVR SSL ENABLED HTTP SERVER (W/ CGI) FAILS WHEN USING DE
                          HTTPSVR - ADD TLSV1.3 SUPPORT TO HTTP SERVER FOR I
                          The best indication that you need this PTF is message ZSRV_MSG0818 in the http error log.

                          Thanks for your support!
                          Last edited by Theo Kusters; 08-20-2020, 03:23 AM.

                          Comment


                          • #14
                            Theo:
                            Thanks for posting that feedback on the PTF. It will likely help other Valence customers running on IBM i 7.4.

                            Comment

                            Working...
                            X