Azure / autorest.az

Azure CLI Code Generator
MIT License
22 stars 20 forks source link

Error: Plugin azentry reported failure. (Better error message for codegen tool) #777

Closed qwordy closed 3 years ago

qwordy commented 3 years ago

Recently, I used autorest to generate an Azure CLI extension. I wrote the following config.

az:
  extensions: cloud-service
  namespace: azure.mgmt.compute
  package-name: azure-mgmt-compute
az-output-folder: $(azure-cli-extension-folder)/src/cloudservice

I got

C:\Users\fey\.autorest\@autorest_az@1.7.3\node_modules\@autorest\az\dist\src\entry.js - FAILURE  {} TypeError: Cannot read property 'replace' of undefined
    at processFolderPath (C:\Users\fey\.autorest\@autorest_az@1.7.3\node_modules\@autorest\az\dist\src\entry.js:142:43)
    at Entry.<anonymous> (C:\Users\fey\.autorest\@autorest_az@1.7.3\node_modules\@autorest\az\dist\src\entry.js:36:13)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\fey\.autorest\@autorest_az@1.7.3\node_modules\@autorest\az\dist\src\entry.js:5:58)
PLUGIN FAILURE: Cannot read property 'replace' of undefined, TypeError: Cannot read property 'replace' of undefined
    at processFolderPath (C:\Users\fey\.autorest\@autorest_az@1.7.3\node_modules\@autorest\az\dist\src\entry.js:142:43)
    at Entry.<anonymous> (C:\Users\fey\.autorest\@autorest_az@1.7.3\node_modules\@autorest\az\dist\src\entry.js:36:13)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\fey\.autorest\@autorest_az@1.7.3\node_modules\@autorest\az\dist\src\entry.js:5:58), {}
FATAL: TypeError: Cannot read property 'replace' of undefined
C:\Users\fey\.autorest\@autorest_core@3.0.6306\node_modules\@autorest\core\dist\lib\pipeline\pipeline.js - FAILURE {}
Process() cancelled due to exception : Plugin azentry reported failure. / Error: Plugin azentry reported failure.
    at C:\Users\fey\.autorest\@autorest_core@3.0.6306\node_modules\@autorest\core\dist\lib\pipeline\plugins\external.js:26:19
    at async ScheduleNode (C:\Users\fey\.autorest\@autorest_core@3.0.6306\node_modules\@autorest\core\dist\lib\pipeline\pipeline.js:294:33)
  Error: Plugin azentry reported failure.

I spent lots of time debugging. Then I consulted author of autorest. I was told

python-sdk-output-folder: "$(az-output-folder)/azext_cloudservice/vendored_sdks/cloudservice"

is mandatory no matter whether I want to generate Python SDK. I appeal to give a meaningful error message that tells me python-sdk-output-folder is missing.

lirenhe commented 3 years ago

Fixed