Azure / autorest.az

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

Failed to generate postgresqlhsc az client #870

Open furkansahin opened 3 years ago

furkansahin commented 3 years ago

I am trying to generate an az extension code via autorest by running the following command from wsl2;

autorest --az --input-file="./azure-rest-api-specs/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/postgresqlhsc.json" --azure-cli-extension-folder=./azure-cli-extensions --sdk-no-flatten --verbose

However, it fails with the following error;

FATAL: TypeError: Cannot read property 'replace' of undefined
WARNING: [autorest.codegen._get_credential_param:151] You have default credential policy BearerTokenCredentialPolicybut not the --credential-scopes flag set while generating non-management plane code. This is not recommend because it forces the customer to pass credential scopes through kwargs if they want to authenticate.
  Error: Plugin azentry reported failure.

Here is the full verbose output

AutoRest code generation utility [cli version: 3.1.1; node: v12.22.2, max-memory: 2048 MB]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest

There is a new version of AutoRest available (3.3.2).
 > You can install the newer version with with npm install -g autorest@latest

   Loading AutoRest core      '/home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist' (3.5.1)
VERBOSE [0.56 s]: No configuration found at 'file:///home/furkan/Workspace/'.
VERBOSE [0.58 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/default-configuration.md'
VERBOSE [0.61 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/inspect.md'
VERBOSE [0.62 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/directives.md'
VERBOSE [0.64 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/pipeline.md'
VERBOSE [0.65 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/loader-openapi.md'
VERBOSE [0.66 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/miscellaneous.md'
VERBOSE [0.68 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/plugin-powershell.md'
VERBOSE [0.69 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/plugin-azureresourceschema.md'
VERBOSE [0.7 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/plugin-csharp.md'
VERBOSE [0.72 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/plugin-go.md'
VERBOSE [0.73 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/plugin-java.md'
VERBOSE [0.74 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/plugin-nodejs.md'
VERBOSE [0.76 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/plugin-php.md'
VERBOSE [0.77 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/plugin-python.md'
VERBOSE [0.78 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/plugin-ruby.md'
VERBOSE [0.79 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/plugin-typescript.md'
VERBOSE [0.81 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/plugin-validators.md'
VERBOSE [0.82 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/plugin-az.md'
VERBOSE [0.84 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/plugin-terraform.md'
VERBOSE [0.86 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/plugin-azure-functions.md'
VERBOSE [0.87 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/graphs.md'
VERBOSE [0.89 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_core@3.5.1/node_modules/@autorest/core/dist/resources/help-configuration.md'
INFORMATION: > Loading AutoRest extension '@autorest/az' (latest->1.7.2)
VERBOSE [1.29 s]: > Including extension configuration file 'file:///home/furkan/.autorest/@autorest_az@1.7.2/node_modules/@autorest/az/README.md'
VERBOSE [1.29 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_az@1.7.2/node_modules/@autorest/az/README.md'
VERBOSE [1.33 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_az@1.7.2/node_modules/@autorest/az/readme.az.common.md'
INFORMATION: > Loading AutoRest extension '@autorest/python' (5.4.0->5.4.0)
VERBOSE [1.42 s]: > Including extension configuration file 'file:///home/furkan/.autorest/@autorest_python@5.4.0/node_modules/@autorest/python/README.md'
VERBOSE [1.42 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_python@5.4.0/node_modules/@autorest/python/README.md'
INFORMATION: > Loading AutoRest extension '@autorest/clicommon' (0.6.1->0.6.1)
VERBOSE [1.49 s]: > Including extension configuration file 'file:///home/furkan/.autorest/@autorest_clicommon@0.6.1/node_modules/@autorest/clicommon/README.md'
VERBOSE [1.49 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_clicommon@0.6.1/node_modules/@autorest/clicommon/README.md'
INFORMATION: > Loading AutoRest extension '@autorest/modelerfour' (4.15.421->4.15.421)
VERBOSE [1.6 s]: > Including extension configuration file 'file:///home/furkan/.autorest/@autorest_modelerfour@4.15.421/node_modules/@autorest/modelerfour/readme.md'
VERBOSE [1.6 s]: > Including configuration file 'file:///home/furkan/.autorest/@autorest_modelerfour@4.15.421/node_modules/@autorest/modelerfour/readme.md'
VERBOSE [2.95 s]: Reading OpenAPI 2.0 file file:///home/furkan/Workspace/azure-rest-api-specs/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/postgresqlhsc.json
VERBOSE [3.04 s]: Reading $ref'd file file:///home/furkan/Workspace/azure-rest-api-specs/specification/common-types/resource-management/v1/types.json
VERBOSE [3.1 s]: Reading $ref'd file file:///home/furkan/Workspace/azure-rest-api-specs/specification/common-types/resource-management/v2/types.json
WARNING: Semantic violation: Sibling values alongside $ref will be ignored. See https://github.com/Azure/autorest/blob/main/docs/openapi/howto/$ref-siblings.md for allowed values (components > schemas > Operation > properties > display)
  keys: [ 'readOnly' ]
    - file:///home/furkan/Workspace/azure-rest-api-specs/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2020-10-05-privatepreview/postgresqlhsc.json ($)

WARNING (PreCheck/AllOfWhenYouMeantRef): Schema 'ProxyResource' is using an 'allOf' instead of a $ref. This creates a wasteful anonymous type when generating code.

WARNING (PreCheck/SchemaMissingType): The schema 'ServerProperties' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerRoleGroup' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerNameItem' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerGroupServerProperties' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerGroupServer' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerGroupServerListResult' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerGroupForUpdate' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerGroupPropertiesForUpdate' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerGroup' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerGroupProperties' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerGroupProperties-delegatedSubnetArguments' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerGroupConfiguration' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerGroupConfigurationProperties' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerRoleGroupConfiguration' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerGroupConfigurationListResult' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerConfigurationProperties' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerConfiguration' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ServerConfigurationListResult' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'FirewallRuleProperties' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'FirewallRule' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'FirewallRuleListResult' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'RoleProperties' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'Role' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'RoleListResult' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'OperationDisplay' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'Operation' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'NameAvailabilityRequest' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'NameAvailability' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'CloudError' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'CloudErrorBody' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'Resource' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'TrackedResource' with an undefined type and decalared properties is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/SchemaMissingType): The schema 'ProxyResource' with an undefined type and 'allOf'/'anyOf'/'oneOf' is a bit ambigious. This has been auto-corrected to 'type:object'

WARNING (PreCheck/CheckDuplicateSchemas): Checking for duplicate schemas, this could take a (long) while.  Run with --verbose for more detail.
VERBOSE [4.83 s]:   ModelerFour/api-version-mode:client
VERBOSE [4.83 s]:   ModelerFour/api-version-parameter:constant
VERBOSE [4.83 s]:   ModelerFour/use-model-namespace:false

WARNING (): Operation Update has already existed in group! Skip split!

WARNING (): cli.auto-parameter-hidden is not true, skip visibility cleaner
FATAL: TypeError: Cannot read property 'replace' of undefined
WARNING: [autorest.codegen._get_credential_param:151] You have default credential policy BearerTokenCredentialPolicybut not the --credential-scopes flag set while generating non-management plane code. This is not recommend because it forces the customer to pass credential scopes through kwargs if they want to authenticate.
  Error: Plugin azentry reported failure.

I have tried autorest --reset but no luck. Can you please help me understand what is wrong?