vscode-azurestaticwebapps icon indicating copy to clipboard operation
vscode-azurestaticwebapps copied to clipboard

Internal error: 'branchDataProvider.getResourceltem' threw exception Cannot read properties of null (reading 'contextValuesToAdd')

Open elrony opened this issue 2 years ago • 19 comments

Hello,

I am no longer able to see details for static web apps and getting this error instead:

Internal error: 'branchDataProvider.getResourceltem' threw exception Cannot read properties of null (reading 'contextValuesToAdd')

swaerror

The same error shows on all static web apps in all subscriptions.

elrony avatar Jan 04 '24 09:01 elrony

Are you still able to view these apps on the portal as normal? This error indicates that we aren't able to fetch data about this resource due to lack of permissions.

alexweininger avatar Jan 10 '24 18:01 alexweininger

Hello,

Yes, all works in portal as normal and I can see all other resources in the azure extension except static web apps for all subscriptions.

If the issue is with permissions, how can I check I have the correct ones?

Thanks

elrony avatar Jan 11 '24 06:01 elrony

Which method did you use to deploy to your static web app? Did you deploy with GitHub actions or use the static web apps cli, etc?

MicroFish91 avatar Jan 31 '24 18:01 MicroFish91

The cli and the Deploy Azure Static Web App 0.* (preview) task in devops releases

elrony avatar Feb 01 '24 06:02 elrony

I suspect this error will show up for apps that aren't connected to GitHub or Azure DevOps. The extension lacks support at the moment for apps that have been deployed with other means (SWA CLI, or the DevOps task).

Just to help confirm this, is this error showing for all of your apps? Do you have Static Web Apps that are connected to GitHub/DevOps repositories? If yes, are those ones showing the same error?

If you only have apps that have been deployed to with the CLI or the DevOps preview task, that's fine. We need to add support for those apps in the extension. It's been on our todo list for a while.

In the meantime we could certainly provide a better error message.

alexweininger avatar Feb 01 '24 06:02 alexweininger

I do not have apps deployed directly via GitHub/devops. I deploy them with pipelines.

Ok that makes sense.

Thanks

elrony avatar Feb 06 '24 08:02 elrony

Hello, was this ever resolved?

I had access to .yml config files for a static web app via the Azure extension in VS Code for years, but now it's broken.

If this is now broken for foreseeable future, is there another way to read and write files that are git-ignored for static web apps?

BP-StepanO-RUS avatar Feb 13 '24 23:02 BP-StepanO-RUS

How are you deploying @BP-StepanO-RUS ?

motm32 avatar Mar 13 '24 17:03 motm32

How are you deploying @BP-StepanO-RUS ?

Github Actions @motm32

BP-StepanO-RUS avatar Mar 13 '24 17:03 BP-StepanO-RUS

How are you deploying @BP-StepanO-RUS ?

Github Actions @motm32

Could you go into the Azure Portal and show us the property JSON for this static web site? Something that we expect to be there is undefined so if you can share that with us, we may be able to discern what's throwing the error.

nturinski avatar Mar 13 '24 18:03 nturinski

Do you mean this file? @nturinski

{ "id": "[REDACTED]", "name": "[REDACTED]", "type": "Microsoft.Web/sites", "kind": "app,linux", "location": "West US 2", "tags": { "CostCenter": "[REDACTED]", "Engagement": "[REDACTED]", "Purpose": " ", "Environment": "Prod", "Owner": " ", "Eol": "NA", "Outcome": "Tagged", "BusinessCriticality": "High", "Department": "[REDACTED]", "Notes": "[REDACTED]", "ResourceServiceType": "Microsoft.Web/sites", "Schedule": " ", "CreatedBy": "[REDACTED]" }, "properties": { "name": "[REDACTED]", "state": "Running", "hostNames": [ "[REDACTED]" ], "webSpace": "[REDACTED]", "selfLink": "[REDACTED]", "repositorySiteName": "[REDACTED]", "owner": null, "usageState": 0, "enabled": true, "adminEnabled": true, "afdEnabled": false, "enabledHostNames": [ "[REDACTED]", "[REDACTED]" ], "siteProperties": { "metadata": null, "properties": [ { "name": "LinuxFxVersion", "value": "PYTHON|3.9" }, { "name": "WindowsFxVersion", "value": null } ], "appSettings": null }, "availabilityState": 0, "sslCertificates": null, "csrs": [], "cers": null, "siteMode": null, "hostNameSslStates": [ { "name": "[REDACTED]", "sslState": 0, "ipBasedSslResult": null, "virtualIP": null, "virtualIPv6": null, "thumbprint": null, "certificateResourceId": null, "toUpdate": null, "toUpdateIpBasedSsl": null, "ipBasedSslState": 0, "hostType": 0 }, { "name": "[REDACTED]", "sslState": 0, "ipBasedSslResult": null, "virtualIP": null, "virtualIPv6": null, "thumbprint": null, "certificateResourceId": null, "toUpdate": null, "toUpdateIpBasedSsl": null, "ipBasedSslState": 0, "hostType": 1 } ], "computeMode": null, "serverFarm": null, "serverFarmId": "[REDACTED]", "reserved": true, "isXenon": false, "hyperV": false, "lastModifiedTimeUtc": "2024-03-11T20:28:25.5433333", "storageRecoveryDefaultState": "Running", "contentAvailabilityState": 0, "runtimeAvailabilityState": 0, "dnsConfiguration": {}, "vnetRouteAllEnabled": false, "containerAllocationSubnet": null, "useContainerLocalhostBindings": null, "vnetImagePullEnabled": false, "vnetContentShareEnabled": false, "siteConfig": { "numberOfWorkers": 1, "defaultDocuments": null, "netFrameworkVersion": null, "phpVersion": null, "pythonVersion": null, "nodeVersion": null, "powerShellVersion": null, "linuxFxVersion": "PYTHON|3.9", "windowsFxVersion": null, "windowsConfiguredStacks": null, "requestTracingEnabled": null, "remoteDebuggingEnabled": null, "remoteDebuggingVersion": null, "httpLoggingEnabled": null, "azureMonitorLogCategories": null, "acrUseManagedIdentityCreds": false, "acrUserManagedIdentityID": null, "logsDirectorySizeLimit": null, "detailedErrorLoggingEnabled": null, "publishingUsername": null, "publishingPassword": null, "appSettings": null, "metadata": null, "connectionStrings": null, "machineKey": null, "handlerMappings": null, "documentRoot": null, "scmType": null, "use32BitWorkerProcess": null, "webSocketsEnabled": null, "alwaysOn": true, "javaVersion": null, "javaContainer": null, "javaContainerVersion": null, "appCommandLine": null, "managedPipelineMode": null, "virtualApplications": null, "winAuthAdminState": null, "winAuthTenantState": null, "customAppPoolIdentityAdminState": null, "customAppPoolIdentityTenantState": null, "runtimeADUser": null, "runtimeADUserPassword": null, "loadBalancing": null, "routingRules": null, "experiments": null, "limits": null, "autoHealEnabled": null, "autoHealRules": null, "tracingOptions": null, "vnetName": null, "vnetRouteAllEnabled": null, "vnetPrivatePortsCount": null, "publicNetworkAccess": null, "cors": null, "push": null, "apiDefinition": null, "apiManagementConfig": null, "autoSwapSlotName": null, "localMySqlEnabled": null, "managedServiceIdentityId": null, "xManagedServiceIdentityId": null, "keyVaultReferenceIdentity": null, "ipSecurityRestrictions": null, "ipSecurityRestrictionsDefaultAction": null, "scmIpSecurityRestrictions": null, "scmIpSecurityRestrictionsDefaultAction": null, "scmIpSecurityRestrictionsUseMain": null, "http20Enabled": false, "minTlsVersion": null, "minTlsCipherSuite": null, "supportedTlsCipherSuites": null, "scmMinTlsVersion": null, "ftpsState": null, "preWarmedInstanceCount": null, "functionAppScaleLimit": 0, "elasticWebAppScaleLimit": null, "healthCheckPath": null, "fileChangeAuditEnabled": null, "functionsRuntimeScaleMonitoringEnabled": null, "websiteTimeZone": null, "minimumElasticInstanceCount": 1, "azureStorageAccounts": null, "http20ProxyFlag": null, "sitePort": null, "antivirusScanEnabled": null, "storageType": null, "sitePrivateLinkHostEnabled": null }, "functionAppConfig": null, "daprConfig": null, "deploymentId": "[REDACTED]", "slotName": null, "trafficManagerHostNames": null, "sku": "Basic", "scmSiteAlsoStopped": false, "targetSwapSlot": null, "hostingEnvironment": null, "hostingEnvironmentProfile": null, "clientAffinityEnabled": false, "clientCertEnabled": false, "clientCertMode": 0, "clientCertExclusionPaths": null, "hostNamesDisabled": false, "ipMode": "IPv4", "vnetBackupRestoreEnabled": null, "domainVerificationIdentifiers": null, "customDomainVerificationId": "[REDACTED]", "kind": "app,linux", "managedEnvironmentId": null, "workloadProfileName": null, "resourceConfig": null, "inboundIpAddress": "13.77.182.13", "possibleInboundIpAddresses": "13.77.182.13", "ftpUsername": "[REDACTED]", "ftpsHostName": "ftps://waws-prod-mwh-029.ftp.azurewebsites.windows.net/site/wwwroot", "outboundIpAddresses": "13.77.161.10,52.183.26.12,52.175.235.45,13.77.178.124,13.77.182.13", "possibleOutboundIpAddresses": "13.77.161.10,52.183.26.12,52.175.235.45,13.77.178.124,52.183.34.217,13.66.206.87,13.77.172.226,52.183.34.132,13.77.180.8,20.112.59.90,20.112.61.147,20.112.63.92,20.112.63.133,20.112.63.173,20.112.63.193,20.99.138.182,20.99.199.228,20.112.58.245,20.112.59.161,20.120.136.0,20.120.136.18,13.77.182.13", "containerSize": 0, "dailyMemoryTimeQuota": 0, "suspendedTill": null, "siteDisabledReason": 0, "functionExecutionUnitsCache": null, "maxNumberOfWorkers": null, "homeStamp": "waws-prod-mwh-029", "cloningInfo": null, "hostingEnvironmentId": null, "tags": { "CostCenter": "[REDACTED]", "Engagement": "[REDACTED]", "Purpose": " ", "Environment": "Prod", "Owner": " ", "Eol": "NA", "Outcome": "Tagged", "BusinessCriticality": "High", "Department": "[REDACTED]", "Notes": "[REDACTED]", "ResourceServiceType": "Microsoft.Web/sites", "Schedule": " ", "CreatedBy": "[REDACTED]" }, "resourceGroup": "[REDACTED]", "defaultHostName": "[REDACTED]", "slotSwapStatus": null, "httpsOnly": true, "endToEndEncryptionEnabled": false, "functionsRuntimeAdminIsolationEnabled": false, "redundancyMode": 0, "inProgressOperationId": null, "geoDistributions": null, "privateEndpointConnections": [], "publicNetworkAccess": null, "buildVersion": null, "targetBuildVersion": null, "migrationState": null, "eligibleLogCategories": "AppServiceAppLogs,AppServiceAuditLogs,AppServiceConsoleLogs,AppServiceHTTPLogs,AppServiceIPSecAuditLogs,AppServicePlatformLogs,ScanLogs", "inFlightFeatures": [ "SiteContainers" ], "storageAccountRequired": false, "virtualNetworkSubnetId": null, "keyVaultReferenceIdentity": "SystemAssigned", "autoGeneratedDomainNameLabelScope": null, "defaultHostNameScope": 0, "privateLinkIdentifiers": null, "sshEnabled": true } }

BP-StepanO-RUS avatar Mar 13 '24 18:03 BP-StepanO-RUS

Looking at this payload, this looks like it's a function or web app. Is this issue in the right repository?

nturinski avatar Apr 03 '24 18:04 nturinski

The original issue was reported for a "Static Web Apps". Mine is the same issue for something called "App Services". I'm not sure what the differences are, but apparently both experience the same.

BP-StepanO-RUS avatar Apr 03 '24 18:04 BP-StepanO-RUS

We have made a release recently that may have fixed the issue or at least improved the error messaging. Could you please let us know if you're still encountering the above issue? Thanks!

MicroFish91 avatar May 08 '24 17:05 MicroFish91

We have made a release recently that may have fixed the issue or at least improved the error messaging. Could you please let us know if you're still encountering the above issue? Thanks!

The error message is now Internal error: Expected value to be neither null nor undefined: defaultHostName

BP-StepanO-RUS avatar May 08 '24 20:05 BP-StepanO-RUS

There's also Could not resolve resource "/subscriptions/<subscriptionID>/<some paths to the site>/"

BP-StepanO-RUS avatar May 08 '24 20:05 BP-StepanO-RUS

Do you happen to have a containerized function app, by chance? In the same location of the app that is throwing this error?

nturinski avatar May 09 '24 17:05 nturinski

Do you happen to have a containerized function app, by chance? In the same location of the app that is throwing this error?

No, I don't think so

BP-StepanO-RUS avatar May 09 '24 18:05 BP-StepanO-RUS

is there any update on this? getting this with Azure Resources v0.9.9 on Standard Logic Apps that are deployed with ADO pipelines

anthonywhite avatar Nov 20 '24 09:11 anthonywhite