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

json: cannot unmarshal object into Go struct field ServiceEndpointPolicyPropertiesFormat.contextualServiceEndpointPolicies #25791

Open
1 task done
zeusbaba opened this issue Apr 29, 2024 · 1 comment

Comments

@zeusbaba
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.8.2

AzureRM Provider Version

3.101.0

Affected Resource(s)/Data Source(s)

azurerm_subnet_service_endpoint_storage_policy

Terraform Configuration Files

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = ">=3.0.0, <4.0.0"
    }
  }
}

Debug Output/Panic Output

2024-04-26T07:23:42.666+0200 [ERROR] aztfexport: Importing azurerm_subnet_service_endpoint_storage_policy.res-69: exit status 1

Error: retrieving Subnet Service Endpoint Storage Policy "_e41f87a2_redacted" (Resource Group "rg-redacted"): network.ServiceEndpointPoliciesClient#Get: Failure responding to request: StatusCode=200 -- Original Error: Error occurred unmarshalling JSON - Error = 'json: cannot unmarshal object into Go struct field ServiceEndpointPolicyPropertiesFormat.contextualServiceEndpointPolicies of type string' JSON = '{
  "name": "_e41f87a2_redacted",
  "id": "/subscriptions/a498c7e3-redacted/resourceGroups/rg-redacted/providers/Microsoft.Network/serviceEndpointPolicies/_e41f87a2_redacted",
  "etag": "W/\"96ddffdc-redacted\"",
  "type": "Microsoft.Network/serviceEndpointPolicies",
  "location": "norwayeast",
  "properties": {
    "provisioningState": "Succeeded",
    "resourceGuid": "88e6ea86-redacted",
    "serviceAlias": "/services/Azure/ManagedInstance",
    "serviceEndpointPolicyDefinitions": [],
    "contextualServiceEndpointPolicies": [
      {
        "id": "/subscriptions/a498c7e3-redacted/resourceGroups/rg-redacted/providers/Microsoft.Network/virtualNetworks/vnet-saassb1qa/subnets/managedinstance/contextualServiceEndpointPolicies/ManagedInstanceContextualPolicy"
      }
    ]
  },
  "kind": "Internal"
}'
2024-04-26T07:23:42.809+0200 [ERROR] aztfexport: Importing azurerm_subnet_service_endpoint_storage_policy.res-67: exit status 1

Error: retrieving Subnet Service Endpoint Storage Policy "_e41f87a2_redacted" (Resource Group "rg-redacted"): network.ServiceEndpointPoliciesClient#Get: Failure responding to request: StatusCode=200 -- Original Error: Error occurred unmarshalling JSON - Error = 'json: cannot unmarshal object into Go struct field ServiceEndpointPolicyPropertiesFormat.contextualServiceEndpointPolicies of type string' JSON = '{
  "name": "_e41f87a2_redacted",
  "id": "/subscriptions/a498c7e3-redacted/resourceGroups/rg-redacted/providers/Microsoft.Network/serviceEndpointPolicies/_e41f87a2_redacted",
  "etag": "W/\"83bfed89-redacted\"",
  "type": "Microsoft.Network/serviceEndpointPolicies",
  "location": "norwayeast",
  "properties": {
    "provisioningState": "Succeeded",
    "resourceGuid": "4f9befbd-redacted",
    "serviceAlias": "/services/Azure/ManagedInstance",
    "serviceEndpointPolicyDefinitions": [],
    "contextualServiceEndpointPolicies": [
      {
        "id": "/subscriptions/a498c7e3-redacted/resourceGroups/rg-redacted/providers/Microsoft.Network/virtualNetworks/vnet-saassb1qa/subnets/managedinstance/contextualServiceEndpointPolicies/ManagedInstanceContextualPolicy"
      }
    ]
  },
  "kind": "Internal"
}'

...

Expected Behaviour

we are facing issue while using aztfexport and the error seems to be originated from azurerm provider. see related issue

Actual Behaviour

we are facing issue while using aztfexport and the error seems to be originated from azurerm provider. see related issue

Steps to Reproduce

terraform import azurerm_subnet_service_endpoint_storage_policy.name id

see related comment in >>

Important Factoids

azure Norway

References

No response

@zeusbaba
Copy link
Author

appending snippets from terraform.log as well

# from terraform.log (DEBUG)  

2024-04-29T08:50:41.851+0200 [ERROR] provider.terraform-provider-azurerm_v3.99.0_x5: Response contains error diagnostic: diagnostic_detail="" diagnostic_severity=ERROR tf_proto_version=5.4 tf_req_id=863de569-redacted @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:58
  diagnostic_summary=
  | retrieving Subnet Service Endpoint Storage Policy "_e41f87a2_redacted" (Resource Group "rg-redacted"): network.ServiceEndpointPoliciesClient#Get: Failure responding to request: StatusCode=200 -- Original Error: Error occurred unmarshalling JSON - Error = 'json: cannot unmarshal object into Go struct field ServiceEndpointPolicyPropertiesFormat.contextualServiceEndpointPolicies of type string' JSON = '{\r
  |   "name": "_e41f87a2_redacted",\r
  |   "id": "/subscriptions/a498c7e3-redacted/resourceGroups/rg-saas-sb1-qa/providers/Microsoft.Network/serviceEndpointPolicies/_e41f87a2_redacted",\r
  |   "etag": "W/\"83bfed89-redacted\"",\r
  |   "type": "Microsoft.Network/serviceEndpointPolicies",\r
  |   "location": "norwayeast",\r
  |   "properties": {\r
  |     "provisioningState": "Succeeded",\r
  |     "resourceGuid": "4f9befbd-redacted",\r
  |     "serviceAlias": "/services/Azure/ManagedInstance",\r
  |     "serviceEndpointPolicyDefinitions": [],\r
  |     "contextualServiceEndpointPolicies": [\r
  |       {\r
  |         "id": "/subscriptions/a498c7e3-redacted/resourceGroups/rg-saas-sb1-qa/providers/Microsoft.Network/virtualNetworks/vnet-saassb1qa/subnets/managedinstance/contextualServiceEndpointPolicies/ManagedInstanceContextualPolicy"\r
  |       }\r
  |     ]\r
  |   },\r
  |   "kind": "Internal"\r
  | }'
   tf_provider_addr=provider tf_resource_type=azurerm_subnet_service_endpoint_storage_policy tf_rpc=ReadResource @module=sdk.proto timestamp="2024-04-29T08:50:41.851+0200"
   

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant