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

GetUpgradeProgress incorrect API docs #1114

Open
hbuckle opened this issue Dec 29, 2019 · 6 comments
Open

GetUpgradeProgress incorrect API docs #1114

hbuckle opened this issue Dec 29, 2019 · 6 comments
Assignees

Comments

@hbuckle
Copy link

hbuckle commented Dec 29, 2019

The GetUpgradeProgress API returns the ApplicationHealthPolicyMap property as an object, but according to the API docs it should be an array.
This causes an error in generated clients as seen here

Expected Behavior

Get-SFClusterUpgradeProgress / Microsoft.ServiceFabric.Client.Http.ClusterClient.GetClusterUpgradeProgressAsync return succesfully

Current Behavior

Get-SFClusterUpgradeProgress : Failed to deserialize json response from server.
Exception Info: Microsoft.ServiceFabric.Common.Exceptions.ServiceFabricException: Failed to deserialize json response from server.
  ---> Newtonsoft.Json.JsonReaderException: Unexpected JsonToken StartObject.
    at Microsoft.ServiceFabric.Client.Http.JsonReaderExtensions.ReadStartArray(JsonReader reader)
    at Microsoft.ServiceFabric.Client.Http.JsonReaderExtensions.ReadList[T](JsonReader reader, Func`2 deserializerFunc)
    at Microsoft.ServiceFabric.Client.Http.Serialization.ClusterUpgradeDescriptionObjectConverter.GetFromJsonProperties(JsonReader reader)
    at Microsoft.ServiceFabric.Client.Http.JsonReaderExtensions.Deserialize[T](JsonReader reader, Func`2 getFromJsonPropertiesFunc)
    at Microsoft.ServiceFabric.Client.Http.Serialization.ClusterUpgradeDescriptionObjectConverter.Deserialize(JsonReader reader)
    at Microsoft.ServiceFabric.Client.Http.Serialization.ClusterUpgradeProgressObjectConverter.GetFromJsonProperties(JsonReader reader)
    at Microsoft.ServiceFabric.Client.Http.JsonReaderExtensions.Deserialize[T](JsonReader reader, Func`2 getFromJsonPropertiesFunc)
    at Microsoft.ServiceFabric.Client.Http.Serialization.ClusterUpgradeProgressObjectConverter.Deserialize(JsonReader reader)
    at Microsoft.ServiceFabric.Client.Http.ServiceFabricHttpClient.SendAsyncGetResponse[T](Func`1 requestFunc, String relativeUri, Func`2 deserializeFunc, String requestId, CancellationToken cancellationToken)
    --- End of inner exception stack trace ---
    at Microsoft.ServiceFabric.Client.Http.ServiceFabricHttpClient.SendAsyncGetResponse[T](Func`1 requestFunc, String relativeUri, Func`2 deserializeFunc, String requestId, CancellationToken cancellationToken)

This is the raw JSON from the API

{
  "CodeVersion": "6.5.676.9590",
  "ConfigVersion": "2",
  "UpgradeDomains": [
    {
      "Name": "0",
      "State": "Completed"
    },
    {
      "Name": "1",
      "State": "Completed"
    },
    {
      "Name": "2",
      "State": "Completed"
    },
    {
      "Name": "3",
      "State": "Completed"
    },
    {
      "Name": "4",
      "State": "Completed"
    }
  ],
  "UpgradeState": "RollingForwardCompleted",
  "NextUpgradeDomain": "",
  "RollingUpgradeMode": "Monitored",
  "UpgradeDescription": {
    "CodeVersion": "6.5.676.9590",
    "ConfigVersion": "2",
    "UpgradeKind": "Rolling",
    "RollingUpgradeMode": "Monitored",
    "UpgradeReplicaSetCheckTimeoutInSeconds": 4294967295,
    "ForceRestart": false,
    "MonitoringPolicy": {
      "FailureAction": "Rollback",
      "HealthCheckWaitDurationInMilliseconds": "PT0H0M30S",
      "HealthCheckStableDurationInMilliseconds": "PT0H1M0S",
      "HealthCheckRetryTimeoutInMilliseconds": "PT0H45M0S",
      "UpgradeTimeoutInMilliseconds": "PT12H0M0S",
      "UpgradeDomainTimeoutInMilliseconds": "PT2H0M0S"
    },
    "ClusterHealthPolicy": {
      "ConsiderWarningAsError": false,
      "MaxPercentUnhealthyNodes": 100,
      "MaxPercentUnhealthyApplications": 0
    },
    "EnableDeltaHealthEvaluation": true,
    "ClusterUpgradeHealthPolicy": {
      "MaxPercentDeltaUnhealthyNodes": 0,
      "MaxPercentUpgradeDomainDeltaUnhealthyNodes": 0
    },
    "ApplicationHealthPolicyMap": {
      "ApplicationHealthPolicyMap": [
        {
          "Key": "fabric:\/System",
          "Value": {
            "ConsiderWarningAsError": false,
            "MaxPercentUnhealthyDeployedApplications": 0,
            "DefaultServiceTypeHealthPolicy": {
              "MaxPercentUnhealthyServices": 0,
              "MaxPercentUnhealthyPartitionsPerService": 0,
              "MaxPercentUnhealthyReplicasPerPartition": 0
            },
            "ServiceTypeHealthPolicyMap": [
              {
                "Key": "ClusterManagerServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "DnsServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "EventStoreServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "FMServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "FaultAnalysisServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "FileStoreServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "NamingStoreService",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "RepairManagerServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              },
              {
                "Key": "UpgradeServiceType",
                "Value": {
                  "MaxPercentUnhealthyServices": 0,
                  "MaxPercentUnhealthyPartitionsPerService": 0,
                  "MaxPercentUnhealthyReplicasPerPartition": 0
                }
              }
            ]
          }
        }
      ]
    },
    "SortOrder": "Default"
  },
  "UpgradeDurationInMilliseconds": "PT0H18M1.98432S",
  "UpgradeDomainDurationInMilliseconds": "PT0H0M0.0636127S",
  "UnhealthyEvaluations": [],
  "CurrentUpgradeDomainProgress": {
    "DomainName": "",
    "NodeUpgradeProgressList": []
  },
  "StartTimestampUtc": "2019-12-27T14:15:33.886Z",
  "FailureTimestampUtc": "0001-01-01T00:00:00.000Z",
  "FailureReason": "None",
  "UpgradeDomainProgressAtFailure": {
    "DomainName": "",
    "NodeUpgradeProgressList": []
  }
}

ApplicationHealthPolicyMap definition
https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/servicefabric/data-plane/Microsoft.ServiceFabric/stable/7.0/servicefabric.json
https://docs.microsoft.com/en-us/rest/api/servicefabric/sfclient-model-clusterupgradedescriptionobject#applicationhealthpolicymap

    "ApplicationHealthPolicyMap": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/ApplicationHealthPolicyMapItem"
      },

Service Fabric Runtime and SDK Version :

7.0.457.9590
6.5.676.9590

Operating System :

Windows

@motanv
Copy link

motanv commented Feb 26, 2020

Hello @hbuckle ,
Thanks for reporting this issue. The SF runtime always returned it as a map, however the swagger spec had the error of defining the type as an array. We shall fix it in our next client refresh. Thanks again.

Tanvir

@motanv motanv closed this as completed Feb 26, 2020
@hbuckle
Copy link
Author

hbuckle commented Mar 26, 2020

@motanv - do you have a timeline for the fix, as the client libraries are broken until this is resolved?

@hbuckle
Copy link
Author

hbuckle commented Sep 3, 2020

@motanv - Is this going to be fixed?

@motanv
Copy link

motanv commented Sep 3, 2020

Hello @hbuckle, we shall get to it soon. Thanks.

@motanv motanv reopened this Sep 3, 2020
@motanv
Copy link

motanv commented Sep 8, 2020

Hello @hbuckle, just to let you know the pull request for the fix has been completed, it should be available in the next refresh. Thanks.

@masnider masnider transferred this issue from microsoft/service-fabric-issues Dec 9, 2020
@craftyhouse
Copy link
Collaborator

@motanv are you able to confirm which refresh this was included in and close? thanks!

@masnider masnider assigned sukanyamsft and unassigned masnider Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants