504 Gateway Timeout on large file

504 Gateway Timeout on large file

jordanmarr
Enthusiast Enthusiast
2,357 Views
5 Replies
Message 1 of 6

504 Gateway Timeout on large file

jordanmarr
Enthusiast
Enthusiast

I am workign on a web app that manages uploading Revit files to a bucket.  I am using the "resumable" oss API method and I have had consistent success uploading files that are within the 1MB - 100MB range.  However, I am having problems trying to upload a 195MB Revit model.  I am breaking it into 10 20Mb segments.  At some point I end up with the following errors: 

 

Failed to load resource: the server responded with a status of 504 (Gateway Timeout)

 

XMLHttpRequest cannot load https://developer.api.autodesk.com/oss/v1/buckets/jmarr_persistent/objects/Test%2520Model%2520MEP%25202014.rvt/resumable.

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 504.

 

It did upload all the way once, but the status call returned an error stating that it was not a Revit file or was created with an unsupported version (it was created using Revit 2014).  All subsequent upload attempts have failed with the above errors.  

 

I did notice that https://developer.autodesk.com/api/view-and-data-api/ page gives the following guideline:

We recommend file sizes of max 150 MB for single file uploads.

 

I was hoping that using the "/resumable" method and breaking the file into multiple segments would get me around this limitation.  Am I going about this the right way?

 

Thanks,

Jordan

 

Reply
Reply
0 Likes
2,358 Views
5 Replies
Replies (5)
Message 2 of 6

philippe.leefsma
Alumni
Alumni

Hi Jordan,

 

We have an internal js librairie that handles file chucking for large upload. Let me check with the development team if I can share all or part of that code with you.

 

I will let you know shortly.

 

Thanks,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Reply
Reply
0 Likes
Message 3 of 6

Anonymous
Not applicable

Hi, 

 

I started having this same issue when trying the simple upload and was told by Wesley Miao to use this library I think you are refering, that split and send the files in chunks. https://git.autodesk.com/cloudplatform-storage/oss-sdk-js/blob/master/scripts/Autodesk.Data.OSS.js

 

After implementing that on my application, I can see that the file is being sent like in several requests/threads to the resumable endpoint, but even though some times (randomly), I get these: 

"Failed to load resource: the server responded with a status of 504 (Gateway Timeout)" and

"XMLHttpRequest cannot load https://developer.api.autodesk.com/oss/v1/buckets/XXX/objects/XXX.rvt/resumable. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://local.aquila.autodesk.com:3000' is therefore not allowed access. The response had HTTP status code 504."

from some of those requests/threads which messes the entire upload, failing it, and even giving progress values over 1.0.

 

{"bytes":30109696,"totalBytes":30158848,"bytesAcknowledged":13381632,"progress":0.9983702295260084,"completedFileCount":0}
{"bytes":30142464,"totalBytes":30158848,"bytesAcknowledged":13381632,"progress":0.9994567431753362,"completedFileCount":0}
{"bytes":30175232,"totalBytes":30158848,"bytesAcknowledged":13381632,"progress":1.000543256824664,"completedFileCount":0}
{"bytes":30191616,"totalBytes":30158848,"bytesAcknowledged":13381632,"progress":1.0010865136493277,"completedFileCount":0}
{"bytes":30224384,"totalBytes":30158848,"bytesAcknowledged":13381632,"progress":1.0021730272986555,"completedFileCount":0}
{"bytes":30240768,"totalBytes":30158848,"bytesAcknowledged":13381632,"progress":1.0027162841233193,"completedFileCount":0}

 

Again, this is very random and often too. Maybe if I try 2 or 3 times with the same file I'm lucky and it gives no error.

 

Thanks,

Federico Rodriguez

Reply
Reply
0 Likes
Message 4 of 6

philippe.leefsma
Alumni
Alumni

So from the feedback of the development team, the v1 resumable API has an issue with 504 timeouts due to its merging process. This is getting fixed by the v2. 

 

v2 should be available in production now, although I didn't have time to try it yet...

 

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Reply
Reply
0 Likes
Message 5 of 6

Anonymous
Not applicable

Where can I fond doc on the V2 resuamble upload API? I'm am trying to upload a 700MB revit file, It fails with 504 on the last chunk. I've tried several times and it always fails at the same point.

 

Reply
Reply
0 Likes
Message 6 of 6

Anonymous
Not applicable

Hi Philippe,

 

I am struggling to upload an 80meg Revit file to a bucket. So I followed your instructions from another post recommending I use "resumableUpload" as part of the View-and-data module. This is working when only one chunk is set but fails with error 504 gateway timeout with two chunks. Is this still an error in your api?

Should I be able to upload an 80meg file without using "resumableUpload"? I can successfully upload a 50meg. Currently when I upload the 80meg file my Chrome browser actually crashes.

 

Any help appreciated as I need to get this file pushed for a customer.

 

Thanks

Bill Malcolm

Reply
Reply
0 Likes