openbmc / bmcweb

A do everything Redfish, KVM, GUI, and DBus webserver for OpenBMC
Apache License 2.0
156 stars 131 forks source link

Server responds with 403 error code instead of 503 when Event Subscription limit exceeds #150

Closed adathatri closed 3 years ago

adathatri commented 4 years ago

After exceeding maximum subscription limit of 20, BMC server responds with 403 error code instead of the expected 503 error code.

Steps to reproduce:

  1. Create 20 Push style subscriptions in BMC using RedfishEventListener_v1.py script.
  2. Try to subscribe for the 21st time and BMC responds with 403 instead of the expected 503 error code.

Error response obtained for 21st subscription from RedfishEventListener_v1.py:

Method = POST, status = 403, expected status = [200, 201, 204] ---> Error code is 403 instead of 503
{'Date': 'Tue, 08 Sep 2020 14:12:11 GMT', 'Cache-Control': 'no-Store,no-Cache', 'Content-Length': '770', 'X-XSS-Protection': '1; mode=block', 'Strict-Transport-Security': 'max-age=31536000; includeSubdomains; preload', 'Content-Security-Policy': "default-src 'none'; img-src 'self' data:; font-src 'self'; style-src 'self'; script-src 'self'; connect-src 'self' wss:", 'Pragma': 'no-cache', 'Content-Type': 'application/json', 'X-Frame-Options': 'DENY', 'X-Content-Type-Options': 'nosniff', 'Server': 'bmcweb'}
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_0.Message",
"Message": "The event subscription failed due to the number of simultaneous subscriptions exceeding the limit of the implementation.",
"MessageArgs": [],
"MessageId": "Base.1.4.0.EventSubscriptionLimitExceeded",
"Resolution": "Reduce the number of other subscriptions before trying to establish the event subscription or increase the limit of simultaneous subscriptions (if supported).",
"Severity": "Critical"
}
],
"code": "Base.1.4.0.EventSubscriptionLimitExceeded",
"message": "The event subscription failed due to the number of simultaneous subscriptions exceeding the limit of the implementation."
}
}

@apuli1 @feistjj @ratagupt

edtanous commented 3 years ago

@adathatri Can you please retest with: https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/37230

And see if it resolves your issue?

adathatri commented 3 years ago

@edtanous Retested with https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/37230. I am seeing 503 as the response code now. Thanks!

Method = POST, status = 503, expected status = [200, 201, 204]
{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_0_0.Message",
        "Message": "The event subscription failed due to the number of simultaneous subscriptions exceeding the limit of the implementation.",
        "MessageArgs": [],
        "MessageId": "Base.1.8.1.EventSubscriptionLimitExceeded",
        "MessageSeverity": "Critical",
        "Resolution": "Reduce the number of other subscriptions before trying to establish the event subscription or increase the limit of simultaneous subscriptions upported)."
      }
    ],
    "code": "Base.1.8.1.EventSubscriptionLimitExceeded",
    "message": "The event subscription failed due to the number of simultaneous subscriptions exceeding the limit of the implementation."
  }
}