Home > Articles > Details

ArgumentException: Affinity key name set on the cluster 'allclusterprops' must not be null.


Question: Playing with #Yarp #Reverse #Proxy and copying the #configuration straight from the Yarp Documentation Site throws an error "ArgumentException: Affinity key name set on the cluster 'allclusterprops' must not be null."

Has anyone solved this issue yet?

Login to See the Rest of the Answer

Answer:
Yes, I got the same error as well, to work around this issue, I just added the "AffinitykeyName": "SomeValue".
See the code below:

 "SessionAffinity": {
          "Enabled": true, // Defaults to 'false'
          "AffinityKeyName": "Key1",
          "Policy": "Cookie", // Default, alternatively "CustomHeader"
          "FailurePolicy": "Redistribute", // default, Alternatively "Return503Error"
          "Settings": {
            "CustomHeaderName": "MySessionHeaderName" // Defaults to 'X-Yarp-Proxy-Affinity`
          }
        },

If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.


© 2022 - ErnesTech - Privacy