template tests fine but fails in production

Archived from the Transloadit support forum. Originally posted on March 11, 2011; details may be outdated, see our docs for current behavior. Original thread

Here is my template:

{
  "steps": {
    "image_thumb": {
        "use": ":original"
      , "robot": "/image/resize"
      , "correct_gamma": true
      , "width": 232
      , "resize_strategy": "fit"
    },
    "image_full": {
        "use": ":original"
      , "robot": "/image/resize"
      , "strip": true
      , "correct_gamma": true
      , "width": 640
      , "resize_strategy": "fit"
      , "watermark_url": "http://s3.amazonaws.com/path/to/image"
      , "watermark_position": "bottom-right"
    },
    "video_thumbs": {
        "use": ":original"
      , "robot": "/video/thumbs"
      , "width": 232
      , "resize_strategy": "fit"
    },
    "video_encode": {
        "use": ":original"
      , "robot": "/video/encode"
      , "preset": "iphone"
      , "realtime": "true"
      , "width": 1280
      , "resize_strategy": "fit"
      , "ffmpeg": {
            "b": "5000k"
          }
      , "watermark_url": "http://s3.amazonaws.com/path/to/image"
      , "watermark_position": "bottom-right"
    },
    "image_export": {
        "use": ["image_thumb", "image_full"]
      , "robot": "/s3/store"
      , "key": "REDACTED"
      , "secret": "REDACTED"
      , "bucket": "my_image_bucket"
      , "path": "${unique_prefix}"
    },
    "video_export": {
        "use": ["video_thumbs", "video_encode"]
      , "robot": "/s3/store"
      , "key": "REDACTED"
      , "secret": "REDACTED"
      , "bucket": "my_video_bucket"
      , "path": "${unique_prefix}"
    }
  }
}

It works fine for images. With videos the video_thumbs are created and returned in the results object, but video_encode is missing from the results. Seems like it doesn’t wait for this step. The message is “The assembly is currently being executed.”

Everything works perfectly in the test suite.

Any ideas?

I could need some more information to help with this:

Are you using the jQuery plugin?
Can you give me an assembly id where the problem occurs?

Yes, I’m using the jQuery plugin.

assembly_id: “REDACTED”

If I run the video_encode step by itself, it runs fine… and if I run the video_export step by itself with “use”: “:original”, it works as well… seems like the /s3/store robot doesn’t like the output from the video_encode step…

Again, it works fine in the test suite… so I guess it’s more likely its a plugin issue…?

Thanks for the help!

Have you set “wait: true” as a plugin parameter?

If not, the jQuery plugin will submit your original form as soon as the upload has completed. At this point the assembly may or may not have completed yet, and you have to use a notify_url to get the final results.

that’s it… wow, I’m on a roll here… fml :slight_smile: i could’ve sworn that was true by default!

thanks again.

Don’t worry, you’re not the only one to run into trouble with this. We’ll start working on a new version of the jQuery plugin at some point, and I think making “wait: true” the default might be less-surprising by default.