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

404 Resource Not Found error when deleting a custom domain from a CDN endpoint #2842

Closed
2 of 6 tasks
praneetloke opened this issue May 12, 2019 · 6 comments
Closed
2 of 6 tasks
Labels
Client This issue points to a problem in the data-plane of the library. 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 - CDN

Comments

@praneetloke
Copy link

praneetloke commented May 12, 2019

  • Package Name: @azure/arm-cdn
  • Package Version: 4.2.0
  • Operating system: Windows 10 Pro
  • nodejs
    • version:
  • browser
    • name/version: 8.11.2
  • typescript
    • version: 3.4.5
  • Is the bug related to documentation in

Describe the bug
CdnManagement.customDomains.deleteMethod fails with a 404 Not Found error after a few seconds of waiting. It seems like the deleteMethod is querying for the custom domain to check if it is deleted and eventually results in a 404 after it is deleted, giving the false impression that the delete failed. But the delete itself actually succeeds.

To Reproduce
Steps to reproduce the behavior:

  1. Create a custom domain for a CDN endpoint using cdnClient.customDomains.create(...)
  2. Delete the custom domain using cdnClient.customDomains.deleteMethod(...)
  3. The call to deleteMethod will take a few seconds to complete, possibly because of long polling? After a few seconds, the call fails with a 404 Not Found.

Here's the stringified response:

{ Error: The requested resource was not found.
        at new RestError (C:\.......\node_modules\@azure\ms-rest-js\lib\restError.ts:18:5)
        at C:\.....\node_modules\@azure\ms-rest-js\lib\policies\deserializationPolicy.ts:117:27
        at <anonymous>
        at process._tickCallback (internal/process/next_tick.js:188:7)
      code: 'NotFound',
      statusCode: 404,
      request:
       WebResource {
         streamResponseBody: undefined,
         url: 'https://management.azure.com/subscriptions/xxxxxxxxxxxx/resourcegroups/nyp-group-test/providers/Microsoft.Cdn/operationresults/78798702-724a-4a5d-8e13-db333495bbd1/profileresults/nyp-cdn-profile-test-dev/endpointresults/nyp-cdn-endpoint-test/customdomainresults/dev?api-version=2017-10-12',
         method: 'GET',
         headers: HttpHeaders { _headersMap: [Object] },
         body: undefined,
         query: undefined,
         formData: undefined,
         withCredentials: false,
         abortSignal: undefined,
         timeout: 0,
         onUploadProgress: undefined,
         onDownloadProgress: undefined,
         proxySettings: undefined,
         operationSpec:
          { httpMethod: 'DELETE',
            path: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}',
            urlParameters: [Array],
            queryParameters: [Array],
            headerParameters: [Array],
            responses: [Object],
            serializer: [Object] },
         shouldDeserialize: true,
         operationResponseGetter: [Function: getOperationResponse] },
      response:
       { body: '{\r\n  "error": {\r\n    "code": "NotFound",\r\n    "message": "The requested resource was not found."\r\n  }\r\n}',
         headers: HttpHeaders { _headersMap: [Object] },
         status: 404 },
      body:
       { error:
          { code: 'NotFound',
            message: 'The requested resource was not found.' } } }

Expected behavior
The call to deleteMethod returns a 2xx success code.

Screenshots
N/A

Additional context
N/A

@amarzavery amarzavery added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label May 14, 2019
@amarzavery amarzavery added Network - CDN Mgmt This issue is related to a management-plane library. labels May 14, 2019
@amarzavery
Copy link
Contributor

@daschult - Any idea what is happening in the polling of this Long Running Operation?

@amarzavery amarzavery added the Client This issue points to a problem in the data-plane of the library. label May 14, 2019
@praneetloke
Copy link
Author

Ping.

@amarzavery
Copy link
Contributor

@praneetloke - New version of @azure/ms-rest-azure-js has been published. Please delete the node_modules folder and execute npm i again. Make sure that 1.3.6 version of @azure/ms-rest-azure-js has been installed. npm list @azure/ms-rest-azure-js.

Let us know if this solves the problem.

@praneetloke
Copy link
Author

praneetloke commented Jun 4, 2019

@amarzavery While there isn't a 404 anymore, I get this error now. It looks like this might related to this line from PR you merged?

Note that I removed my subscription ID from the stacktrace below.

EDIT: I have tracked-down this problem to the latest version 1.8.8 of @azure/ms-rest-js, which is what @azure/ms-rest-azure-js 1.3.6 depends on.

{ Error: Error "SyntaxError: Unexpected token o in JSON at position 1" occurred while parsing the response body - [object Object].
        at new RestError (/home/vsts/work/1/s/pulumi-stack/node_modules/@azure/ms-rest-js/lib/restError.ts:18:5)
        at errorHandler (/home/vsts/work/1/s/pulumi-stack/node_modules/@azure/ms-rest-js/lib/policies/deserializationPolicy.ts:196:15)
        at process._tickCallback (internal/process/next_tick.js:68:7)
      code: 'PARSE_ERROR',
      statusCode: 200,
      request:
       WebResource {
         streamResponseBody: undefined,
         url:
          'https://management.azure.com/subscriptions/xxxxxxx/resourcegroups/nyp-group-test/providers/Microsoft.Cdn/operationresults/1fcfc5a2-41ab-4e68-864b-4d8f1d70caef?api-version=2017-10-12',
         method: 'GET',
         headers: HttpHeaders { _headersMap: [Object] },
         body: undefined,
         query: undefined,
         formData: undefined,
         withCredentials: false,
         abortSignal: undefined,
         timeout: 0,
         onUploadProgress: undefined,
         onDownloadProgress: undefined,
         proxySettings: undefined,
         operationSpec:
          { httpMethod: 'DELETE',
            path:
             'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}',
            urlParameters: [Array],
            queryParameters: [Array],
            headerParameters: [Array],
            responses: [Object],
            serializer: [Serializer] },
         operationResponseGetter: [Function: getOperationResponse] },
      response:
       { request:
          WebResource {
            streamResponseBody: undefined,
            url:
             'https://management.azure.com/subscriptions/xxxxx/resourcegroups/nyp-group-test/providers/Microsoft.Cdn/operationresults/1fcfc5a2-41ab-4e68-864b-4d8f1d70caef?api-version=2017-10-12',
            method: 'GET',
            headers: [HttpHeaders],
            body: undefined,
            query: undefined,
            formData: undefined,
            withCredentials: false,
            abortSignal: undefined,
            timeout: 0,
            onUploadProgress: undefined,
            onDownloadProgress: undefined,
            proxySettings: undefined,
            operationSpec: [Object],
            operationResponseGetter: [Function: getOperationResponse] },
         status: 200,
         headers: HttpHeaders { _headersMap: [Object] },
         readableStreamBody: undefined,
         bodyAsText: { status: 'Succeeded', error: [Object] } },
      body:
       { status: 'Succeeded', error: { code: 'None', message: null } } }

@amarzavery
Copy link
Contributor

amarzavery commented Jun 5, 2019

@praneetloke - Please delete the node_modules folder and re-install "@azure/ms-rest-azure-js": "^1.3.7". This should bring with it "1.8.10" version of @azure/ms-rest-js".

The issue should be fixed. Let me know if you see further issues.

@praneetloke
Copy link
Author

praneetloke commented Jun 5, 2019

@amarzavery using those versions worked! Please feel free to close this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. 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 - CDN
Projects
None yet
Development

No branches or pull requests

2 participants