如何解释来自 Forge Automation API 的此错误消息?

Posted

技术标签:

【中文标题】如何解释来自 Forge Automation API 的此错误消息?【英文标题】:How to interpret this error message from Forge Automation API? 【发布时间】:2021-10-04 17:15:51 【问题描述】:

我正在尝试在自动化 API 中执行 iLogic 脚本。该模型并不小,因此我将其作为单个 24MB zip 文件上传。这是我的 Activity 的样子:


  "commandLine": [
    "$(engine.path)\\InventorCoreConsole.exe /i \"$(args[inputFile].path)\" /s \"$(args[iLogicVb].path)\""
  ],
  "parameters": 
    "iLogicVb": 
      "verb": "get",
      "localName": "input.iLogicVb"
    ,
    "outputFile": 
      "verb": "put",
      "localName": "output.pdf"
    ,
    "inputFile": 
      "verb": "get",
      "zip": true
    
  ,
  "id": "<myidhere>",
  "engine": "Autodesk.Inventor+2021",
  "appbundles": [],
  "description": "Running iLogic Rule"

这就是我的 Workitem 的样子:


    "activityId": "<myidhere>",
    "arguments": 
        "outputFile": 
            "verb": "put",
            "localName": "output.pdf",
            "url": "https://developer.api.autodesk.com/oss/v2/buckets/...",
            "headers": 
                "Content-type": "application/octet-stream",
                "Authorization": "..."
            
        ,
        "inputFile": 
            "verb": "get",
            "pathInZip": "<assembly name>.iam",
            "url": "https://developer.api.autodesk.com/oss/v2/buckets/...",
            "headers": 
                "Content-type": "application/octet-stream",
                "Authorization": "..."
            
        ,
        "iLogicVb": 
            "url": "https://developer.api.autodesk.com/oss/v2/buckets/...",
            "verb": "get",
            "localName": "input.iLogicVb",
            "headers": 
                "Content-type": "application/octet-stream",
                "Authorization": "..."
            
        
    

而且 iLogic 代码非常简单:

Trace.WriteLine ("Starting rules")
ObjectWidth = 4 ft
ObjectHeight = 7 ft

Trace.WriteLine ("Saving PDF")
oDoc.SaveAs("output.pdf", true)
Trace.WriteLine ("Done")

根据执行报告,zip文件已成功下载并解压缩,但随后出现问题:

[07/29/2021 01:48:58] Starting work item 9b0e77a3f2d14d21b09d2eaee7652a81
[07/29/2021 01:48:58] Start download phase.
[07/29/2021 01:48:58] Start downloading input: verb - 'GET', url - 'https://developer.api.autodesk.com/oss/v2/buckets/.../objects/input.iLogicVb'
[07/29/2021 01:48:58] Start downloading input: verb - 'GET', url - 'https://developer.api.autodesk.com/oss/v2/buckets/.../objects/....zip'
[07/29/2021 01:48:58] '304' bytes have been written to T:\Aces\Jobs\9b0e77a3f2d14d21b09d2eaee7652a81\input.iLogicVb.
[07/29/2021 01:48:58] End downloading file from 'https://developer.api.autodesk.com/oss/v2/buckets/.../objects/input.iLogicVb'.
[07/29/2021 01:48:59] '24085650' bytes have been written to T:\Aces\Jobs\9b0e77a3f2d14d21b09d2eaee7652a81\zip_112.zip.
[07/29/2021 01:48:59] End downloading file from 'https://developer.api.autodesk.com/oss/v2/buckets/.../objects/....zip'.
[07/29/2021 01:49:00] T:\Aces\Jobs\9b0e77a3f2d14d21b09d2eaee7652a81\zip_112.zip has been unpacked to folder T:\Aces\Jobs\9b0e77a3f2d14d21b09d2eaee7652a81\unpack_folder_113.
[07/29/2021 01:49:00] End download phase successfully.
[07/29/2021 01:49:00] Start preparing script and command line parameters.
[07/29/2021 01:49:00] Error: The 'path2' is not defined.
[07/29/2021 01:49:00] Error: An unexpected error happened during phase CoreEngineExecution of job.
[07/29/2021 01:49:00] Job finished with result FailedExecution

而这个The 'path2' is not defined 是绝对神秘的、不可搜索的错误。什么可能导致它?也许有一个标志可以增加输出的详细程度以查看更多信息?

【问题讨论】:

【参考方案1】:

Activity 中的“inputFile”需要“localName”属性。将其设置为我的 zip 文件的实际名称解决了此错误。虽然这并没有让信息变得不那么神秘。

【讨论】:

【参考方案2】:

@thesame,感谢您的报告。我认为这是我们将修复的一个错误。

【讨论】:

以上是关于如何解释来自 Forge Automation API 的此错误消息?的主要内容,如果未能解决你的问题,请参考以下文章

将 Forge Node.js SDK 与“Forge Design Automation v3”一起使用

尝试发布 Autodesk Forge Design Automation 应用程序包时出现 AWS 错误

Forge API - Design Automation Inventor 2022 兼容性

来自外部数据库的 Autodesk Forge Viewer 放置点

如何在 Forge 查看器中聚合 2D 和 3D 文档?

利用Azure Automation实现云端自动化运维