【问题标题】:AWS error when trying to publish an Autodesk Forge Design Automation App bundle尝试发布 Autodesk Forge Design Automation 应用程序包时出现 AWS 错误
【发布时间】:2020-06-14 18:24:58
【问题描述】:

按照此处描述的步骤操作时:https://forge.autodesk.com/en/docs/design-automation/v3/tutorials/revit/step4-publish-appbundle/#step-3-upload-the-appbundle 我收到 Aws 特定错误。

<Error><Code>AccessDenied</Code><Message>No AWSAccessKey was presented.</Message>

我已经验证了我的请求,但似乎标题和所有表单数据都已正确设置,如下例所述:

curl -X POST \
  https://dasprod-store.s3.amazonaws.com \
  -H 'Cache-Control: no-cache' \
  -F key=apps/Revit/DeleteWallsApp/1 \
  -F content-type=application/octet-stream \
  -F policy=eyJleHBpcmF0aW9uIjoiMjAxOC... (truncated) \
  -F success_action_status=200 \
  -F success_action_redirect= \
  -F x-amz-signature=6c68268e23ecb8452... (truncated) \
  -F x-amz-credential=ASIAQ2W... (truncated) \
  -F x-amz-algorithm=AWS4-HMAC-SHA256 \
  -F x-amz-date=20180810... (truncated) \
  -F x-amz-server-side-encryption=AES256 \
  -F 'x-amz-security-token=FQoGZXIvYXdzEPj//////////wEaDHavu... (truncated)' \
  -F 'file=@path/to/your/app/zip'

当然,所有值都已替换为收到的响应

curl -X POST \
  https://developer.api.autodesk.com/da/us-east/v3/appbundles \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": "DeleteWallsApp",
  "engine": "Autodesk.Revit+2018",
  "description": "Delete Walls AppBundle based on Revit 2018"
}'

现在,由于这是 AWS 特定的错误,也许 AWS api 已经发生了一些变化,并且 forge 文档中给出的示例不是最新的吗?

【问题讨论】:

    标签: amazon-s3 autodesk-forge autodesk autodesk-designautomation


    【解决方案1】:

    这似乎是客户端问题。

    我在 node.js 中使用 request npm 包,并将 formData 设置为 form 属性的一部分,而不是 formData 属性。

    const request = require('request-promise');
    
    return request.post(uploadParameters.endpointURL, {
      headers: {
       'Content-Type': 'multipart/form-data',
       'Cache-Control': 'no-cache'
      },
      formData: { // use formData instead of form
       ...uploadParameters.formData,
       file: fs.createReadStream(EXPECTED_APPBUNDLE_PATH)
      }
    })
    
    

    【讨论】:

      【解决方案2】:

      很高兴你知道发生了什么:)

      如果您想要设计自动化的 nodejs 示例/示例,您可以查看此存储库。即使它是为 3ds Max 构建的,但设计自动化概念仍然相同。

      https://github.com/Autodesk-Forge/design.automation.3dsmax-nodejs-basic/blob/master/createAndUploadApp.js

      希望里面的东西对你有用。

      【讨论】:

        猜你喜欢
        • 2020-11-19
        • 2020-05-18
        • 2012-06-30
        • 2021-08-16
        • 2020-09-12
        • 2018-06-04
        • 2020-04-02
        • 2021-08-29
        • 2021-08-15
        相关资源
        最近更新 更多