Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

autodesk - Receiving 408 request timeout when we try to put an object to a Forge bucket

We are trying to upload a 'bigger' model to a forge bucket via the model derivative API. This model has a file size of 956MB and the extension .nwd

const uploadPromise = http(uploadUrl(socketId), {
    method: 'PUT',
    data: Body,
    headers: {
        'Content-Type': 'application/octet-stream',
        Authorization: `Bearer ${Forge.urns[socketId].autoDeskToken}`,
    },
    maxContentLength: 1024 * 1024 * 1024,
    timeout: 600000,
})

{ Error: Request failed with status code 408
  at createError (/nodejs/node_modules/axios/lib/core/createError.js:16:15)
  at settle (/nodejs/node_modules/axios/lib/core/settle.js:18:12)
  at IncomingMessage.handleStreamEnd (/nodejs/node_modules/axios/lib/adapters/http.js:202:11)
  at IncomingMessage.emit (events.js:203:15)
  at IncomingMessage.EventEmitter.emit (domain.js:448:20)
  at endReadableNT (_stream_readable.js:1145:12)
  at process._tickCallback (internal/process/next_tick.js:63:19)

The url seems to be correct: https://developer.api.autodesk.com/oss/v2/buckets/-BUCKETNAME-/objects/-filename-.nwd

What could be the reason of this error?

This is a problem a customer is experiencing.

kind regards, Thomas

question from:https://stackoverflow.com/questions/65921252/receiving-408-request-timeout-when-we-try-to-put-an-object-to-a-forge-bucket

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

That's interesting, the error code 408 is not listed in the documentation of the endpoint: https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectName-PUT. The error code is most likely coming from some middle-layer (Apigee), and not from the Forge servers directly.

However, to upload a file this big, I'd strongly suggest using the "resumable upload" feature that's available in the Data Management service. You can find an example of how the resumable upload works in my TypeScript code here: https://github.com/petrbroz/vscode-forge-tools/blob/develop/src/commands/data-management.ts#L230-L272.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...