Azure / Azure/azure-sdk-tools

[JS] Syntax error reported in generating code

Open
#10,905 2 comments 0 reactions 2 assignees Claimed by @MaryGao View on GitHub
Automation Tool Mgmt-EngSys
Dominant language
C#
Stars
135
Forks
260
Avg merge
3d 2h
Merged PRs (30d)
130

Description

Repro spec PR
[PR#34886](https://github.com/Azure/azure-rest-api-specs/pull/34886)

[Pipeline run](https://dev.azure.com/azure-sdk/public/_build/results?buildId=4977374&view=logs&j=83516c17-6666-5250-abde-63983ce72a49&t=00be4b52-4a63-5865-8e02-c61723ad0692&l=586)

Detail errors:
```powershell
06:55:23.800 cmdout [automation_generate.sh] fatal | SyntaxError: Unterminated string literal. (4604:43)
06:55:23.800 cmdout [automation_generate.sh] 4602 | }
06:55:23.801 cmdout [automation_generate.sh] 4603 | ,"csvEscape": {
06:55:23.801 cmdout [automation_generate.sh] 4604 | defaultValue: """,constraints: {
06:55:23.801 cmdout [automation_generate.sh] | ^
06:55:23.801 cmdout [automation_generate.sh] 4605 | MaxLength: 1,
06:55:23.801 cmdout [automation_generate.sh] 4606 | MinLength: 1,
06:55:23.801 cmdout [automation_generate.sh] 4607 | }
07:54:48.278 cmdout E [automation_generate.sh] [ERROR]: Failed to generate SDK for package 'undefined' due to Error: Failed to generate codes for readme file: "specification/securityinsights/resource-manager/readme.md":
07:54:48.278 cmdout [automation_generate.sh] Err: Error: spawnSync /bin/sh ETIMEDOUT
07:54:48.278 cmdout [automation_generate.sh] Stderr: "null"
07:54:48.278 cmdout [automation_generate.sh] Stdout: "null"
07:54:48.278 cmdout [automation_generate.sh] ErrorStack: "Error: spawnSync /bin/sh ETIMEDOUT
07:54:48.279 cmdout [automation_generate.sh] at Object.spawnSync (node:internal/child_process:1120:20)
07:54:48.279 cmdout [automation_generate.sh] at spawnSync (node:child_process:868:24)
07:54:48.279 cmdout [automation_generate.sh] at execSync (node:child_process:949:15)
07:54:48.279 cmdout [automation_generate.sh] at generateMgmt (file:///opt/hostedtoolcache/node/22.13.1/x64/lib/node_modules/@azure-tools/js-sdk-release-tools/dist/hlc/generateMgmt.js:39:13)
07:54:48.279 cmdout [automation_generate.sh] at automationGenerateInPipeline (file:///opt/hostedtoolcache/node/22.13.1/x64/lib/node_modules/@azure-tools/js-sdk-release-tools/dist/autoGenerateInPipeline.js:22:23)"
07:54:48.279 cmdout [automation_generate.sh] at generateMgmt (file:///opt/hostedtoolcache/node/22.13.1/x64/lib/node_modules/@azure-tools/js-sdk-release-tools/dist/hlc/generateMgmt.js:42:19)
07:54:48.279 cmdout [automation_generate.sh] at automationGenerateInPipeline (file:///opt/hostedtoolcache/node/22.13.1/x64/lib/node_modules/@azure-tools/js-sdk-release-tools/dist/autoGenerateInPipeline.js:22:23).
07:54:48.280 cmdout E [automation_generate.sh] [ERROR]: Please review the detail errors for potential fixes.
07:54:48.280 cmdout E [automation_generate.sh] [ERROR]: If the issue persists, contact the support channel at https://aka.ms/azsdk/js-teams-channel and include this spec pull request.
07:54:48.280 cmdout E [automation_generate.sh] [ERROR]: Failed to generate codes for readme file: "specification/securityinsights/resource-manager/readme.md":

```

@kazrael2119
You suggested to add directive as a fix to this issue. Seems the new run still doesn't work.

In addition, could you also document this at the [trouble-shooting FAQ wiki](https://github.com/Azure/azure-rest-api-specs/wiki/SDK-Validation#net-sdk-generation-error-fix-guidance) so that the future user requests can be directed to this page?
CC: @MaryGao @wanlwanl

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.