openbmc / bmcweb

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

MetricReportDefinitions POST failed #267

Closed jack206 closed 7 months ago

jack206 commented 7 months ago

Is this the right place to submit this?

Bug Description

$curl -k -u root:0penBmc -d @data.json -H "Content-Type: application/octet-stream"  -X POST https://${OPENBMC_HOST}/redfish/v1/TelemetryService/MetricReportDefinitions
{
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_1_1.Message",
        "Message": "The property '/redfish/v1/Chassis/HyperCard/Sensors/CPU_Total_Power' with the requested value of 'MetricProperties/0' could not be written because the value does not meet the constraints of the implementation.",
        "MessageArgs": [
          "/redfish/v1/Chassis/HyperCard/Sensors/CPU_Total_Power",
          "MetricProperties/0"
        ],
        "MessageId": "Base.1.11.0.PropertyValueIncorrect",
        "MessageSeverity": "Warning",
        "Resolution": "No resolution is required."
      }
    ],
    "code": "Base.1.11.0.PropertyValueIncorrect",
    "message": "The property '/redfish/v1/Chassis/HyperCard/Sensors/CPU_Total_Power' with the requested value of 'MetricProperties/0' could not be written because the value does not meet the constraints of the implementation."
  }
cat data.json 
{
    "Id": "TemperatureReport0",
    "Metrics": [
        {"MetricId":"0", 
            "MetricProperties": [
                                "/redfish/v1/Chassis/HyperCard/Sensors/CPU_Total_Power",
                                "/redfish/v1/Chassis/HyperCard/Sensors/FPGA_INNER_TEMP"
                        ]
        }
        ],
    "Schedule": {
        "RecurrenceInterval": "PT20S"
    },
    "MetricReportDefinitionType": "Periodic",
    "ReportActions": [
        "RedfishEvent", "LogToMetricReportsCollection"
    ]
}

Version

boost version 1.78

Additional Information

curl -k -u root:0penBmc -H  "Content-Type: application/octet-stream"   https://${OPENBMC_HOST}/redfish/v1/Chassis/HyperCard/Sensors
{
  "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors",
  "@odata.type": "#SensorCollection.SensorCollection",
  "Description": "Collection of Sensors for this Chassis",
  "Members": [
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/CPU_Total_Power"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/CPU_VR1_Power_O"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/CPU_VR2_Power_O"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/CPU_VR3_Power_O"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/CPU_VR4_Power_O"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/CPU_VR5_Power_O"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/CPU_VR6_Power_O"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/FPGA_VR1_Power_O"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/FPGA_VR2_Power_O"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/CPU_TEMP"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/CPU_VR1_TEMP"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/CPU_VR2_TEMP"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/CPU_VR3_TEMP"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/CPU_VR4_TEMP"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/CPU_VR5_TEMP"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/CPU_VR6_TEMP"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/FPGA_INLET_TEMP"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/FPGA_INNER_TEMP1"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/FPGA_INNER_TEMP2"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/FPGA_INNER_TEMP3"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/FPGA_INNER_TEMP4"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/FPGA_INNER_TEMP5"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/FPGA_VR1_TEMP"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/HyperCard/Sensors/FPGA_VR2_TEMP"
    }
  ],
  "Members@odata.count": 24,
  "Name": "Sensors"
jack206 commented 7 months ago
Sep 23 07:38:47 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:47) [DEBUG "authorization.hpp":115] [AuthMiddleware] X-Auth-Token authentication
Sep 23 07:38:47 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:47) [DEBUG "authorization.hpp":133] [AuthMiddleware] Cookie authentication
Sep 23 07:38:47 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:47) [DEBUG "authorization.hpp":292] authHeader=Basic cm9vdDowcGVuQm1j
Sep 23 07:38:47 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:47) [DEBUG "authorization.hpp":99] [AuthMiddleware] Token authentication
Sep 23 07:38:47 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:47) [DEBUG "authorization.hpp":43] [AuthMiddleware] Basic authentication
Sep 23 07:38:47 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:47) [DEBUG "authorization.hpp":71] [AuthMiddleware] Authenticating user: root
Sep 23 07:38:47 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:47) [DEBUG "authorization.hpp":72] [AuthMiddleware] User IPAddress: ::ffff:172.28.145.70
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: pam_succeed_if(webserver:auth): requirement "user ingroup redfish" was met by user "root"
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_connection.hpp":607] 0x1d6ca98 doRead
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_connection.hpp":614] 0x1d6ca98 async_read 449 Bytes
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_connection.hpp":506] Fetch the client IP address
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [INFO "http_connection.hpp":342] Request:  0x1d6ca98 HTTP/1.1 POST /redfish/v1/TelemetryService/MetricReportDefinitions ::ffff:172.28.145.70
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_connection.hpp":371] Setting completion handler
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_response.hpp":149] 0x1d902d8 setting completion handler
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "routing.hpp":1263] Matched rule '/redfish/v1/TelemetryService/MetricReportDefinitions/' 4 / 16
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "routing.hpp":1299] userName = root userRole = priv-admin
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "query.hpp":19] setup redfish route
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [ERROR "telemetry_utils.hpp":78] Failed to get chassis and sensor Node from /redfish/v1/Chassis/HyperCard/Sensors/CPU_Total_Power
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_response.hpp":134] 0x1d902d8 calling completion handler
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_response.hpp":137] 0x1d902d8 completion handler was valid
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_response.hpp":51] Moving response containers; this: 0x1d6ed60; other: 0x1d902d8
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [INFO "http_connection.hpp":433] Response: 0x1d6ca98 /redfish/v1/TelemetryService/MetricReportDefinitions 400 keepalive=1
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_connection.hpp":631] 0x1d6ca98 doWrite
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_response.hpp":149] 0x1d6ed60 setting completion handler
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_connection.hpp":640] 0x1d6ca98 async_write 1473 bytes
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_connection.hpp":658] 0x1d6ca98 Clearing response
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_response.hpp":115] 0x1d6ed60 Clearing response containers
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_connection.hpp":525] 0x1d6ca98 doReadHeaders
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_connection.hpp":533] 0x1d6ca98 async_read_header 0 Bytes
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [ERROR "http_connection.hpp":546] 0x1d6ca98 Error while reading: end of stream
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_connection.hpp":566] 0x1d6ca98 from read(1)
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_response.hpp":149] 0x1d6ed60 setting completion handler
Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [DEBUG "http_connection.hpp":80] 0x1d6ca98 Connection closed, total 1

Here is bmcweb log,Does anyone know how to solve this?

williamspatrick commented 7 months ago

Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [ERROR "telemetry_utils.hpp":78] Failed to get chassis and sensor Node from /redfish/v1/Chassis/HyperCard/Sensors/CPU_Total_Power

Have you investigated this?

williamspatrick commented 7 months ago

You didn't check off "this is not from a fork" and you didn't give a version of bmcweb and/or OpenBMC, so I have to assume you are testing on a fork?

jack206 commented 7 months ago

You didn't check off "this is not from a fork" and you didn't give a version of bmcweb and/or OpenBMC, so I have to assume you are testing on a fork?

i run in 2.12

jack206 commented 7 months ago

Sep 23 07:38:48 HyperCard3-0-25G bmcweb[21848]: (2019-09-22 23:38:48) [ERROR "telemetry_utils.hpp":78] Failed to get chassis and sensor Node from /redfish/v1/Chassis/HyperCard/Sensors/CPU_Total_Power

Have you investigated this?

Yeah, It seems that boost::urls::parse_relative_ref(uri) have been an error,but i done not know why.

edtanous commented 7 months ago

Lets start by testing on a current build of OpenBMC. 2.12 is from a year ago. Boost 1.78 is from a couple years ago, and there have been significant changes to the url parsing code since then in both bmcweb and boost.

If this is still an issue, please edit your bug description and update it with the requested version information in the template, including what system you tested this on, as well as what openbmc release you used. Given that I don't see any entity-manager config files with the name "HyperCard", I'm assuming you're testing on a fork?

jack206 commented 7 months ago

Not a bug