upload: HTTP Bad Gateway upon upload

Issue #83 resolved
Trek Hopton created an issue

When trying to upload via the upload page, after the upload progress completes, a 502 Bad Gateway error is received from nginx.

This bug was encountered on multiple machines from different networks when trying to upload various .ts files after selecting Benham Lab on vidgrind. Permissions for MIDs and sites were correctly set.

Comments (5)

  1. Alan Noble

    Media uploads worked fine previously so this is a regression. Please investigate any recent changes relating to that code.

  2. Saxon Milton

    There is a panic occurring on line https://bitbucket.org/ausocean/vidgrind/src/645dd3c68e9f6dd47e30429a14478d17bee1642e/video.go#lines-276 where writeMtsMedia is called, which causes the bad gateway error code. The panic is due to the ts[0] argument (if len(ts)==0), which occurs when no timestamp is provided (which should be okay; the timestamp is denoted as an optional field on the upload UI). The provided timestamp is only used if a timestamp cannot be found from a PMT. I think the best solution would be to set ts == time.Now() if not provided on the UI. This would then only be used if no timestamp is in the MTS data.

  3. Log in to comment