projectkudu / AzureResourceExplorer

Azure Resource Explorer - a site to explore and manage your ARM resources in style
https://resources.azure.com
Apache License 2.0
199 stars 77 forks source link

sourceControls resource Error (same error in Azure Portal Deployment Center as well) #252

Closed vllama closed 4 years ago

vllama commented 4 years ago

When browsing to the sourcecontrols node on a newly created appService web app, it returns the following error: (on an older webApp I created, it works fine) This error is also visible in devtools when browsing Deployment Center in the portal. I assume it calls the same API

{
  "data": {
    "Code": "BadRequest",
    "Message": "Repository 'GetSiteSourceControl' operation failed with System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.\r\n   at System.ThrowHelper.ThrowKeyNotFoundException()\r\n   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)\r\n   at Microsoft.Web.Hosting.Administration.ExternalSiteRepositoryProvider.<GetSiteSourceControl>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Web.Hosting.Administration.WebCloudController.<>c__DisplayClass251_1.<<GetSiteSourceControl>b__0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Web.Hosting.AsyncHelper.RunSync[TResult](Func`1 func)\r\n   at Microsoft.Web.Hosting.Administration.WebCloudController.GetSiteSourceControl(String subscriptionName, String webspaceName, String name).",
    "Target": null,
    "Details": [
      {
        "Message": "Repository 'GetSiteSourceControl' operation failed with System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.\r\n   at System.ThrowHelper.ThrowKeyNotFoundException()\r\n   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)\r\n   at Microsoft.Web.Hosting.Administration.ExternalSiteRepositoryProvider.<GetSiteSourceControl>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Web.Hosting.Administration.WebCloudController.<>c__DisplayClass251_1.<<GetSiteSourceControl>b__0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Web.Hosting.AsyncHelper.RunSync[TResult](Func`1 func)\r\n   at Microsoft.Web.Hosting.Administration.WebCloudController.GetSiteSourceControl(String subscriptionName, String webspaceName, String name)."
      },
      {
        "Code": "BadRequest"
      },
      {
        "ErrorEntity": {
          "ExtendedCode": "05007",
          "MessageTemplate": "Repository '{0}' operation failed with {1}.",
          "Parameters": [
            "GetSiteSourceControl",
            "System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.\r\n   at System.ThrowHelper.ThrowKeyNotFoundException()\r\n   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)\r\n   at Microsoft.Web.Hosting.Administration.ExternalSiteRepositoryProvider.<GetSiteSourceControl>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Web.Hosting.Administration.WebCloudController.<>c__DisplayClass251_1.<<GetSiteSourceControl>b__0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Web.Hosting.AsyncHelper.RunSync[TResult](Func`1 func)\r\n   at Microsoft.Web.Hosting.Administration.WebCloudController.GetSiteSourceControl(String subscriptionName, String webspaceName, String name)"
          ],
          "Code": "BadRequest",
          "Message": "Repository 'GetSiteSourceControl' operation failed with System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.\r\n   at System.ThrowHelper.ThrowKeyNotFoundException()\r\n   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)\r\n   at Microsoft.Web.Hosting.Administration.ExternalSiteRepositoryProvider.<GetSiteSourceControl>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Web.Hosting.Administration.WebCloudController.<>c__DisplayClass251_1.<<GetSiteSourceControl>b__0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Web.Hosting.AsyncHelper.RunSync[TResult](Func`1 func)\r\n   at Microsoft.Web.Hosting.Administration.WebCloudController.GetSiteSourceControl(String subscriptionName, String webspaceName, String name)."
        }
      }
    ],
    "Innererror": null
  },
  "status": 400
}
vllama commented 4 years ago

This seems to happen when you create a webApp from a template exported from the resource manager.

this line : "scmType": "ExternalGit", seems to be causing the issue

"siteConfig": {
...
    "scmType": "ExternalGit",
... 
}
balag0 commented 4 years ago

The error seems to be coming from the server. Since this tool is just a client that returns the error from server I think the best place to get support for this is

https://azure.microsoft.com/en-us/support/plans/

You can open a support request for free using your Azure login there.