azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

create CDN met error: conflict

Open yungezz opened this issue 8 years ago • 6 comments

when calling cdn module to create a CDN profile, met error: conflict. The error is only reproduced in one of our test environment, but not others. We tracked down the x-ms-client-request-id for furthur investigation.

'x-ms-client-request-id': 'ac5feae4-a4f9-11e8-853b-000d3afd55c9'

azure-mgmt-cdn versoin: 3.0.0

error detail

The full traceback is:
2018-08-20 07:16:46   File "/tmp/ansible_azure_rm_cdnprofile_payload_axkmi9mq/__main__.py", line 229, in create_cdnprofile
2018-08-20 07:16:46     poller = self.cdn_management_client.profiles.create(self.resource_group, self.name, parameters)
2018-08-20 07:16:46   File "/usr/local/lib/python3.6/dist-packages/azure/mgmt/cdn/operations/profiles_operations.py", line 322, in create
2018-08-20 07:16:46     **operation_config
2018-08-20 07:16:46   File "/usr/local/lib/python3.6/dist-packages/azure/mgmt/cdn/operations/profiles_operations.py", line 272, in _create_initial
2018-08-20 07:16:46     raise models.ErrorResponseException(self._deserialize, response)
2018-08-20 07:16:46 
2018-08-20 07:16:46     "msg": "Error creating Azure CDN profile instance: Operation returned an invalid status code 'Conflict'"

code snippet

        parameters = Profile(
            location=self.location,
            sku=Sku(name=self.sku),
            tags=self.tags
        )

        try:
            poller = self.cdn_management_client.profiles.create(self.resource_group, self.name, parameters)
            response = self.get_poller_result(poller)
            return cdnprofile_to_dict(response)
        except ErrorResponseException as exc:

yungezz avatar Aug 21 '18 05:08 yungezz

Hi @prakharsharma10, @nachakra Do you know what circumstances would result in this 'Conflict' error?

annatisch avatar Aug 24 '18 00:08 annatisch

When you say test environment, is this testing against prod or dogfood ARM? One reason for conflict could be that somehow 2 profiles were being created with the same name under the same subscription/Resource Group. I don't know if that's a possibility for these tests.

nachakra avatar Aug 24 '18 16:08 nachakra

@nachakra I'm saying testing against a test only environment, and we've checked there's no profiles at all in the subscription before do creating. and same tests could pass on another environment/subscription.

yungezz avatar Aug 27 '18 01:08 yungezz

closed since we've got service team's help figured out root cause

yungezz avatar Oct 29 '18 01:10 yungezz

Same issue, any solution? Also using a test subscription. Thanks

Damien-Displayr avatar Oct 30 '18 23:10 Damien-Displayr

my issue is resolved by: register CDN as a resource provider in subscription. https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services#portal

yungezz avatar Oct 31 '18 02:10 yungezz