502 Bad Gateway when creating an Assembly

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

Hi,

I’ve been playing with Transloadit quite happily this morning but am now encountering a 502 Bad Gateway when I attempt to create an Assembly - full var_dump() of response follows:

`object(transloaditresponse) var ‘data’ => string ’

502 Bad Gateway

The server returned an invalid or incomplete response.
</ht’ (length=108)
var ‘curlInfo’ =>

array
  'url' => string 'http://heike.transloadit.com/assemblies' (length=39)
  'content_type' => string 'text/html' (length=9)
  'http_code' => int 502
  'header_size' => int 97
  'request_size' => int 218
  'filetime' => int -1
  'ssl_verify_result' => int 0
  'redirect_count' => int 0
  'total_time' => float 120.658914
  'namelookup_time' => float 0.370155
  'connect_time' => float 0.468927
  'pretransfer_time' => float 0.468931
  'size_upload' => float 716
  'size_download' => float 108
  'speed_download' => float 0
  'speed_upload' => float 5
  'download_content_length' => float -1
  'upload_content_length' => float 4812
  'starttransfer_time' => float 0.469136
  'redirect_time' => float 0

var ‘curlErrorNumber’ => int 0 var ‘curlErrorMessage’ => string ‘’ (length=0)`

Hi warren,

did you end up seeing this problem again? I’ve tried to investigate, but so far I couldn’t find anything. It seems like haproxy might just have had a bad moment and screwed up this particular request.

--fg

Hi Felix,

Thanks for getting back in touch. I was able to resolve this issue - it was a problem at my end. I wasn’t actually the send the file to the Assembly correctly, so I apologise for the inconvenience.

That said, it may help users in the future if you’re able to trap malformed input a little more elegantly.

Regards,

Warren.

Can you give me some more details in the nature of your malformed input?

It seems like your request got bounced on a lower level, so I’m assuming you had malformed http or something?

--fg

Hi Felix,

I’m using the latest master of the PHP SDK. The offending code was:

 $response = $transloadit->createAssembly(array(
'files' => array($file['tmp_name']),
'params' => array(
'steps' => array(
'encode' => array(
'robot' => '/video/encode'
),
'export' => array(
'robot' => '/s3/store',
'key' => $user['s3key'],
'secret' => $user['s3secret'],
'bucket' => $user['s3bucket']
)
)
)
))

In my case, $aFile[‘tmp_name’] was a path to a non-existent file, so I’m guessing your proxy was possibly having trouble with that.

Regards,

Warren.

Thanks for the info. That seems like a common mistake. I’ll try to see if I can fix something on our end or in the SDK to prevent this!