Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
mmount  
#1 Posted : Wednesday, March 6, 2013 12:57:30 PM(UTC)
mmount

Rank: Advanced Member

Groups: Member
Joined: 11/30/2012(UTC)
Posts: 61

Thanks: 6 times
Hi,

I have several users testing the image uploading functionality of my web site using the Java Uploader. This uploads 3 resized files to Amazon S3 for each image selected and then calls a postback to my server with a list of filenames that were uploaded. The javascript looks something like this:
Code:
    function DoUploadCallback(thisStatus) {
      try
      {
        autoClose = thisStatus != 'D';
        var s = '';
        for (var i = 0, imax = files.length ; i < imax; i++) {
          if (files[i].uploaded) {
            s = s + ';' +
              replaceDelimiter(files[i].origName, ';') + ';' +
              replaceDelimiter(files[i].fileName, ';') + ';' +
              replaceDelimiter(files[i].descr, ';');
          }
          else break;
        }
        if (s != '') callbackMain.PerformCallback(thisStatus + s);
      }
      catch (e) {
        alert('Error in DoUploadCallback: ' + e.message);
      }
      finally {
        popupProgress.Hide();
        uploading = false;
        mnuPhotos.SetEnabled(true);
        DoUploadFileCountChange();
      }
    }

    function DoUploadCallbackComplete(s, e) {
      if (e.result != '0' && autoClose) window.close();
    }

    function DoBeforeUpload() {
      try
      {
        files = [];
        var ff = this.files();
        // Loop through files and generate unique names for each file
        for (var i = 0, imax = ff.count() ; i < imax; i++) {
          var thisFile = ff.get(i);
          var origName = thisFile.name();
          var guid = thisFile.guid().slice(1, -1);
          var fileName = guid + '.jpg';
          var descr = thisFile.description();
          files.push({
            origName: origName,
            fileName: fileName,
            descr: descr,
            uploaded: false
          });
          thisFile.description('');
        }
        startTime = new Date();
        uploading = true;
        mnuPhotos.SetEnabled(false);
        popupProgress.Show();
      }
      catch (e) {
        alert('Error in DoBeforeUpload: ' + e.message);
      }
    }

    function DoBeforePackageUpload(packageIndex) {
      fileIndex = packageIndex;
      converterIndex = 0;
    }

    function DoAfterPackageUpload(packageIndex, response) {
      try
      {
        if (packageIndex >= 0 && packageIndex < files.length) files[packageIndex].uploaded = true;
      }
      catch (e) {
        alert('Error in DoAfterPackageUpload: ' + e.message);
      }
      finally {
        DoUploadFileCountChange();
      }
    }

    function DoBeforeSendRequest() {
      try 
      {
        var fileName = files[fileIndex].fileName;
        var key = fileKeys[converterIndex];
        var newKey = key.replace(/\$\{filename\}/, fileName);
        as3.converters().get(converterIndex).key(newKey);
        ++converterIndex;
      }
      catch (e) {
        alert('Error in DoBeforeSendRequest: ' + e.message);
      }
    }

    function DoProgress(percent, uploadedFiles, totalFiles, uploadedBytes, totalBytes) {
      try
      {
        var remainingFiles = totalFiles - uploadedFiles;
        var bytesPercent = 0;
        if (uploadedBytes > 0 && totalBytes > 0) bytesPercent = ~~((uploadedBytes / totalBytes) * 100);
        if (uploadedFiles < files.length) DoUpdateLabel(lblProgressFilename, files[uploadedFiles].origName);
        DoUpdateLabel(lblProgressUploaded, bytesToSize(uploadedBytes, 2));
        DoUpdateLabel(lblProgressUploadedMax, bytesToSize(totalBytes, 2));
        progress.SetPosition(bytesPercent);
        if (uploadedFiles == 0 && uploadedBytes == 0) DoUpdateLabel(lblOverallProgress, 'Preparing images for upload...');
        else DoUpdateLabel(lblOverallProgress, 'Uploading ' + (uploadedFiles + 1).toString() + ' of ' + totalFiles.toString() + ' (' + remainingFiles.toString() + ' remaining)');
        DoUpdateLabel(lblElapsed, calculateElapsed(startTime));
        progressOverall.SetPosition(percent); 
      }
      catch (e) {
        alert('Error in DoProgress: ' + e.message);
      }
    }

    function DoError(errorCode, httpResponseCode, errorPage, additionalInfo) {
      DoUploadFileCountChange();
      switch (errorCode) {
        case 9: // User
        case 12: // Script
        case 13: // Trial
        case 18: DoUploadCallback('D'); break; // Event
        default: DoUploadCallback(status);
      }
    }

    function DoAfterUpload() {
      DoUploadCallback(status);
    }


In the past two days I have had two (that I know of) instances where the uploaded files got messed up partway through the upload. The users (two different ones) both tell me they have not gotten any errors while uploading. What I am seeing as an end result is that I have proper matching small, medium, and large files on Amazon then suddenly I have a large file in the small directory, a small image in the medium directory, a medium image in the large directory. The large sized small image is a different image than the the small sized medium or medium sized large. All the files after that point are messed up and sometimes missing completely.

I know this is a sketchy description of the problem at best but is there something I am obviously doing wrong in the javascript above, or something I can be checking to make sure that this actually raises an exception if it happens again?

The only reason I know it has happened in these two cases is that I have a process that is pulling all the large images down to my local servers and one of the large images was missing in both of these cases. This generated and logged an error on my internal code. I recognize that it is possible the same thing has happened elsewhere but I'm not missing a large image so I don't know about it.

I will be updating the code to 8.0.32 within a few days but don't see anything in your changes list that might address this.

Any guidance would be greatly appreciated.

I have attached a screen shot that shows the photos right as they start going bad. First row was ok, all the following have images messed up.

Thanks,

Mike

Edited by user Wednesday, March 6, 2013 1:50:47 PM(UTC)  | Reason: Added screen shot

mmount attached the following image(s):
photoglitch.jpg
vitaly  
#2 Posted : Wednesday, March 6, 2013 10:12:57 PM(UTC)
vitaly

Rank: Advanced Member

Groups:
Joined: 12/19/2012(UTC)
Posts: 164

Was thanked: 8 time(s) in 8 post(s)
Hello mmount,

It seems you have irregular problem.

Please create a new support case here: http://www.aurigma.com/MyAurigma/CreateCase.aspx

Also, please send us a link to the page where I can reproduce the problem (as well as login/password if any required) and post in case server-side and client-side code of this page (including the Upload Suite settings and all accompanying JavaScript if any).
Best regards,
Vitaly Kustov
Aurigma Technical Support
mmount  
#3 Posted : Thursday, March 7, 2013 5:12:59 AM(UTC)
mmount

Rank: Advanced Member

Groups: Member
Joined: 11/30/2012(UTC)
Posts: 61

Thanks: 6 times
Vitaly,

Unfortunately I have not been able to reproduce. I have had one of the users reupload exactly the same files and they came up just fine indicating that it is probably not a problem with the images themselves. I was hoping you could see in code how it "might" happen and provide some insight on how, even if I can't prevent it, I could detect it and kill the upload.

I have made some changes to the javascript and will now be sending any error returned from the Error event back to our server to be logged. Perhaps that will help us isolate this issue should it happen again.

Thanks,

Mike

Edited by user Thursday, March 7, 2013 7:51:10 AM(UTC)  | Reason: Not specified

vitaly  
#4 Posted : Sunday, March 10, 2013 8:34:33 PM(UTC)
vitaly

Rank: Advanced Member

Groups:
Joined: 12/19/2012(UTC)
Posts: 164

Was thanked: 8 time(s) in 8 post(s)
Hello mmount,

Thanks for your comment. Feel free to contact me if you have any additional questions.
Best regards,
Vitaly Kustov
Aurigma Technical Support
mmount  
#5 Posted : Wednesday, March 13, 2013 4:21:40 AM(UTC)
mmount

Rank: Advanced Member

Groups: Member
Joined: 11/30/2012(UTC)
Posts: 61

Thanks: 6 times
I have implemented the postback to log client errors and have seen more errors than I expected although the same problem does not seem to have repeated. At the same time I rolled out these changes I also released the new version of the Java Uploader. I am seeing the following errors:

* POST requires exactly one file upload per request:
This is happening for same user at the moment - I have my support guy in contact with them to find out what they might be doing differently than everyone else

* The target server failed to respond
* Connection reset by peer: socket write error
* Read timed out

Also, one HTTP Response = 0, Error Code = 0 (no messages) - this one the user called us and said they had deleted the image directory during upload and that probably caused the error.

I don't have many users on the system yet. They uploaded 6,333 photos since yesterday and 462 of those were part of the error groups (when I get an error postback I am flagging all photos in that group as an error).

Most of these errors look like Amazon problems. Does it look like a configuration problem somewhere?

Thanks,

Mike
vitaly  
#6 Posted : Wednesday, March 13, 2013 11:48:46 PM(UTC)
vitaly

Rank: Advanced Member

Groups:
Joined: 12/19/2012(UTC)
Posts: 164

Was thanked: 8 time(s) in 8 post(s)
Hello Mike,

Unfortunately I cannot tell you what is the reason of all these errors right now - I don't have enough information.
The problems are definitely server-side.
We need is to check server logs, after we will know that there is an error (or there is not). After this probably we will be able to suggest a solution. For this please create a new support case here: http://www.aurigma.com/MyAurigma/CreateCase.aspx
Best regards,
Vitaly Kustov
Aurigma Technical Support
mmount  
#7 Posted : Thursday, March 14, 2013 7:53:03 AM(UTC)
mmount

Rank: Advanced Member

Groups: Member
Joined: 11/30/2012(UTC)
Posts: 61

Thanks: 6 times
As I gather more information I will create a support ticket.

I do have details on the "POST requires exactly one file upload per request" error. The user is using an online service to directly upload their photos when they take them. They are then downloading the images to their local drive to attach and send to us through the uploader. We found that there was one image that was corrupt in the folder (in Windows Explorer it didn't show the thumbnail - I don't currently have details beyond that). When that image was removed the upload worked fine. I have my tech trying to get a copy of the "corrupt" image so I can review and pass it on to you guys if needed.

Thanks,

Mike
vitaly  
#8 Posted : Thursday, March 14, 2013 10:46:44 PM(UTC)
vitaly

Rank: Advanced Member

Groups:
Joined: 12/19/2012(UTC)
Posts: 164

Was thanked: 8 time(s) in 8 post(s)
Hello Mike,

mmount wrote:

I have my tech trying to get a copy of the "corrupt" image so I can review and pass it on to you guys if needed.

Could you please to do it?
Best regards,
Vitaly Kustov
Aurigma Technical Support
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.