question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ResourceNotFound occurs if cluster is named differently than resource group

See original GitHub issue

When deploying SF cluster using ARM template, the error may occur at the end of deployment if cluster name is not the same as resource group name. I used ARM templates provided in repo service-fabric-api-management to deploy SF cluster. I specified clusterName parameter that is different from resource group name that I used to deploy the cluster. Each time I use cluster name that differs from the resource group, I get the following error message at the end of deployment:

urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/1168fb9b-4abe-4ecb-b8a7-d70f324ee0ee/resourceGroups/sf-linux/providers/Microsoft.ServiceFabric/clusters/sf-linux?api-version=2016-09-01 HTTP/1.1" 404 153
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/1168fb9b-4abe-4ecb-b8a7-d70f324ee0ee/resourceGroups/sf-linux/providers/Microsoft.ServiceFabric/clusters/sf-linux?api-version=2016-09-01'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger :     'User-Agent': 'python/3.6.1 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.19 msrest_azure/0.4.17 azure-mgmt-servicefabric/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.22'
msrest.http_logger :     'Accept-Encoding': 'gzip, deflate'
msrest.http_logger :     'Accept': 'application/json'
msrest.http_logger :     'Connection': 'keep-alive'
msrest.http_logger :     'Authorization': '*****'
msrest.http_logger :     'x-ms-client-request-id': 'a2de9d80-ec3d-11e7-8286-001c422c1884'
msrest.http_logger :     'CommandName': 'sf cluster create'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'accept-language': 'en-US'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.http_logger : Response status: 404
msrest.http_logger : Response headers:
msrest.http_logger :     'Cache-Control': 'no-cache'
msrest.http_logger :     'Pragma': 'no-cache'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'Expires': '-1'
msrest.http_logger :     'x-ms-failure-cause': 'gateway'
msrest.http_logger :     'x-ms-request-id': 'fdb228d8-6202-4139-9284-70ebe1b30100'
msrest.http_logger :     'x-ms-correlation-request-id': 'fdb228d8-6202-4139-9284-70ebe1b30100'
msrest.http_logger :     'x-ms-routing-request-id': 'CANADAEAST:20171229T022023Z:fdb228d8-6202-4139-9284-70ebe1b30100'
msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger :     'Date': 'Fri, 29 Dec 2017 02:20:22 GMT'
msrest.http_logger :     'Content-Length': '153'
msrest.http_logger : Response content:
msrest.http_logger : b'{"error":{"code":"ResourceNotFound","message":"The Resource \'Microsoft.ServiceFabric/clusters/sf-linux\' under resource group \'sf-linux\' was not found."}}'
msrest.exceptions : (ResourceNotFound) The Resource 'Microsoft.ServiceFabric/clusters/sf-linux' under resource group 'sf-linux' was not found.
(ResourceNotFound) The Resource 'Microsoft.ServiceFabric/clusters/sf-linux' under resource group 'sf-linux' was not found.
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\main.py", line 36, in main
    cmd_result = APPLICATION.execute(args)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\application.py", line 216, in execute
    result = expanded_arg.func(params)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\__init__.py", line 381, in __call__
    return self.handler(*args, **kwargs)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\__init__.py", line 640, in _execute_command
    raise client_exception
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\__init__.py", line 630, in _execute_command
    reraise(*sys.exc_info())
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\six.py", line 693, in reraise
    raise value
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\__init__.py", line 612, in _execute_command
    result = op(client, **kwargs) if client else op(**kwargs)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\command_modules\servicefabric\custom.py", line 277, in new_cluster
    output_dict['cluster'] = client.get(resource_group_name, cluster_name)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\mgmt\servicefabric\operations\clusters_operations.py", line 185, in get
    raise models.ErrorModelException(self._deserialize, response)
azure.mgmt.servicefabric.models.error_model.ErrorModelException: (ResourceNotFound) The Resource 'Microsoft.ServiceFabric/clusters/sf-linux' under resource group 'sf-linux' was not found.

It seems that at the end of cluster deployment CLI attempts to form a request to the cluster but it uses resource group name instead of the cluster name:

urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/1168fb9b-4abe-4ecb-b8a7-d70f324ee0ee/resourceGroups/sf-linux/providers/Microsoft.ServiceFabric/clusters/sf-linux?api-version=2016-09-01 HTTP/1.1" 404 153
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/1168fb9b-4abe-4ecb-b8a7-d70f324ee0ee/resourceGroups/sf-linux/providers/Microsoft.ServiceFabric/clusters/sf-linux?api-version=2016-09-01'

Environment summary

Install Method / Chocolatey
CLI version / azure-cli (2.0.22) with servicefabric (0.0.6)
OS version / Win10 Fall Creators Update
Shell Type / used both PowerShell and Bash on Windows

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
joergjocommented, Jan 17, 2018

This error can be avoided if you specify the --cluster-name parameter for az sf cluster create as well.

0reactions
msftbot[bot]commented, Sep 15, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @QingChenmsft, @vaishnavk, @juhacket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resource not found errors - Azure Resource Manager
Describes how to resolve errors when a resource can't be found. The error might occur when you deploy a Bicep file or Azure...
Read more >
Azure CLI doesn't recognize resource group - Stack Overflow
The above error occurs if we have multiple subscriptions, set your subscription first and then try: To list all subscriptions - az account...
Read more >
Known Issues - Oracle Help Center
See a list of known issues with Oracle Cloud Infrastructure.
Read more >
Troubleshooting | Google Kubernetes Engine (GKE)
This can occur when kubectl is unable to communicate with the cluster control ... Error 404: Resource "not found" when calling gcloud container...
Read more >
Change Cluster Resource Group (CHGCRG) - IBM
Change the cluster resource group without calling the exit program if neither node role, site name nor data port IP addresses are changed....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found