Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[arm-dns] Client hangs when trying to create recordSet #6152

Closed
1 of 6 tasks
SkyaTura opened this issue Nov 12, 2019 · 8 comments
Closed
1 of 6 tasks

[arm-dns] Client hangs when trying to create recordSet #6152

SkyaTura opened this issue Nov 12, 2019 · 8 comments
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. Network - DNS Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@SkyaTura
Copy link

SkyaTura commented Nov 12, 2019

  • Package Name: @azure/arm-dns
  • Package Version: 3.2.0
  • Operating system: MacOS Mojave 10.14.16
  • nodejs
    • version: v10.16.3
  • browser
    • name/version: N/A
  • typescript
    • version: N/A
  • Is the bug related to documentation in

Describe the bug
DnsManagementClient won't createOrUpdate a recordSet.

When trying to use recordSets.createOrUpdate() method, the client hangs for a while and then throws an InternalServerError.

While this may be related with #420, it's important to notice that, for me, other methods like get and list works fine. Only recordSets.createOrUpdate() is failing.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new project with npm init
  2. Install both @azure/ms-rest-nodeatuh and @azure/arm-dns
  3. Create the index.js file
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import { DnsManagementClient } from "@azure/arm-dns";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
 
msRestNodeAuth.interactiveLogin().then((creds) => {
  const client = new DnsManagementClient(creds, subscriptionId);
  const resourceGroupName = "testresourceGroupName";
  const zoneName = "testzoneName";
  const relativeRecordSetName = "testrelativeRecordSetName";
  const recordType = "TXT";
  const parameters = {
    TTL: 5,
    TXTRecords: [{ value: ['test'] }],
  };
  client.recordSets.set(
    resourceGroupName,
    zoneName,
    relativeRecordSetName,
    recordType,
    parameters
  ).then((result) => {
    console.log("The result is:");
    console.log(result);
  });
}).catch((err) => {
  console.error(err);
});
  1. Define your subcription id as environmental variable
  2. Run the application with node

Expected behavior
The record set with relative path testrelativeRecordSetName and type TXT to be created on the DNS Zone with name testzoneName and resource group testresourceGroupName at my subscription.

Additional context
Error log:

{ Error: {"code":"InternalServerError","message":""}
    at new RestError (XXX/node_modules/@azure/ms-rest-js/lib/restError.ts:18:5)
    at XXX/node_modules/@azure/ms-rest-js/lib/policies/deserializationPolicy.ts:117:27
    at process._tickCallback (internal/process/next_tick.js:68:7)
  code: 'InternalServerError',
  statusCode: 500,
  request:
   WebResource {
     streamResponseBody: false,
     url:
      'https://management.azure.com/subscriptions/XXX/resourceGroups/XXX/providers/Microsoft.Network/dnsZones/XXX/TXT/teste?api-version=2018-05-01',
     method: 'PUT',
     headers: HttpHeaders { _headersMap: [Object] },
     body: '{}',
     query: undefined,
     formData: undefined,
     withCredentials: false,
     abortSignal: undefined,
     timeout: 0,
     onUploadProgress: undefined,
     onDownloadProgress: undefined,
     proxySettings: undefined,
     operationSpec:
      { httpMethod: 'PUT',
        path:
         'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}',
        urlParameters: [Array],
        queryParameters: [Array],
        headerParameters: [Array],
        requestBody: [Object],
        responses: [Object],
        serializer: [Serializer] } },
  response:
   { body: '{"code":"InternalServerError","message":""}',
     headers: HttpHeaders { _headersMap: [Object] },
     status: 500 },
  body: { code: 'InternalServerError', message: '' },
  innerError:
   { Error: {"code":"InternalServerError","message":""}
       at new RestError (XXX/node_modules/@azure/ms-rest-js/lib/restError.ts:18:5)
       at XXX/node_modules/@azure/ms-rest-js/lib/policies/deserializationPolicy.ts:117:27
       at process._tickCallback (internal/process/next_tick.js:68:7)
     code: 'InternalServerError',
     statusCode: 500,
     request:
      WebResource {
        streamResponseBody: false,
        url:
         'https://management.azure.com/subscriptions/XXX/resourceGroups/XXX/providers/Microsoft.Network/dnsZones/XXX/TXT/teste?api-version=2018-05-01',
        method: 'PUT',
        headers: [HttpHeaders],
        body: '{}',
        query: undefined,
        formData: undefined,
        withCredentials: false,
        abortSignal: undefined,
        timeout: 0,
        onUploadProgress: undefined,
        onDownloadProgress: undefined,
        proxySettings: undefined,
        operationSpec: [Object] },
     response:
      { body: '{"code":"InternalServerError","message":""}',
        headers: [HttpHeaders],
        status: 500 },
     body: { code: 'InternalServerError', message: '' },
     innerError:
      { Error: {"code":"InternalServerError","message":""}
          at new RestError (XXX/node_modules/@azure/ms-rest-js/lib/restError.ts:18:5)
          at XXX/node_modules/@azure/ms-rest-js/lib/policies/deserializationPolicy.ts:117:27
          at process._tickCallback (internal/process/next_tick.js:68:7)
        code: 'InternalServerError',
        statusCode: 500,
        request: [WebResource],
        response: [Object],
        body: [Object] } } }
@maggiepint maggiepint added customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. Network - DNS labels Nov 20, 2019
@maggiepint maggiepint added the Service Attention Workflow: This issue is responsible by Azure service team. label Nov 20, 2019
@ghost
Copy link

ghost commented Nov 20, 2019

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @sfiguemsft

@sfiguemsft
Copy link
Member

@KarenHammons @rohinkoul can you look into this please?

@sfiguemsft
Copy link
Member

@karravi-msft looks like the operation is failing with a 5xx error which can be due to problems in ARM or DNS frontend - can you look into this please?

@qiaozha
Copy link
Member

qiaozha commented Nov 22, 2019

@SkyaTura I think your parameters definition is not right. you can refer to line 270 to 453 of sdk/dns/arm-dns/src/models/mappers.ts. parameters here should have common properties of a RecordSet. So I changed the parameters properties TTL to tTL, TXTRecords to txtRecords and found it succeeded.

@qiaozha qiaozha added Mgmt This issue is related to a management-plane library. and removed Mgmt This issue is related to a management-plane library. labels Nov 22, 2019
@SkyaTura
Copy link
Author

I'll check it as soon as possible, but in that case, the error shouldn't be 4xx?

@qiaozha
Copy link
Member

qiaozha commented Nov 25, 2019

I feel that's strange too, but I did change the parameter properties and it works for me. If problem still exists, I need to involve relevant team to take a look.

@SkyaTura
Copy link
Author

I've tried as you said and that worked fine.

@ghost
Copy link

ghost commented Nov 26, 2019

Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. Network - DNS Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

4 participants