Giter VIP home page Giter VIP logo

bmcweb's Introduction

OpenBMC

Build Status

OpenBMC is a Linux distribution for management controllers used in devices such as servers, top of rack switches or RAID appliances. It uses Yocto, OpenEmbedded, systemd, and D-Bus to allow easy customization for your platform.

Setting up your OpenBMC project

1) Prerequisite

See the Yocto documentation for the latest requirements

Ubuntu

sudo apt install git python3-distutils gcc g++ make file wget \
    gawk diffstat bzip2 cpio chrpath zstd lz4 bzip2

Fedora

sudo dnf install git python3 gcc g++ gawk which bzip2 chrpath cpio \
    hostname file diffutils diffstat lz4 wget zstd rpcgen patch

2) Download the source

git clone https://github.com/openbmc/openbmc
cd openbmc

3) Target your hardware

Any build requires an environment set up according to your hardware target. There is a special script in the root of this repository that can be used to configure the environment as needed. The script is called setup and takes the name of your hardware target as an argument.

The script needs to be sourced while in the top directory of the OpenBMC repository clone, and, if run without arguments, will display the list of supported hardware targets, see the following example:

$ . setup <machine> [build_dir]
Target machine must be specified. Use one of:

ahe50dc                 harma                   s7106
bletchley               kudo                    s8036
daytonax                lannister               sbp1
dl360-g11               minerva                 spc621d8hm3
dl360poc                mori                    starscream
dl385-g11               mtjade                  system1
e3c246d4i               mtmitchell              tatlin-archive-x86
e3c256d4i               ncplite                 tiogapass
ethanolx                nicole                  transformers
evb-ast2500             olympus-nuvoton         vegman-n110
evb-ast2600             p10bmc                  vegman-rx20
evb-npcm750             palmetto                vegman-sx20
evb-npcm845             qcom-dc-scm-v1          witherspoon
f0b                     quanta-q71l             witherspoon-tacoma
fp5280g3                rl300-g11               x11spi
g220a                   romed8hm3               yosemite4
gbs                     romulus                 yosemitev2
genesis3                s2600wf                 zaius
greatlakes              s6q

Once you know the target (e.g. romulus), source the setup script as follows:

. setup romulus

4) Build

bitbake obmc-phosphor-image

Additional details can be found in the docs repository.

OpenBMC Development

The OpenBMC community maintains a set of tutorials new users can go through to get up to speed on OpenBMC development out here

Build Validation and Testing

Commits submitted by members of the OpenBMC GitHub community are compiled and tested via our Jenkins server. Commits are run through two levels of testing. At the repository level the makefile make check directive is run. At the system level, the commit is built into a firmware image and run with an arm-softmmu QEMU model against a barrage of CI tests.

Commits submitted by non-members do not automatically proceed through CI testing. After visual inspection of the commit, a CI run can be manually performed by the reviewer.

Automated testing against the QEMU model along with supported systems are performed. The OpenBMC project uses the Robot Framework for all automation. Our complete test repository can be found here.

Submitting Patches

Support of additional hardware and software packages is always welcome. Please follow the contributing guidelines when making a submission. It is expected that contributions contain test cases.

Bug Reporting

Issues are managed on GitHub. It is recommended you search through the issues before opening a new one.

Questions

First, please do a search on the internet. There's a good chance your question has already been asked.

For general questions, please use the openbmc tag on Stack Overflow. Please review the discussion on Stack Overflow licensing before posting any code.

For technical discussions, please see contact info below for Discord and mailing list information. Please don't file an issue to ask a question. You'll get faster results by using the mailing list or Discord.

Will OpenBMC run on my Acme Server Corp. XYZ5000 motherboard?

This is a common question, particularly regarding boards from popular COTS (commercial off-the-shelf) vendors such as Supermicro and ASRock. You can see the list of supported boards by running . setup (with no further arguments) in the root of the OpenBMC source tree. Most of the platforms supported by OpenBMC are specialized servers operated by companies running large datacenters, but some more generic COTS servers are supported to varying degrees.

If your motherboard is not listed in the output of . setup it is not currently supported. Porting OpenBMC to a new platform is a non-trivial undertaking, ideally done with the assistance of schematics and other documentation from the manufacturer (it is not completely infeasible to take on a porting effort without documentation via reverse engineering, but it is considerably more difficult, and probably involves a greater risk of hardware damage).

However, even if your motherboard is among those listed in the output of . setup, there are two significant caveats to bear in mind. First, not all ports are equally mature -- some platforms are better supported than others, and functionality on some "supported" boards may be fairly limited. Second, support for a motherboard is not the same as support for a complete system -- in particular, fan control is critically dependent on not just the motherboard but also the fans connected to it and the chassis that the board and fans are housed in, both of which can vary dramatically between systems using the same board model. So while you may be able to compile and install an OpenBMC build on your system and get some basic functionality, rough edges (such as your cooling fans running continuously at full throttle) are likely.

Features of OpenBMC

Feature List

  • Host management: Power, Cooling, LEDs, Inventory, Events, Watchdog
  • Full IPMI 2.0 Compliance with DCMI
  • Code Update Support for multiple BMC/BIOS images
  • Web-based user interface
  • REST interfaces
  • D-Bus based interfaces
  • SSH based SOL
  • Remote KVM
  • Hardware Simulation
  • Automated Testing
  • User management
  • Virtual media

Features In Progress

  • OpenCompute Redfish Compliance
  • Verified Boot

Features Requested but need help

  • OpenBMC performance monitoring

Finding out more

Dive deeper into OpenBMC by opening the docs repository.

Technical Steering Committee

The Technical Steering Committee (TSC) guides the project. Members are:

  • Benjamin Fair, Google
  • Patrick Williams, Meta
  • Roxanne Clarke, IBM
  • Sagar Dharia, Microsoft
  • Samer El-Haj-Mahmoud, Arm
  • Terry Duncan, Intel

Contact

bmcweb's People

Contributors

anoo1 avatar apuli1 avatar asmithakarun avatar baemyung avatar carsonlab avatar edtanous avatar feistjj avatar fighternan avatar geissonator avatar gtmills avatar howitzer105mm avatar jayaprakashmutyala avatar jebr224 avatar jiaqingz-intel avatar jmbills avatar jonathan-doman avatar kamkowalski avatar krzysztof-i avatar lakshmi-y avatar leejenn1 avatar lxwinspur avatar manojkiraneda avatar phawryle avatar ratagupt avatar raviteja-b avatar spinler avatar sunharis avatar williamspatrick avatar wltu avatar zkurzyns avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bmcweb's Issues

Converge or configure HTTP response headers

As we move off of nginx and onto bmcweb, I want to ensure that bmcweb writes the correct HTTP response headers. Currently there are several nginx config files, e.g.,

Further, note meta-ibm nginx.conf adds HTTP response headers based on the URI being processed, e.g.:

  • for HTTP, the Strict-Transport-Security header should not be used
  • for the web app (URI=/), additional headers are needed that are not needed for REST APIs
  • Etc.

I would like to be able to converge all these into a single set of defaults (so no configuration is needed). But I don't have a strong background in this area.

Same named multiple firmware Inventory active resources ?

Doesnt say what inventory this is about here ? A dummy entry or a real data here ?

python redfish_cmd.py --target_ip xx.xx.xx.xx --request GET --url "UpdateService/FirmwareInventory" 
{
    "@odata.context": "/redfish/v1/$metadata#SoftwareInventoryCollection.SoftwareInventoryCollection", 
    "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory", 
    "@odata.type": "#SoftwareInventoryCollection.SoftwareInventoryCollection", 
    "Members": [
        {
            "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Active"
        }, 
        {
            "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Active"
        }, 
        {
            "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Active"
        }
    ], 
    "[email protected]": 3, 
    "Name": "Software Inventory Collection"
}
python redfish_cmd.py --target_ip xx.xx.xx.xx --request GET --url "UpdateService/FirmwareInventory/Active" 
{
    "@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory", 
    "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Active", 
    "@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory", 
    "Name": "Software Inventory", 
    "Status": {
        "Health": "OK", 
        "HealthRollup": "OK", 
        "State": "Enabled"
    }, 
    "Updateable": false
}

Redfish(LDAP): Add support for LDAP configuration in bmcweb.

SchemaFile:- https://redfish.dmtf.org/schemas/v1/AccountService.v1_3_1.json

In the above schema file there is a property named ActiveDirectory/LDAP

ActiveDirectory:- Would be used if ldap server is ActiveDirectory
LDAP:- would be used if ldap server is OpenLDAP/ other then AD.

LDAP /ActiveDirectory in redfish is of type of ExternalAccountProvider

Which Redfish Property(ActiveProperty/LDAP) to update it is same as D-Bus Property LDAPType.

Here is a mapping if LDAP Server is OpenLDAP/ActiveDirectory:

LDAP/ActiveDirectory:(RedfishProperty)

     AccountProviderType:- "LDAPService",
     ServiceEnabled :- "True,If LDAP needs to be used",
     ServiceAddress:- "Would be mapped to LDAPServerURI(D-Bus Property)",
     Authentication: 
            { "AutenticationType" : "UserNameandPassword"
              "UserName" : "LDAPBindDN (D-Bus Property)" 
               "Password" : "BindPassword "
            },
     LDAPService:
            {
                "SearchSettings" : 
                       {
                            "BaseDistinguishedNames" : "LDAPBaseDN(D-Bus Property)"
                            "UserNameAttribute" : "uid/cn"
                             "GroupsAttribute" : "memberof"
                        },
               },

Have not added the mapping for role-mapping, would add it through different story.

D-Bus interface which is used by the backend:- https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/User/Ldap/Config.interface.yaml

Chassis PowerState always shows on

So we don't lose the discussion on #12

https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/chassis.hpp#L151 Should look at:

  "CurrentPowerState": "xyz.openbmc_project.State.Chassis.PowerState.Off",

From https://redfish.dmtf.org/schemas/Chassis.v1_8_0.json:

        "PowerState": {
            "enum": [
                "On",
                "Off",
                "PoweringOn",
                "PoweringOff"
            ],
            "enumDescriptions": {
                "Off": "The components within the chassis has no power, except some components may continue to have AUX power such as management controller.",
                "On": "The components within the chassis has power on.",
                "PoweringOff": "A temporary state between On and Off. The components within the chassis can take time to process the power off action.",
                "PoweringOn": "A temporary state between Off and On. The components within the chassis can take time to process the power on action."
            },
            "type": "string"
        },

Read Attribute of power supply failing

We are seeing this fail
Read Attribute ${object_base_uri_path} Values quiet=${1}
where
object_base_uri_path=/org/open_power/sensors/aggregation/per_30s/ps0_input_power/average

Redfish login - 502 Bad Gateway

On the latest Master public code

ID="openbmc-phosphor"
NAME="Phosphor OpenBMC (Phosphor OpenBMC Project Reference Distro)"
VERSION="v2.3-188"
VERSION_ID="v2.3-188-g9c3cf82"
PRETTY_NAME="Phosphor OpenBMC (Phosphor OpenBMC Project Reference Distro) v2.3-188"
BUILD_ID="v2.3"

Did some changes went in recently which broke this code ?

-bash-4.1$ export BMC_IP=xx.xx.xx.xx
-bash-4.1$ curl --insecure -X POST -D headers.txt https://${BMC_IP}/redfish/v1/SessionService/Sessions -d '{"UserName":"root", "Password":"0penBmc"}'
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>

Journald

Aug 23 08:03:12 witherspoon nginx[1099]: 2018/08/23 08:03:12 [error] 1101#0: *109 connect() failed (111: Connection refused) while connecting to upstream, client: 9.3.xx.xx, server: 127.0.0.1, request: "POST /redfish/v1/SessionService/Sessions HTTP/1.1", upstream: "http://127.0.0.1:8082/redfish/v1/SessionService/Sessions", host: "xx.xx.xx.xx"

Redfish: Processor Internal error

On a witherspoon with a recent master builld

bash-4.1$ curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Systems/motherboard/Processors/cpu0
{
  "@odata.context": "/redfish/v1/$metadata#Processor.Processor",
  "@odata.id": "/redfish/v1/Systems/motherboard/Processors/cpu0",
  "@odata.type": "#Processor.v1_1_0.Processor",
  "Id": "cpu0",
  "Name": "Processor",
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message",
        "Message": "The request failed due to an internal service error.  The service is still operational.",
        "MessageArgs": [],
        "MessageId": "Base.1.4.0.InternalError",
        "Resolution": "Resubmit the request.  If the problem persists, consider resetting the service.",
        "Severity": "Critical"
      }
    ],
    "code": "Base.1.4.0.InternalError",
    "message": "The request failed due to an internal service error.  The service is still operational."
  }
}

This is caused by the ProcessorCoreCount property not existing.

if (coresCountProperty == properties.end())

Where does this ProcessorCoreCount come from? What interface?

curl -b cjar -k  https://${BMC_IP}/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
{
  "data": {
    "BuildDate": "1996-01-01 - 00:00:00", 
    "Cached": false, 
    "FieldReplaceable": true, 
    "Functional": true, 
    "Manufacturer": "IBM", 
    "Model": "", 
    "PartNumber": "02AA969", 
    "Present": true, 
    "PrettyName": "PROCESSOR MODULE", 
    "SerialNumber": "YA1934232158", 
    "Version": "21"
  }, 
  "message": "200 OK", 
  "status": "ok"
}

Why Software Inventory

Hi,

In the Firmware inventory, the firmware fo the bmc is named 'Software Inventory' (in update_service.hpp).
Is there any reason why the firmware for an open BMC is hard-coded ?
What would be the "Name=" for BIOS/CPLD/FPGA.... firmwares ?

Regards,
Francine

bmcweb crashes on upload of invalid software image file

It also returns a failure even when the image upload succeeds.

I don't think the bmcweb implementation of image upload is quite right.

How the phoshor-rest server does it, which works for both UBI and non-UBI software updates, is:

Subscribe to interfacesAdded on /xyz/openbmc_project/software and look for the xyz.openbmc_project.Software.Version interface. Pull the actual version off of the path in the signal, and return it.

If it doesn't get that signal with 10s, return an error.

I'll update bmcweb to do this.

Redfish for openBMC

I find the version of schema is latest in static folder, but it can not support the Composable System and the version of redifsh is 1.1 according to the hard code of RootService, I guess if the current implement of Redfish just following the OCP Redfish Profile, dont care the new Composable Service? or It will be supported later? and I can not find where handle with the schema json, just hardcode following the schema files?

POST request session response 405

I am trying test redfish interface with test_redfish_interfaces.robot in openbmc-test-automation

But it fail when Test Setup at the beginning.

It will POST a session and return 405.

image

Using curl command got the same result.
image

405 is Method Not Allowed response status code indicates that the request method is known by the server but is not supported by the target resource.

Does the POST session not support yet?

I also did test_rest_interfaces.robot test.

There is also POST test, but 405 is expected.

image

Does that related to this issue?

Thanks.

Latest build reported broken via RedfishServiceValidator.py

rango@ubuntu:~/REDFISH_DMTF/Redfish-Service-Validator$ cat config.ini
[SystemInformation]
TargetIP = xx.xx.xx.xx
SystemInfo = Test Config, place your own description of target system here
UserName = root
Password = 0penBmc
AuthType = Basic
Token = 
UseSSL = True
CertificateCheck = False
CertificateBundle = 

[Options]
MetadataFilePath = ./SchemaFiles/metadata
Schema_Pack = 
CacheMode = Off
CacheFilePath = 
SchemaSuffix = _v1.xml
Timeout = 30
HttpProxy = 
HttpsProxy = 
LocalOnlyMode = False
ServiceMode = False
LinkLimit = LogEntry:20
Sample = 0
VersionCheck = 

[Validator]
PayloadMode = Default
PayloadFilePath = 
LogPath = ./logs
rango@ubuntu:~/REDFISH_DMTF/Redfish-Service-Validator$ python3 RedfishServiceValidator.py -c config.ini
Redfish Service Validator, version 1.2.4
Setting up service...
Constructing metadata...
Service could not be started: Error accessing URI /redfish/v1/$metadata. Status code "401 Unauthorized". Check username and password supplied for "Basic" authentication.
rango@ubuntu:~/REDFISH_DMTF/Redfish-Service-Validator$ 

Dec 11 16:07:57 witherspoon systemd[1]: Started BMC Redfish Server (bmcweb).
Dec 11 16:08:24 witherspoon netipmid[1345]: User not found
Dec 11 16:09:04 witherspoon netipmid[1345]: User not found
Dec 11 16:09:44 witherspoon netipmid[1345]: User not found

In older build, we were able to run it.. not sure what broke the master latest.

Issue building bmcweb with SDK and -DBMCWEB_INSECURE_DISABLE_SSL=ON

The following compiler errors occur when building bmcweb with the SDK and the cmake option -DBMCWEB_INSECURE_DISABLE_SSL=ON

$ cmake -DYOCTO_DEPENDENCIES=1 -DBMCWEB_INSECURE_DISABLE_SSL=ON .
-- Toolchain file defaulted to '/esw/san5/openbmc/sdk/witherspoon/latest/sysroots/x86_64-oesdk-linux/usr/share/cmake/OEToolchainConfig.cmake'
-- The CXX compiler identification is GNU 8.2.0
-- Check for working CXX compiler: /esw/san5/openbmc/sdk/witherspoon/latest/sysroots/x86_64-oesdk-linux/usr/bin/arm-openbmc-linux-gnueabi/arm-openbmc-linux-gnueabi-g++
-- Check for working CXX compiler: /esw/san5/openbmc/sdk/witherspoon/latest/sysroots/x86_64-oesdk-linux/usr/bin/arm-openbmc-linux-gnueabi/arm-openbmc-linux-gnueabi-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Boost version: 1.69.0
-- Found OpenSSL: /esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/lib/libcrypto.so (found version "1.1.1a")  
OPENSSL_INCLUDE_DIR /esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include
CMAKE_BUILD_TYPE=
-- Found ZLIB: /esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/lib/libz.so (found version "1.2.11")
-- Performing Test PAM_MESSAGE_CONST
-- Performing Test PAM_MESSAGE_CONST - Success
-- Found PAM: /esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/lib/libpam.so;/esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/lib/libdl.so
-- Configuring done
-- Generating done
-- Build files have been written to: /esw/san5/shawnmm/obmc/bmcweb
 
$ make
Scanning dependencies of target bmcweb
[ 16%] Building CXX object CMakeFiles/bmcweb.dir/src/webserver_main.cpp.o
In file included from /esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:15,
                 from /esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/app.h:12,
                 from /esw/san5/shawnmm/obmc/bmcweb/src/webserver_main.cpp:1:
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_connection.h: In member function ‘void crow::Connection<Adaptor, Handler, Middlewares>::start()’:
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_connection.h:294:52: error: ‘ssl_stream’ is not a member of ‘boost::beast’
                                      boost::beast::ssl_stream<
                                                    ^~~~~~~~~~
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_connection.h:294:52: note: suggested alternative: ‘ostream’
                                      boost::beast::ssl_stream<
                                                    ^~~~~~~~~~
                                                    ostream
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_connection.h:293:28: error: parse error in template argument list
         if constexpr (std::is_same_v<Adaptor,
                            ^~~~~~~~~~~~~~~~~~
                                      boost::beast::ssl_stream<
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~
                                          boost::asio::ip::tcp::socket>>)
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_connection.h:295:72: error: expected primary-expression before ‘)’ token
                                          boost::asio::ip::tcp::socket>>)
                                                                        ^
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_connection.h:298:30: error: ‘boost::asio::ssl’ has not been declared
                 boost::asio::ssl::stream_base::server,
                              ^~~
In file included from /esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/app.h:12,
                 from /esw/san5/shawnmm/obmc/bmcweb/src/webserver_main.cpp:1:
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h: At global scope:
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:35:25: error: ‘boost::asio::ssl’ has not been declared
            boost::asio::ssl::context* adaptor_ctx = nullptr,
                         ^~~
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:47:25: error: ‘boost::asio::ssl’ has not been declared
            boost::asio::ssl::context* adaptor_ctx = nullptr,
                         ^~~
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:61:25: error: ‘boost::asio::ssl’ has not been declared
            boost::asio::ssl::context* adaptor_ctx = nullptr,
                         ^~~
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:220:18: error: ‘ssl’ in namespace ‘boost::asio’ does not name a type
     boost::asio::ssl::context* adaptorCtx;
                  ^~~
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h: In constructor ‘crow::Server<Handler, Adaptor, Middlewares>::Server(Handler*, std::unique_ptr<boost::asio::basic_socket_acceptor<boost::asio::ip::tcp> >&&, std::tuple<_Tail ...>*, int*, std::shared_ptr<boost::asio::io_context>)’:
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:41:9: error: class ‘crow::Server<Handler, Adaptor, Middlewares>’ does not have any field named ‘adaptorCtx’
         adaptorCtx(adaptor_ctx)
         ^~~~~~~~~~
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h: In member function ‘void crow::Server<Handler, Adaptor, Middlewares>::doAccept()’:
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:169:50: error: ‘ssl_stream’ is not a member of ‘boost::beast’
                                    boost::beast::ssl_stream<
                                                  ^~~~~~~~~~
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:169:50: note: suggested alternative: ‘ostream’
                                    boost::beast::ssl_stream<
                                                  ^~~~~~~~~~
                                                  ostream
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:170:62: error: template argument 2 is invalid
                                        boost::asio::ip::tcp::socket>>::value)
                                                              ^~~~~~
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:170:72: error: ‘::value’ has not been declared
                                        boost::asio::ip::tcp::socket>>::value)
                                                                        ^~~~~
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:172:48: error: ‘adaptorCtx’ was not declared in this scope
             adaptorTemp = Adaptor(*ioService, *adaptorCtx);
                                                ^~~~~~~~~~
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:172:48: note: suggested alternative: ‘Adaptor’
             adaptorTemp = Adaptor(*ioService, *adaptorCtx);
                                                ^~~~~~~~~~
                                                Adaptor
In file included from /esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/boost/random/detail/integer_log2.hpp:19,
                 from /esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/boost/random/detail/large_arithmetic.hpp:19,
                 from /esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/boost/random/detail/const_mod.hpp:23,
                 from /esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/boost/random/detail/seed_impl.hpp:26,
                 from /esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/boost/random/mersenne_twister.hpp:30,
                 from /esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/boost/uuid/random_generator.hpp:17,
                 from /esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/boost/uuid/uuid_generators.hpp:17,
                 from /esw/san5/shawnmm/obmc/bmcweb/include/image_upload.hpp:6,
                 from /esw/san5/shawnmm/obmc/bmcweb/src/webserver_main.cpp:7:
/esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/boost/pending/integer_log2.hpp: At global scope:
/esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/boost/pending/integer_log2.hpp:7:59: note: #pragma message: This header is deprecated. Use <boost/integer/integer_log2.hpp> instead.
 BOOST_HEADER_DEPRECATED("<boost/integer/integer_log2.hpp>");
                                                           ^
In file included from /esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:15,
                 from /esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/app.h:12,
                 from /esw/san5/shawnmm/obmc/bmcweb/src/webserver_main.cpp:1:
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_connection.h: In instantiation of ‘void crow::Connection<Adaptor, Handler, Middlewares>::start() [with Adaptor = boost::asio::basic_stream_socket<boost::asio::ip::tcp>; Handler = crow::Crow<crow::SecurityHeadersMiddleware, crow::persistent_data::Middleware, crow::token_authorization::Middleware>; Middlewares = {crow::SecurityHeadersMiddleware, crow::persistent_data::Middleware, crow::token_authorization::Middleware}]’:
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:189:50:   required from ‘void crow::Server<Handler, Adaptor, Middlewares>::doAccept() [with Handler = crow::Crow<crow::SecurityHeadersMiddleware, crow::persistent_data::Middleware, crow::token_authorization::Middleware>; Adaptor = boost::asio::basic_stream_socket<boost::asio::ip::tcp>; Middlewares = {crow::SecurityHeadersMiddleware, crow::persistent_data::Middleware, crow::token_authorization::Middleware}]’
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_server.h:157:9:   required from ‘void crow::Server<Handler, Adaptor, Middlewares>::run() [with Handler = crow::Crow<crow::SecurityHeadersMiddleware, crow::persistent_data::Middleware, crow::token_authorization::Middleware>; Adaptor = boost::asio::basic_stream_socket<boost::asio::ip::tcp>; Middlewares = {crow::SecurityHeadersMiddleware, crow::persistent_data::Middleware, crow::token_authorization::Middleware}]’
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/app.h:123:9:   required from ‘void crow::Crow<Middlewares>::run() [with Middlewares = {crow::SecurityHeadersMiddleware, crow::persistent_data::Middleware, crow::token_authorization::Middleware}]’
/esw/san5/shawnmm/obmc/bmcweb/src/webserver_main.cpp:106:13:   required from here
/esw/san5/shawnmm/obmc/bmcweb/crow/include/crow/http_connection.h:297:21: error: ‘class boost::asio::basic_stream_socket<boost::asio::ip::tcp>’ has no member named ‘async_handshake’; did you mean ‘async_send’?
             adaptor.async_handshake(
             ~~~~~~~~^~~~~~~~~~~~~~~
             async_send
make[2]: *** [CMakeFiles/bmcweb.dir/src/webserver_main.cpp.o] Error 1
make[1]: *** [CMakeFiles/bmcweb.dir/all] Error 2
make: *** [all] Error 2

REST /enumerate API doesn't return all objects

With the latest C++ mapper fixes, the /enumerate call misses things, like:

curl -c cjar -b cjar -k -H "Content-Type: application/json" -X GET   https://XXX/xyz/openbmc_project/state/enumerate
{
  "data": {},
  "message": "200 OK",
  "status": "ok"
}```

This is important because the robot CI tests use this extensively

Redfish: Manager bmc UUID is 'OpenBMC'

curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Managers/bmc

...
  "UUID": "OpenBmc"

Redfish-Service-Validator throws an error for this:
ERROR - UUID: String 'OpenBmc' does not match pattern ''[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}''

Need a change here:

res.jsonValue["UUID"] =

Unable to configure new IP address on eth interface

Unable to configure new IP address on eth interface via redfish.
Following command is run:

}bash-4.1$curl -k -H "X-Auth-Token: $bmc_token" -X PATCH -D patch.txt -d '{"IPv4Addresses": [{"Address": "10.7.7.7","AddressOrigin": "Static","SubnetMask": "255.255.0.0","Gateway":"10.7.7.1"},{"Address": "x.x.x.x","AddressOrigin": "Static","SubnetMask": "255.255.255.0","Gateway":"x.x.x.1"}]}' https://${bmc}/redfish/v1/Managers/bmc/EthernetInterfaces/eth0
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>

When we run to get configured results: it replaces link local address:

curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Managers/bmc/EthernetInterfaces/eth0/
{
  "@odata.context": "/redfish/v1/$metadata#EthernetInterface.EthernetInterface",
  "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0",
  "@odata.type": "#EthernetInterface.v1_2_0.EthernetInterface",
  "Description": "Management Network Interface",
  "IPv4Addresses": [
    {
      "Address": "10.7.7.7",
      "AddressOrigin": "IPv4LinkLocal",
      "Gateway": "0.0.0.0",
      "SubnetMask": "255.255.0.0"
    },
    {
      "Address": "x.x.x.x",
      "AddressOrigin": "Static",
      "Gateway": "x.x.x.1",
      "SubnetMask": "255.255.255.0"
    }
  ],
  "Id": "eth0",
  "MACAddress": "x.x.x.x.x.x",
  "Name": "Manager Ethernet Interface",
  "SpeedMbps": 0,
  "VLAN": {
    "VLANEnable": false,
    "VLANId": 0

But on system using ip addr:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether x.x.x.x.x.x.x brd ff:ff:ff:ff:ff:ff
    inet 169.254.245.177/16 brd 169.254.255.255 scope link eth0
       valid_lft forever preferred_lft forever
    inet x.x.x.x/24 brd x.x.x.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::72e2:84ffxx:xx/64 scope link
       valid_lft forever preferred_lft forever
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop qlen 1000

bmcweb crashes on subscribed service restarts

I stumbled into the fact that when the web UI is running, if the xyz.openbmc_project.State.Host service restarts, that bmcweb will crash with an unhandled exception that happens when it tries to handle the interfacesAdded signals it gets when the Host interfaces go back on the bus, which is does at all because the web UI subscribes to that interface using /subscribe.

I haven't determined yet if just catching that exception is good enough and the next time it will work, or what.

Building with debug enabled causes lots of warnings

I assume something to do with our recent gcc upgrade? Or maybe it's just been here for a bit. When you do a "cmake ./ -DCMAKE_BUILD_TYPE:type=Debug" you end up with all these warnings due to the tracing.

...
/esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/c++/8.2.0/bits/vector.tcc: In member function \u2018BasicJsonType* nlohmann::detail::json_sax_dom_parser<BasicJsonType>::handle_value(Value&&) [with Value = nlohmann::detail::value_t; BasicJsonType = nlohmann::basic_json<>]\u2019:
/esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/c++/8.2.0/bits/vector.tcc:109:4: note: parameter passing for argument of type \u2018__gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >\u2019 changed in GCC 7.1
    _M_realloc_insert(end(), std::forward<_Args>(__args)...);
    ^~~~~~~~~~~~~~~~~
/esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/c++/8.2.0/bits/vector.tcc: In member function \u2018void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&}; _Tp = nlohmann::basic_json<>; _Alloc = std::allocator<nlohmann::basic_json<> >]\u2019:
/esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/c++/8.2.0/bits/vector.tcc:413:7: note: parameter passing for argument of type \u2018std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >::iterator\u2019 {aka \u2018__gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >\u2019} changed in GCC 7.1
       vector<_Tp, _Alloc>::
       ^~~~~~~~~~~~~~~~~~~
/esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/c++/8.2.0/bits/vector.tcc: In member function \u2018bool nlohmann::detail::parser<BasicJsonType>::sax_parse_internal(SAX*) [with SAX = nlohmann::detail::json_sax_dom_parser<nlohmann::basic_json<> >; BasicJsonType = nlohmann::basic_json<>]\u2019:
/esw/san5/openbmc/sdk/witherspoon/latest/sysroots/armv6-openbmc-linux-gnueabi/usr/include/c++/8.2.0/bits/vector.tcc:109:4: note: parameter passing for argument of type \u2018__gnu_cxx::__normal_iterator<nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >\u2019 changed in GCC 7.1
    _M_realloc_insert(end(), std::forward<_Args>(__args)...);
...

Feature: Allow JsonSchema support to be optional

Given that the JsonSchema files take up quite a bit of space (~100k on my system), and not everyone might need them, it makes sense to make them a configurable feature, rather than a requirement. This likely could use the existing options capabilities to simply enable or disable the installation of those schema files, as well as the resulting route changes.

Redfish-JsonSchema-ResponseValidator.py errors

$ python Redfish-JsonSchema-ResponseValidator.py -p 0penBmc -r https://xx.xx.xx -S http://redfish.dmtf.org/schemas/v1/ -i /redfish/v1/Systems/motherboard
Redfish-JsonSchema-ResponseValidator version 1.0.1
https://xx.xx.xx:/redfish/v1/Systems/motherboard
>>>  '' is not valid under any of the given schemas
>>>  'BuildDate' does not match any of the regexes: '^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[a-zA-Z_][a-zA-Z0-9_.]+$'

1 resources validated.
2 errors. See ./validate_errs
schemas returned from GET   1
schemas returned from cache 0
$ cat ./validate_errs

/redfish/v1/Systems/motherboard
  schema: ComputerSystem.v1_3_0.json
>>>'' is not valid under any of the given schemas

/redfish/v1/Systems/motherboard
  schema: ComputerSystem.v1_3_0.json
>>>'BuildDate' does not match any of the regexes: '^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[a-zA-Z_][a-zA-Z0-9_.]+$'

Unable to modify MAC address

Unable to modify MAC address. Tried both PATCH and PUT methods.
PATCH gives 400 error
PUT gives 200 OK, but MAC address is not getting changed.

PUT method output:
bash-4.1$ curl -k -H "X-Auth-Token: $bmc_token" -X PUT -D put.txt -d '{"MACAddress": "x2:xx:xx:xx:xx:xx"}' https://${bmc}/redfish/v1/Managers/bmc/EthernetInterfaces/eth0/
bash-4.1$ cat put.txt
HTTP/1.1 200 OK
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: DENY
Pragma: no-cache
Cache-Control: no-Store,no-Cache
Content-Security-Policy: default-src 'self'
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-UA-Compatible: IE=11
Server: iBMC
Date: Fri, 15 Feb 2019 10:53:45 GMT
Content-Length: 0

PATCH method:
bash-4.1$ curl -k -H "X-Auth-Token: $bmc_token" -X PATCH -D patch.txt -d '{"MACAddress": "x2:xx:xx:xx:xx:xx"}' https://${bmc}/redfish/v1/Managers/bmc/EthernetInterfaces/eth0/
{
"[email protected]": [
{
"@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message",
"Message": "The property MACAddress is not in the list of valid properties for the resource.",
"MessageArgs": [
"MACAddress"
],
"MessageId": "Base.1.4.0.PropertyUnknown",
"Resolution": "Remove the unknown property from the request body and resubmit the request if the operation failed.",
"Severity": "Warning"
}
]
}bash-4.1$ cat patch.txt
HTTP/1.1 400 Bad Request
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: DENY
Pragma: no-cache
Cache-Control: no-Store,no-Cache
Content-Security-Policy: default-src 'self'
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-UA-Compatible: IE=11
Content-Type: application/json
Server: iBMC
Date: Fri, 15 Feb 2019 10:53:14 GMT
Content-Length: 481

Redfish(Network): DHCPv4Configuration

Map the following D-Bus Interface with Redfish Schema
https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Network/DHCPConfiguration.interface.yaml

Seems we have the Redfish Mapping for the same.
https://redfish.dmtf.org/schemas/EthernetInterface.v1_4_1.json
D-Bus Property                                                            Redfish Property
1) DNSEnabled                                                            UseDNSServers
2) NTPEnabled                                                            UseNTPServers
3) HostNameEnabled                                                  UseDomainName  ====> Can we use this?

4) EthernetInterface(DHCPEnabled)                           DHCPEnabled

IBM is working on it.

How to use bmcweb

Hi,

Sorry to bother you.
I'm new to BMC.
I'm trying to integrate openbmc with bmcweb.
But I'm confused about how to use bmcweb.
Directory /usr/share/www/redfish can be found on the openbmc.
bmcweb only provides redfish service?

Thanks

bmcweb fails to compile in the openbmc SDK

I've spent a bit of time here and there trying to get bmcweb to compile within the openbmc SDK. I found and patched one issue with https://gerrit.openbmc-project.xyz/#/c/openbmc/openbmc/+/11901/ but I'm still not quite there and I gotta move on for now. So opening this bug to track what I've found.

With an SDK built based on the commit above, I get this when I compile:

andrewg@andrewg-VirtualBox:~/Code/bmcweb$ cmake .
-- The CXX compiler identification is GNU 7.3.0
-- Check for working CXX compiler: /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/bin/arm-openbmc-linux-gnueabi/arm-openbmc-linux-gnueabi-g++
-- Check for working CXX compiler: /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/bin/arm-openbmc-linux-gnueabi/arm-openbmc-linux-gnueabi-g++ -- broken
CMake Error at /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/share/cmake-3.10/Modules/CMakeTestCXXCompiler.cmake:45 (message):
  The C++ compiler

    "/home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/bin/arm-openbmc-linux-gnueabi/arm-openbmc-linux-gnueabi-g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/andrewg/Code/bmcweb/3rdparty/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/make" "cmTC_4e71b/fast"
    /usr/bin/make -f CMakeFiles/cmTC_4e71b.dir/build.make CMakeFiles/cmTC_4e71b.dir/build
    make[1]: Entering directory '/home/andrewg/Code/bmcweb/3rdparty/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_4e71b.dir/testCXXCompiler.cxx.o
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/bin/arm-openbmc-linux-gnueabi/arm-openbmc-linux-gnueabi-g++    -O2 -pipe -g -feliminate-unused-debug-types    -o CMakeFiles/cmTC_4e71b.dir/testCXXCompiler.cxx.o -c /home/andrewg/Code/bmcweb/3rdparty/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    Linking CXX executable cmTC_4e71b
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4e71b.dir/link.txt --verbose=1
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/bin/arm-openbmc-linux-gnueabi/arm-openbmc-linux-gnueabi-g++  -O2 -pipe -g -feliminate-unused-debug-types   -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed  -rdynamic CMakeFiles/cmTC_4e71b.dir/testCXXCompiler.cxx.o  -o cmTC_4e71b 
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/7.3.0/real-ld: cannot find crt1.o: No such file or directory
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/7.3.0/real-ld: cannot find crti.o: No such file or directory
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/7.3.0/real-ld: cannot find crtbegin.o: No such file or directory
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/7.3.0/real-ld: cannot find -lstdc++
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/7.3.0/real-ld: cannot find -lm
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/7.3.0/real-ld: cannot find -lgcc_s
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/7.3.0/real-ld: cannot find -lgcc
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/7.3.0/real-ld: cannot find -lc
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/7.3.0/real-ld: cannot find -lgcc_s
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/7.3.0/real-ld: cannot find -lgcc
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/7.3.0/real-ld: cannot find crtend.o: No such file or directory
    /home/andrewg/sdk/08102018-witherspoon/sysroots/x86_64-oesdk-linux/usr/libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/7.3.0/real-ld: cannot find crtn.o: No such file or directory
    collect2: error: ld returned 1 exit status
    CMakeFiles/cmTC_4e71b.dir/build.make:97: recipe for target 'cmTC_4e71b' failed
    make[1]: *** [cmTC_4e71b] Error 1
    make[1]: Leaving directory '/home/andrewg/Code/bmcweb/3rdparty/CMakeFiles/CMakeTmp'
    Makefile:126: recipe for target 'cmTC_4e71b/fast' failed
    make: *** [cmTC_4e71b/fast] Error 2
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt


-- Configuring incomplete, errors occurred!
See also "/home/andrewg/Code/bmcweb/3rdparty/CMakeFiles/CMakeOutput.log".
See also "/home/andrewg/Code/bmcweb/3rdparty/CMakeFiles/CMakeError.log".
make: *** No targets specified and no makefile found.  Stop.
-- Boost version: 1.66.0
CMake Error: File /home/andrewg/Code/bmcweb/sdbusplus-src/sdbusplus/server.hpp.in does not exist.
CMake Error at CMakeLists.txt:118 (configure_file):
  configure_file Problem configuring file


CMake Error: File /home/andrewg/Code/bmcweb/sdbusplus-src/sdbusplus/bus.hpp.in does not exist.
CMake Error at CMakeLists.txt:122 (configure_file):
  configure_file Problem configuring file


OPENSSL_INCLUDE_DIR /home/andrewg/sdk/08102018-witherspoon/sysroots/armv6-openbmc-linux-gnueabi/usr/include
CMAKE_BUILD_TYPE=
-- Configuring incomplete, errors occurred!
See also "/home/andrewg/Code/bmcweb/CMakeFiles/CMakeOutput.log".
See also "/home/andrewg/Code/bmcweb/CMakeFiles/CMakeError.log".
andrewg@andrewg-VirtualBox:~/Code/bmcweb$ 

The error seem to indicate that cmake is not getting the appropriate SDK paths. The required files and libraries are in the SDK:

andrewg@andrewg-VirtualBox:~/Code/bmcweb$ ls /home/andrewg/sdk/08102018-witherspoon/sysroots/armv6-openbmc-linux-gnueabi/usr/lib/crt*
/home/andrewg/sdk/08102018-witherspoon/sysroots/armv6-openbmc-linux-gnueabi/usr/lib/crt1.o
/home/andrewg/sdk/08102018-witherspoon/sysroots/armv6-openbmc-linux-gnueabi/usr/lib/crti.o
/home/andrewg/sdk/08102018-witherspoon/sysroots/armv6-openbmc-linux-gnueabi/usr/lib/crtn.o

But it's not finding them for some reason. I don't think this is a bmcweb specific issue, I think it's probably a cmake related issue with the SDK.

I'm running at commit 1b0044b

bmcweb's REST API doesn't support method return data

Calling a D-Bus method via REST with /path/action/method needs to support returning the method data, if there is any. It already has the introspection data, so it knows the signature. It just needs to grab the data from the d-bus message and convert it to the proper form for the JSON response.

I plan on working on this.

Redfish: DNS configuration not working

Unable to configure nameservers on BMC.

bash-4.1$ curl -k -H "X-Auth-Token: $bmc_token" -X PATCH -D patch.txt -d '{"NameServers": ["10.6.6.6"]}' https://${bmc}/redfish/v1/Managers/bmc/EthernetInterfaces/eth0/
{
  "[email protected]": [
    {
      "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message",
      "Message": "The property NameServers is not in the list of valid properties for the resource.",
      "MessageArgs": [
        "NameServers"
      ],
      "MessageId": "Base.1.4.0.PropertyUnknown",
      "Resolution": "Remove the unknown property from the request body and resubmit the request if the operation failed.",
      "Severity": "Warning"
    }
  ]
}bash-4.1$ curl -k -H "X-Auth-Token: $bmc_token" -X PATCH -D patch.txt -d '{"NameServers": "10.6.6.6"}' https://${bmc}/redfish/v1/Managers/bmc/EthernetInterfaces/eth0/
{
  "[email protected]": [
    {
      "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message",
      "Message": "The property NameServers is not in the list of valid properties for the resource.",
      "MessageArgs": [
        "NameServers"
      ],
      "MessageId": "Base.1.4.0.PropertyUnknown",
      "Resolution": "Remove the unknown property from the request body and resubmit the request if the operation failed.",
      "Severity": "Warning"
    }
  ]

Redfish: Memory internal error

Recent master build on a Witherspoon

 curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Systems/motherboard/Memory/dimm9
{
  "@odata.context": "/redfish/v1/$metadata#Memory.Memory",
  "@odata.id": "/redfish/v1/Systems/motherboard/Memory/dimm9",
  "@odata.type": "#Memory.v1_2_0.Memory",
  "Id": "dimm9",
  "Name": "DIMM Slot",
  "error": {
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message",
        "Message": "The request failed due to an internal service error.  The service is still operational.",
        "MessageArgs": [],
        "MessageId": "Base.1.4.0.InternalError",
        "Resolution": "Resubmit the request.  If the problem persists, consider resetting the service.",
        "Severity": "Critical"
      }
    ],
    "code": "Base.1.4.0.InternalError",
    "message": "The request failed due to an internal service error.  The service is still operational."
  }

Where is this MemorySizeInKB property coming from?

if (memorySizeProperty == properties.end())
is where the internal error is coming from.

root@witherspoon:~#  busctl introspect xyz.openbmc_project.Inventory.Manager      /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0 | cat
NAME                                                  TYPE      SIGNATURE RESULT/VALUE           FLAGS
org.freedesktop.DBus.Introspectable                   interface -         -                      -
.Introspect                                           method    -         s                      -
org.freedesktop.DBus.Peer                             interface -         -                      -
.GetMachineId                                         method    -         s                      -
.Ping                                                 method    -         -                      -
org.freedesktop.DBus.Properties                       interface -         -                      -
.Get                                                  method    ss        v                      -
.GetAll                                               method    s         a{sv}                  -
.Set                                                  method    ssv       -                      -
.PropertiesChanged                                    signal    sa{sv}as  -                      -
xyz.openbmc_project.Inventory.Decorator.Asset         interface -         -                      -
.BuildDate                                            property  s         ""                     emits-change writable
.Manufacturer                                         property  s         "0x2c80"               emits-change writable
.Model                                                property  s         "36ASF4G72PZ-2G6D1   " emits-change writable
.PartNumber                                           property  s         ""                     emits-change writable
.SerialNumber                                         property  s         "0x1434d95b"           emits-change writable
xyz.openbmc_project.Inventory.Decorator.Cacheable     interface -         -                      -
.Cached                                               property  b         false                  emits-change writable
xyz.openbmc_project.Inventory.Decorator.Replaceable   interface -         -                      -
.FieldReplaceable                                     property  b         true                   emits-change writable
xyz.openbmc_project.Inventory.Decorator.Revision      interface -         -                      -
.Version                                              property  s         "0x31"                 emits-change writable
xyz.openbmc_project.Inventory.Item                    interface -         -                      -
.Present                                              property  b         true                   emits-change writable
.PrettyName                                           property  s         "0x0c"                 emits-change writable
xyz.openbmc_project.Inventory.Item.Dimm               interface -         -                      -
xyz.openbmc_project.State.Decorator.OperationalStatus interface -         -                      -
.Functional 

Unable to configure hostname using redfish

PATCH is giving 405 method not allowed.
PUT is giving 200OK but hostname is not getting changed.
bash-4.1$ curl -k -H "X-Auth-Token: $bmc_token" -X PATCH -D patch.txt -d '{"HostName": "bmcbmc"}' https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol
Method Not Allowedbash-4.1$ cat patch.txt
HTTP/1.1 405 Method Not Allowed
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: DENY
Pragma: no-cache
Cache-Control: no-Store,no-Cache
Content-Security-Policy: default-src 'self'
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-UA-Compatible: IE=11
Server: iBMC
Date: Fri, 15 Feb 2019 11:05:15 GMT
Content-Length: 18

bash-4.1$ curl -k -H "X-Auth-Token: $bmc_token" -X PUT -D put.txt -d '{"HostName": "bmcbmc"}' https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol

bash-4.1$ cat put.txt
HTTP/1.1 200 OK
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: DENY
Pragma: no-cache
Cache-Control: no-Store,no-Cache
Content-Security-Policy: default-src 'self'
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-UA-Compatible: IE=11
Server: iBMC
Date: Fri, 15 Feb 2019 11:05:47 GMT
Content-Length: 0

bash-4.1$ curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol
{
"@odata.context": "/redfish/v1/$metadata#ManagerNetworkProtocol.ManagerNetworkProtocol",
"@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol",
"@odata.type": "#ManagerNetworkProtocol.v1_1_0.ManagerNetworkProtocol",
"Description": "Manager Network Service",
"HTTPS": {
"ProtocolEnabled": false
},
"HostName": "witherspoon",
"IPMI": {
"Port": 623,
"ProtocolEnabled": false
},
"Id": "NetworkProtocol",
"Name": "Manager Network Protocol",
"SSH": {
"Port": 22,
"ProtocolEnabled": false
},
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"

build error with build_x86.sh

Got a buld error with cmake ..
checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages ./configure: line 5115: syntax error near unexpected token newline'
./configure: line 5115: AX_PKG_CHECK_MODULES(' CMakeFiles/sdbusplus-project.dir/build.make:110: recipe for target '/home/yyaocs/bmcweb/build/sdbusplus-project/src/sdbusplus-project-stamp/sdbusplus-project-build' failed CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/sdbusplus-project.dir/all' failed make[2]: *** [/home/yyaocs/bmcweb/build/sdbusplus-project/src/sdbusplus-project-stamp/sdbusplus-project-build] Error 2 make[1]: *** [CMakeFiles/sdbusplus-project.dir/all] Error 2 make: *** [all] Error 2

The full log:
`yyaocs@ubuntu:~/bmcweb/build$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yyaocs/bmcweb/build/3rdparty
[ 2%] Performing update step for 'nlohmann-json'
[ 5%] No configure step for 'nlohmann-json'
[ 7%] No build step for 'nlohmann-json'
[ 10%] Performing install step for 'nlohmann-json'
[ 12%] Completed 'nlohmann-json'
[ 20%] Built target nlohmann-json
[ 22%] Performing update step for 'sdbusplus-project'
[ 25%] No configure step for 'sdbusplus-project'
[ 27%] Performing build step for 'sdbusplus-project'

  • AUTOCONF_FILES=Makefile.in aclocal.m4 ar-lib autom4te.cache compile config.guess config.h.in config.sub configure depcomp install-sh ltmain.sh missing *libtool test-driver

  • autoreconf -vfi
    autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -Im4 autoreconf: configure.ac: tracing autoreconf: running: libtoolize --copy --force libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'. libtoolize: copying file 'build-aux/ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. libtoolize: copying file 'm4/libtool.m4' libtoolize: copying file 'm4/ltoptions.m4' libtoolize: copying file 'm4/ltsugar.m4' libtoolize: copying file 'm4/ltversion.m4' libtoolize: copying file 'm4/lt~obsolete.m4' autoreconf: running: /usr/bin/autoconf --force autoreconf: running: /usr/bin/autoheader --force autoreconf: running: automake --add-missing --copy --force-missing configure.ac:25: installing 'build-aux/compile' configure.ac:7: installing 'build-aux/missing' Makefile.am: installing 'build-aux/depcomp' autoreconf: Leaving directory .'
    Run "./configure ${CONFIGURE_FLAGS} && make"

  • echo Run "./configure ${CONFIGURE_FLAGS} && make"
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking whether make supports nested variables... yes
    checking whether make supports nested variables... (cached) yes
    checking for g++... g++
    checking whether the C++ compiler works... yes
    checking for C++ compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    checking for style of include used by make... GNU
    checking dependency style of g++... gcc3
    checking for gcc... gcc
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking whether gcc understands -c and -o together... yes
    checking dependency style of gcc... gcc3
    checking for ar... ar
    checking the archiver (ar) interface... ar
    checking whether make sets $(MAKE)... (cached) yes
    checking for a Python interpreter with version >= 2.7... python
    checking for python... /usr/bin/python
    checking for python version... 2.7
    checking for python platform... linux2
    checking for python script directory... ${prefix}/lib/python2.7/dist-packages
    checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages
    ./configure: line 5115: syntax error near unexpected token newline' ./configure: line 5115: AX_PKG_CHECK_MODULES('
    CMakeFiles/sdbusplus-project.dir/build.make:110: recipe for target '/home/yyaocs/bmcweb/build/sdbusplus-project/src/sdbusplus-project-stamp/sdbusplus-project-build' failed
    CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/sdbusplus-project.dir/all' failed
    make[2]: *** [/home/yyaocs/bmcweb/build/sdbusplus-project/src/sdbusplus-project-stamp/sdbusplus-project-build] Error 2
    make[1]: *** [CMakeFiles/sdbusplus-project.dir/all] Error 2
    make: *** [all] Error 2
    Makefile:83: recipe for target 'all' failed
    CMake Error at /usr/share/cmake-3.5/Modules/FindBoost.cmake:1677 (message):
    Unable to find the requested Boost libraries.

    Boost version: 1.58.0

    Boost include path: /usr/include

    Detected version of Boost is too old. Requested version was 1.66 (or
    newer).
    Call Stack (most recent call first):
    CMakeLists.txt:124 (find_package)

OPENSSL_INCLUDE_DIR /usr/include
CMAKE_BUILD_TYPE=
CMake Error at CMakeLists.txt:172 (find_package):
By not providing "Findtinyxml2.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "tinyxml2",
but CMake did not find one.

Could not find a package configuration file provided by "tinyxml2" with any
of the following names:

tinyxml2Config.cmake
tinyxml2-config.cmake

Add the installation prefix of "tinyxml2" to CMAKE_PREFIX_PATH or set
"tinyxml2_DIR" to a directory containing one of the above files. If
"tinyxml2" provides a separate development package or SDK, be sure it has
been installed.

-- Configuring incomplete, errors occurred!
See also "/home/yyaocs/bmcweb/build/CMakeFiles/CMakeOutput.log".
`

OEM Id schema need fix

For the resource /redfish/v1/Managers/bmc/ I see the following

  "Oem": {
    "@odata.context": "/redfish/v1/$metadata#OemManager.Oem",
    "@odata.id": "/redfish/v1/Managers/bmc#/Oem",
    "@odata.type": "#OemManager.Oem",
    "OpenBmc": {
      "@odata.context": "/redfish/v1/$metadata#OemManager.OpenBmc",
      "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc",
      "@odata.type": "#OemManager.OpenBmc"
    }
  },

those "@odata.id" should be "@odata.id": "/redfish/v1/Managers/bmc/Oem",and "@odata.id": "/redfish/v1/Managers/bmc/Oem/OpenBmc"

REST API errors aren't in JSON

The Robot CI tests needs responses like:

curl -c cjar -b cjar -k -H "Content-Type: application/json" -X GET   https://XXX/xyz/openbmc_project/blah
{
  "data": {
    "description": "org.freedesktop.DBus.Error.FileNotFound: path or object not found: /xyz/openbmc_project/blah"
  }, 
  "message": "404 Not Found", 
  "status": "error"
}

instead of:

$ curl -c cjar -b cjar -k -H "Content-Type: application/json" -X GET   https://XXX/xy_project/blah
Not Found

unit tests not run and do not compile in openbmc CI

Do these just need some TLC? Is there a unit test plan with bmcweb? I see a bunch of tests out there but when I enabled them and ran them within the openbmc CI unit test docker container I got the below errors.

I'm also interested in our plans for unit testing our Redfish support. https://github.com/openbmc/bmcweb/tree/master/redfish-core/ut is the landing spot for these? We probably want some IRC discussion on mocking some of the crow::connections::systemBus calls?

/home/andrewg/Code/bmcweb > cmake --build . -- -j 128
Scanning dependencies of target getvideo
Scanning dependencies of target bmcweb
[  4%] Generating include/bmcweb/blns.hpp
Scanning dependencies of target webtest
[  9%] Building CXX object CMakeFiles/getvideo.dir/src/getvideo_main.cpp.o
[ 13%] Building CXX object CMakeFiles/bmcweb.dir/src/webserver_main.cpp.o
[ 18%] Building CXX object CMakeFiles/bmcweb.dir/redfish-core/src/error_messages.cpp.o
[ 22%] Building CXX object CMakeFiles/bmcweb.dir/redfish-core/src/utils/json_utils.cpp.o
[ 31%] Building CXX object CMakeFiles/webtest.dir/redfish-core/src/error_messages.cpp.o
[ 31%] Building CXX object CMakeFiles/webtest.dir/redfish-core/src/utils/json_utils.cpp.o
[ 36%] Building CXX object CMakeFiles/webtest.dir/src/gtest_main.cpp.o
[ 40%] Building CXX object CMakeFiles/webtest.dir/src/crow_test.cpp.o
[ 45%] Building CXX object CMakeFiles/webtest.dir/src/token_authorization_middleware_test.cpp.o
[ 50%] Building CXX object CMakeFiles/webtest.dir/src/webassets_test.cpp.o
[ 54%] Building CXX object CMakeFiles/webtest.dir/src/crow_getroutes_test.cpp.o
[ 59%] Building CXX object CMakeFiles/webtest.dir/src/security_headers_middleware_test.cpp.o
[ 63%] Building CXX object CMakeFiles/webtest.dir/src/ast_jpeg_decoder_test.cpp.o
[ 72%] Building CXX object CMakeFiles/webtest.dir/src/kvm_websocket_test.cpp.o
[ 72%] Building CXX object CMakeFiles/webtest.dir/src/msan_test.cpp.o
[ 77%] Building CXX object CMakeFiles/webtest.dir/src/ast_video_puller_test.cpp.o
[ 81%] Building CXX object CMakeFiles/webtest.dir/src/openbmc_jtag_rest_test.cpp.o
[ 86%] Building CXX object CMakeFiles/webtest.dir/redfish-core/ut/privileges_test.cpp.o
[ 90%] Linking CXX executable getvideo
[ 90%] Built target getvideo
/home/andrewg/Code/bmcweb/src/crow_getroutes_test.cpp: In member function 'virtual void GetRoutes_TestEmptyRoutes_Test::TestBody()':
/home/andrewg/Code/bmcweb/src/crow_getroutes_test.cpp:12:20: error: 'server_t' is not a member of 'crow::SimpleApp' {aka 'crow::Crow<>'}
     decltype(app)::server_t server(&app, "127.0.0.1", 45451);
                    ^~~~~~~~
/home/andrewg/Code/bmcweb/src/crow_getroutes_test.cpp: In member function 'virtual void GetRoutes_TestOneRoute_Test::TestBody()':
/home/andrewg/Code/bmcweb/src/crow_getroutes_test.cpp:21:20: error: 'server_t' is not a member of 'crow::SimpleApp' {aka 'crow::Crow<>'}
     decltype(app)::server_t server(&app, "127.0.0.1", 45451);
                    ^~~~~~~~
/home/andrewg/Code/bmcweb/src/crow_getroutes_test.cpp: In member function 'virtual void GetRoutes_TestlotsOfRoutes_Test::TestBody()':
/home/andrewg/Code/bmcweb/src/crow_getroutes_test.cpp:32:20: error: 'server_t' is not a member of 'crow::SimpleApp' {aka 'crow::Crow<>'}
     decltype(app)::server_t server(&app, "127.0.0.1", 45451);
                    ^~~~~~~~
/home/andrewg/Code/bmcweb/src/crow_test.cpp: In member function 'virtual void Crow_middleware_simple_Test::TestBody()':
/home/andrewg/Code/bmcweb/src/crow_test.cpp:521:20: error: 'server_t' is not a member of 'crow::App<NullMiddleware, NullSimpleMiddleware>' {aka 'crow::Crow<NullMiddleware, NullSimpleMiddleware>'}
     decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451);
                    ^~~~~~~~
/home/andrewg/Code/bmcweb/src/crow_test.cpp: In member function 'virtual void Crow_middlewareContext_Test::TestBody()':
/home/andrewg/Code/bmcweb/src/crow_test.cpp:645:20: error: 'server_t' is not a member of 'crow::App<IntSettingMiddleware, FirstMW, SecondMW, ThirdMW>' {aka 'crow::Crow<IntSettingMiddleware, FirstMW, SecondMW, ThirdMW>'}
     decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451);
                    ^~~~~~~~
/home/andrewg/Code/bmcweb/src/crow_test.cpp: In lambda function:
/home/andrewg/Code/bmcweb/src/crow_test.cpp:646:41: error: 'server' was not declared in this scope
     auto _ = async(launch::async, [&] { server.run(); });
                                         ^~~~~~
/home/andrewg/Code/bmcweb/src/crow_test.cpp:646:41: note: suggested alternative: 'servent'
     auto _ = async(launch::async, [&] { server.run(); });
                                         ^~~~~~
                                         servent
/home/andrewg/Code/bmcweb/src/crow_test.cpp: In member function 'virtual void Crow_middlewareContext_Test::TestBody()':
/home/andrewg/Code/bmcweb/src/crow_test.cpp:690:5: error: 'server' was not declared in this scope
     server.stop();
     ^~~~~~
/home/andrewg/Code/bmcweb/src/crow_test.cpp:690:5: note: suggested alternative: 'servent'
     server.stop();
     ^~~~~~
     servent
/home/andrewg/Code/bmcweb/src/crow_test.cpp: In member function 'virtual void Crow_bug_quick_repeated_request_Test::TestBody()':
/home/andrewg/Code/bmcweb/src/crow_test.cpp:701:20: error: 'server_t' is not a member of 'crow::SimpleApp' {aka 'crow::Crow<>'}
     decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451);
                    ^~~~~~~~
/home/andrewg/Code/bmcweb/src/crow_test.cpp: In lambda function:
/home/andrewg/Code/bmcweb/src/crow_test.cpp:702:41: error: 'server' was not declared in this scope
     auto _ = async(launch::async, [&] { server.run(); });
                                         ^~~~~~
/home/andrewg/Code/bmcweb/src/crow_test.cpp:702:41: note: suggested alternative: 'servent'
     auto _ = async(launch::async, [&] { server.run(); });
                                         ^~~~~~
                                         servent
/home/andrewg/Code/bmcweb/src/crow_test.cpp: In member function 'virtual void Crow_bug_quick_repeated_request_Test::TestBody()':
/home/andrewg/Code/bmcweb/src/crow_test.cpp:726:5: error: 'server' was not declared in this scope
     server.stop();
     ^~~~~~
/home/andrewg/Code/bmcweb/src/crow_test.cpp:726:5: note: suggested alternative: 'servent'
     server.stop();
     ^~~~~~
     servent
/home/andrewg/Code/bmcweb/src/crow_test.cpp: In member function 'virtual void Crow_simple_url_params_Test::TestBody()':
/home/andrewg/Code/bmcweb/src/crow_test.cpp:745:20: error: 'server_t' is not a member of 'crow::SimpleApp' {aka 'crow::Crow<>'}
     decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451);
                    ^~~~~~~~
/home/andrewg/Code/bmcweb/src/crow_test.cpp: In lambda function:
/home/andrewg/Code/bmcweb/src/crow_test.cpp:746:41: error: 'server' was not declared in this scope
     auto _ = async(launch::async, [&] { server.run(); });
                                         ^~~~~~
/home/andrewg/Code/bmcweb/src/crow_test.cpp:746:41: note: suggested alternative: 'servent'
     auto _ = async(launch::async, [&] { server.run(); });
                                         ^~~~~~
                                         servent
/home/andrewg/Code/bmcweb/src/crow_test.cpp: In member function 'virtual void Crow_simple_url_params_Test::TestBody()':
/home/andrewg/Code/bmcweb/src/crow_test.cpp:868:5: error: 'server' was not declared in this scope
     server.stop();
     ^~~~~~
/home/andrewg/Code/bmcweb/src/crow_test.cpp:868:5: note: suggested alternative: 'servent'
     server.stop();
     ^~~~~~
     servent
In file included from /home/andrewg/Code/bmcweb/prefix/include/gtest/gtest.h:360,
                 from /home/andrewg/Code/bmcweb/prefix/include/gmock/internal/gmock-internal-utils.h:46,
                 from /home/andrewg/Code/bmcweb/prefix/include/gmock/gmock-actions.h:46,
                 from /home/andrewg/Code/bmcweb/prefix/include/gmock/gmock.h:58,
                 from /home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:3:
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp: In member function 'virtual void OpenBmcDbusTest_TestArgSplit_Test::TestBody()':
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:9:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("x"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:9:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:11:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("y"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:11:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:13:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("b"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:13:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:15:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("n"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:15:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:17:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("q"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:17:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:19:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("i"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:19:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:21:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("u"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:21:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:23:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("x"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:23:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:25:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("t"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:25:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:27:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("d"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:27:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:29:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("h"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:29:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:32:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("ai"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:32:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:34:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("ax"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:34:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:37:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("(sss)"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:37:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:39:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("(sss)b"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:39:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:41:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("b(sss)"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:41:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:45:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("a{si}b"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:45:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:47:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("a(sss)b"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:47:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:49:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("aa{si}b"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:49:39: note: suggested alternative: 'dbusArgSplit'
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:51:39: error: 'dbus_arg_split' is not a member of 'crow::openbmc_mapper'
     EXPECT_THAT(crow::openbmc_mapper::dbus_arg_split("i{si}b"),
                                       ^~~~~~~~~~~~~~
/home/andrewg/Code/bmcweb/src/openbmc_jtag_rest_test.cpp:51:39: note: suggested alternative: 'dbusArgSplit'
CMakeFiles/webtest.dir/build.make:234: recipe for target 'CMakeFiles/webtest.dir/src/crow_getroutes_test.cpp.o' failed
make[2]: *** [CMakeFiles/webtest.dir/src/crow_getroutes_test.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/webtest.dir/build.make:114: recipe for target 'CMakeFiles/webtest.dir/src/crow_test.cpp.o' failed
make[2]: *** [CMakeFiles/webtest.dir/src/crow_test.cpp.o] Error 1
CMakeFiles/webtest.dir/build.make:354: recipe for target 'CMakeFiles/webtest.dir/src/openbmc_jtag_rest_test.cpp.o' failed
make[2]: *** [CMakeFiles/webtest.dir/src/openbmc_jtag_rest_test.cpp.o] Error 1
CMakeFiles/Makefile2:931: recipe for target 'CMakeFiles/webtest.dir/all' failed
make[1]: *** [CMakeFiles/webtest.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 95%] Linking CXX executable bmcweb
[ 95%] Built target bmcweb
Makefile:140: recipe for target 'all' failed

Redfish(Network): How to delete the IP addresses?

In redfish ipv4addresses(array type) is the property under ethernet interface resource, So user should be allowed to add and deletion of certain ip addresses.
I could have seen that user can not delete the ip address as we have the following condition which stops deleting the IPaddress.

        const std::string &ifaceId, const nlohmann::json &input,
        const boost::container::flat_set<IPv4AddressData> &ipv4Data,
        const std::shared_ptr<AsyncResp> asyncResp)
    {
        if (!input.is_array())
        {
            messages::propertyValueTypeError(asyncResp->res, input.dump(),
                                             "IPv4Addresses");
            return;
        }

        // According to Redfish PATCH definition, size must be at least equal
        if (input.size() < ipv4Data.size())      <<<<<<<<<<<<  here if input size is less then existing list then patch is not allowed which is incorrect.
        {
            messages::propertyValueFormatError(asyncResp->res, input.dump(),
                                               "IPv4Addresses");
            return;
}```

REST: GET /foo could use a full error response

Continuing with issue #15, when doing a GET on a completely invalid path that doesn't start with /xyz or /org, it would be nice to get the full

{
  "data": {
    "description": "org.freedesktop.DBus.Error.FileNotFound: path or object not found"
  },
  "message": "404 Not Found",
  "status": "error"
}

instead of just:

Not Found

websocket not working

Hi all,

I started my websocket tests from the scripts\websocket_test.py file.

Issue : The connection is always closed after a first ws.recv() (empty result).

I spent times to get a correct handshake, so in create_connection cookie parameter, I suppose XSRF-TOKEN is the token received in the response when creating a session and SESSION is the received session id.

This part seems to work,

*1. Create a session with a secure POST
r = requests.post('https://mybmc/redfish/v1/SessionService/Sessions', auth=('root', 'fakerootpass'), json={"UserName": "root", "Password": "fakerootpass"} , verify=False)
cookie = requests.utils.dict_from_cookiejar(r.cookies) => cookie jar empty => so it is useless...
*2. Retrieve token and Id
response = json.loads(r.text)
session_id = response['Id']
auth_token = r.headers['x-auth-token']

websocket.enableTrace(True)
*3. Connect with token and Id inside a cookie, as in the example - not clear ...
ws = websocket.create_connection('wss://mybmc/subscribe'    
    , verify=False
    , sslopt={"cert_reqs": ssl.CERT_NONE,"check_hostname": False} #,"check_hostname": False,"ssl_version": ssl.PROTOCOL_TLSv1 
    , cookie="XSRF-TOKEN={token}; SESSION={session}".format(token=auth_token, session=session_id)
    )
body = json.dumps({
    'paths': ['/xyz/openbmc_project/logging', '/xyz/openbmc_project/sensors']
    ,"interfaces": ["xyz.openbmc_project.Logging.Entry", "xyz.openbmc_project.Sensor.Value"]
})

ws.send(body)

Debug trace
--- request header ---
GET /subscribe HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Host: 172.31.92.34
Origin: http://172.31.92.34
Sec-WebSocket-Key: 96TyH/XoygwMUBPsUdykvg==
Sec-WebSocket-Version: 13
Cookie: XSRF-TOKEN=PMizg2OffIz9xin5rbNr; SESSION=eELLEvaUxE

--- response header ---
HTTP/1.1 101 Switching Protocols
Server: nginx
Date: Fri, 18 Jan 2019 22:38:07 GMT
Connection: upgrade
Upgrade: websocket
Sec-WebSocket-Accept: iD0uaDw+g6epi5VbEngzBz2sCYk=

send: '\x81\xfe\x00\xa4\x07\x16[\xfc|4+\x9ds~(\xde=6\x00\xde(n"\x86(y+\x99it6\x9fXf)\x93ms8\x88(z4\x9b`\x7f5\x9b%:{\xde(n"\x86(y+\x99it6\x9fXf)\x93ms8\x88(e>\x92ty)\x8f%Kw\xdc%\x7f5\x88bd=\x9dds(\xde=6\x00\xde\x7fo!\xd2hf>\x92e{8\xa3wd4\x96bu/\xd2Ky<\x9bnx<\xd2Bx/\x8e~4w\xdc%n"\x86)y+\x99it6\x9fXf)\x93ms8\x88)E>\x92ty)\xd2Qw7\x89b4\x06\x81'
client sent
client receiving...


*4. This part does NOT work:

while True:
    try:
        result = ws.recv()
        print("client received '%s'" % result)
    except Exception as error:
        print "client error: {e}".format(e = error)
        break
ws.close()

Debug trace
send: '\x88\x82Pk\x15\x18S\x83'


So I get wiered characters when ws.recv() is invoked. And I get an error : ws is already closed.

Any idea ? suggestion ? Please I spent hours... I may miss something evident, do not hesitate to tell me...

Best Regards,
Francine

build_x86.sh fails to fetch sdbusplus

Cloning into 'sdbusplus-src'...
ssh: Could not resolve hostname git-amr-2.devtools.intel.com: Name or service not known
fatal: Could not read from remote repository.

Error about "AX_CXX_COMPILE_STDCXX_17(noext)"

Hi,

I am a newbie on Bmcweb. I am trying to build Bmcweb along without OpenBMC but fail. I get these errors.

`johnny is not in the sudoers file. This incident will be reported.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/johnny/projects/bmcweb/3rdparty
[ 2%] Performing update step for 'tinyxml2'
[ 5%] Performing configure step for 'tinyxml2'
CMake Deprecation Warning at CMakeLists.txt:11 (cmake_policy):
The OLD behavior for policy CMP0063 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/johnny/projects/bmcweb/tinyxml2-build
[ 7%] Performing build step for 'tinyxml2'
[ 50%] Built target tinyxml2
[100%] Built target xmltest
[ 10%] Performing install step for 'tinyxml2'
[ 50%] Built target tinyxml2
[100%] Built target xmltest
Install the project...
-- Install configuration: ""
-- Up-to-date: /home/johnny/projects/bmcweb/prefix/lib/libtinyxml2.so.6.0.0
-- Up-to-date: /home/johnny/projects/bmcweb/prefix/lib/libtinyxml2.so.6
-- Up-to-date: /home/johnny/projects/bmcweb/prefix/lib/libtinyxml2.so
-- Up-to-date: /home/johnny/projects/bmcweb/prefix/include/tinyxml2.h
-- Up-to-date: /home/johnny/projects/bmcweb/prefix/lib/pkgconfig/tinyxml2.pc
-- Installing: /home/johnny/projects/bmcweb/prefix/lib/cmake/tinyxml2/tinyxml2Config.cmake
-- Up-to-date: /home/johnny/projects/bmcweb/prefix/lib/cmake/tinyxml2/tinyxml2Targets.cmake
-- Installing: /home/johnny/projects/bmcweb/prefix/lib/cmake/tinyxml2/tinyxml2Targets-noconfig.cmake
[ 12%] Completed 'tinyxml2'
[ 20%] Built target tinyxml2
[ 22%] Performing update step for 'sdbusplus-project'
[ 25%] No configure step for 'sdbusplus-project'
[ 27%] Performing build step for 'sdbusplus-project'

  • AUTOCONF_FILES='Makefile.in aclocal.m4 ar-lib autom4te.cache compile config.guess config.h.in config.sub configure depcomp install-sh ltmain.sh missing *libtool test-driver'

  • case $1 in

  • autoreconf -vfi
    autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -Im4 autoreconf: configure.ac: tracing autoreconf: running: libtoolize --copy --force libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'. libtoolize: copying file 'build-aux/ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. libtoolize: copying file 'm4/libtool.m4' libtoolize: copying file 'm4/ltoptions.m4' libtoolize: copying file 'm4/ltsugar.m4' libtoolize: copying file 'm4/ltversion.m4' libtoolize: copying file 'm4/lt~obsolete.m4' autoreconf: running: /usr/local/bin/autoconf --force autoreconf: running: /usr/local/bin/autoheader --force autoreconf: running: automake --add-missing --copy --force-missing configure.ac:26: installing 'build-aux/compile' configure.ac:7: installing 'build-aux/missing' Makefile.am: installing 'build-aux/depcomp' autoreconf: Leaving directory .'
    Run "./configure ${CONFIGURE_FLAGS} && make"

  • echo 'Run "./configure ${CONFIGURE_FLAGS} && make"'
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking whether make supports nested variables... yes
    checking whether make supports nested variables... (cached) yes
    checking whether the C++ compiler works... yes
    checking for C++ compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C++ compiler... yes
    checking whether /usr/local/gcc-8.2/bin/g++-7.4 accepts -g... yes
    checking for style of include used by make... GNU
    checking dependency style of /usr/local/gcc-8.2/bin/g++-7.4... gcc3
    checking for gcc... /usr/local/gcc-8.2/bin/gcc-7.4
    checking whether we are using the GNU C compiler... yes
    checking whether /usr/local/gcc-8.2/bin/gcc-7.4 accepts -g... yes
    checking for /usr/local/gcc-8.2/bin/gcc-7.4 option to accept ISO C89... none needed
    checking whether /usr/local/gcc-8.2/bin/gcc-7.4 understands -c and -o together... yes
    checking dependency style of /usr/local/gcc-8.2/bin/gcc-7.4... gcc3
    checking for ar... ar
    checking the archiver (ar) interface... ar
    checking whether make sets $(MAKE)... (cached) yes
    checking for a Python interpreter with version >= 2.7... python
    checking for python... /usr/bin/python
    checking for python version... 2.7
    checking for python platform... linux2
    checking for python script directory... ${prefix}/lib/python2.7/dist-packages
    checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages
    checking for pkg-config... /usr/bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    checking for SYSTEMD... yes
    checking how to run the C++ preprocessor... /usr/local/gcc-8.2/bin/g++-7.4 -E
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking systemd/sd-bus.h usability... yes
    checking systemd/sd-bus.h presence... yes
    checking for systemd/sd-bus.h... yes
    ./configure: line 5702: syntax error near unexpected token noext' ./configure: line 5702: AX_CXX_COMPILE_STDCXX_17(noext)'
    CMakeFiles/sdbusplus-project.dir/build.make:111: recipe for target '/home/johnny/projects/bmcweb/sdbusplus-project/src/sdbusplus-project-stamp/sdbusplus-project-build' failed
    make[2]: *** [/home/johnny/projects/bmcweb/sdbusplus-project/src/sdbusplus-project-stamp/sdbusplus-project-build] Error 2
    CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/sdbusplus-project.dir/all' failed
    make[1]: *** [CMakeFiles/sdbusplus-project.dir/all] Error 2
    Makefile:83: recipe for target 'all' failed
    make: *** [all] Error 2
    CMake Error at /usr/share/cmake-3.14/Modules/FindBoost.cmake:2124 (message):
    Unable to find the requested Boost libraries.

    Boost version: 1.58.0

    Boost include path: /usr/include

    Detected version of Boost is too old. Requested version was 1.66 (or
    newer).
    Call Stack (most recent call first):
    CMakeLists.txt:129 (find_package)

OPENSSL_INCLUDE_DIR /usr/include
CMAKE_BUILD_TYPE=
-- Configuring incomplete, errors occurred!
See also "/home/johnny/projects/bmcweb/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. Stop.`

First error:
./configure: line 5702: syntax error near unexpected token noext'
./configure: line 5702: AX_CXX_COMPILE_STDCXX_17(noext)'
I think the error relate to ".m4" files incomplete in sdbusplus source code therefore I clone autoconf and move all of .m4 to "bmcweb/sdbusplus-src" and "bmcweb/build/sdbusplus-src" both. Actully, I added one more file "ax_cxx_comoile_stdcxx_17.m4" that is downloaded from GNU but they don't helpful for this issue.

Second error:
`CMake Error at /usr/share/cmake-3.14/Modules/FindBoost.cmake:2124 (message):
Unable to find the requested Boost libraries.

Boost version: 1.58.0
CMakeOutput.log
CMakeOutput.log

Boost include path: /usr/include

Detected version of Boost is too old. Requested version was 1.66 (or
newer).`
I downloaded boost 1.68. How can I redefine the path for Boost?

Thank you for reply and help!

bmc web /redfish/v1/Managers/bmc Version mismatch

There are two BMC images on the flash,

"Version": "2.6.0-rc1-150-ge14eac3",  Active  (Priority 0, currently running)
"Version": "2.6.0-rc1-151-gf8d0724"    Active (Priority 1, active but not running)

Now the /redfish/v1/Managers/bmc/ shows the Active but not the running one here.

"FirmwareVersion": "2.6.0-rc1-151-gf8d0724",

Verify BMC Firmware Version :: Get firmware version from BMC manager. | FAIL |
2.6.0-rc1-151-gf8d0724 != 2.6.0-rc1-150-ge14eac3

So I believe this needs to be fixed ? @edtanous @anoo1

Session Member and count show 0 when queried using Active session

$ curl -k -H "X-Auth-Token: PN5bNYdgjagfgXCkaOmf" -X GET  https://${BMC_IP}/redfish/v1/SessionService/Sessions/
{
  "@odata.context": "/redfish/v1/$metadata#SessionCollection.SessionCollection",
  "@odata.id": "/redfish/v1/SessionService/Sessions/",
  "@odata.type": "#SessionCollection.SessionCollection",
  "Description": "Session Collection",
  "Members": [],
  "[email protected]": 0,
  "Name": "Session Collection"
}

Atleast there should be 1 for this session .. Looks like the

  "Members": [],
  "[email protected]": 0,

Member show none and count 0 ?

Example like "/redfish/v1/SessionService/Sessions/UKXvb6qc9S" for a given active session..

$ curl -k -H "X-Auth-Token: PN5bNYdgjagfgXCkaOmf" -X GET  https://${BMC_IP}/redfish/v1/SessionService/Sessions/UKXvb6qc9S
{
  "@odata.context": "/redfish/v1/$metadata#Session.Session",
  "@odata.id": "/redfish/v1/SessionService/Sessions/UKXvb6qc9S",
  "@odata.type": "#Session.v1_0_2.Session",
  "Description": "Manager User Session",
  "Id": "UKXvb6qc9S",
  "Name": "User Session",
  "UserName": "root"
}

Issue building with openbmc SDK - sdbusplus

I've seen these issues - #2 and #3 - but I believe it to be different from what I'm seeing now.

Here is my process

  • Source into SDK ". /home/ircadmin/OpenBMCTutorials/SDK/romulus-2019-02-04/environment-setup-armv6-openbmc-linux-gnueabi"
  • Fresh checkout of latest bmcweb
  • CD into repo
  • Run build_x86.sh ". build_x86.sh"

When the script finishes I get the following

-- Build files have been written to: /home/ircadmin/OpenBMCTutorials/Code/bmcweb/build
Scanning dependencies of target bmcweb
[ 16%] Building CXX object CMakeFiles/bmcweb.dir/src/webserver_main.cpp.o
In file included from /home/ircadmin/OpenBMCTutorials/Code/bmcweb/build/sdbusplus-src/sdbusplus/asio/detail/async_send_handler.hpp:21,
from /home/ircadmin/OpenBMCTutorials/Code/bmcweb/build/sdbusplus-src/sdbusplus/asio/connection.hpp:23,
from /home/ircadmin/OpenBMCTutorials/Code/bmcweb/include/dbus_singleton.hpp:2,
from /home/ircadmin/OpenBMCTutorials/Code/bmcweb/include/dbus_monitor.hpp:7,
from /home/ircadmin/OpenBMCTutorials/Code/bmcweb/src/webserver_main.cpp:5:
/home/ircadmin/OpenBMCTutorials/SDK/romulus-2019-02-04/sysroots/armv6-openbmc-linux-gnueabi/usr/include/sdbusplus/bus.hpp: In member function ‘void sdbusplus::bus::bus::set_should_close(bool)’:
/home/ircadmin/OpenBMCTutorials/SDK/romulus-2019-02-04/sysroots/armv6-openbmc-linux-gnueabi/usr/include/sdbusplus/bus.hpp:156:34: error: ‘sd_bus_flush_close_unref’ is not a member of ‘sdbusplus::SdBusInterface’
&SdBusInterface::sd_bus_flush_close_unref;
^~~~~~~~~~~~~~~~~~~~~~~~
/home/ircadmin/OpenBMCTutorials/SDK/romulus-2019-02-04/sysroots/armv6-openbmc-linux-gnueabi/usr/include/sdbusplus/bus.hpp: In member function ‘void sdbusplus::bus::bus::flush()’:
/home/ircadmin/OpenBMCTutorials/SDK/romulus-2019-02-04/sysroots/armv6-openbmc-linux-gnueabi/usr/include/sdbusplus/bus.hpp:173:24: error: ‘class sdbusplus::SdBusInterface’ has no member named ‘sd_bus_flush’; did you mean ‘sd_bus_call’?
int r = _intf->sd_bus_flush(_bus.get());
^~~~~~~~~~~~
sd_bus_call
/home/ircadmin/OpenBMCTutorials/SDK/romulus-2019-02-04/sysroots/armv6-openbmc-linux-gnueabi/usr/include/sdbusplus/bus.hpp: In member function ‘void sdbusplus::bus::bus::close()’:
/home/ircadmin/OpenBMCTutorials/SDK/romulus-2019-02-04/sysroots/armv6-openbmc-linux-gnueabi/usr/include/sdbusplus/bus.hpp:183:16: error: ‘class sdbusplus::SdBusInterface’ has no member named ‘sd_bus_close’; did you mean ‘sd_bus_call’?
_intf->sd_bus_close(_bus.get());
^~~~~~~~~~~~
sd_bus_call
CMakeFiles/bmcweb.dir/build.make:62: recipe for target 'CMakeFiles/bmcweb.dir/src/webserver_main.cpp.o' failed
make[2]: *** [CMakeFiles/bmcweb.dir/src/webserver_main.cpp.o] Error 1
CMakeFiles/Makefile2:936: recipe for target 'CMakeFiles/bmcweb.dir/all' failed
make[1]: *** [CMakeFiles/bmcweb.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

CMakeOutput.log

Unexpected multiple resource created for Systems

@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",
"@odata.id": "/redfish/v1/Systems/1",
"@odata.type": "#ComputerSystem.v1_3_0.ComputerSystem",
"Actions": {
  "#ComputerSystem.Reset": {
    "[email protected]": [
      "On",
      "ForceOff",
      "GracefulRestart",
      "GracefulShutdown"
    ],
    "target": "/redfish/v1/Systems/1/Actions/ComputerSystem.Reset"
  }
}
,```

```"
@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",
"@odata.id": "/redfish/v1/Systems/5",
"@odata.type": "#ComputerSystem.v1_3_0.ComputerSystem",
"Actions": {
  "#ComputerSystem.Reset": {
    "[email protected]": [
      "On",
      "ForceOff",
      "GracefulRestart",
      "GracefulShutdown"
    ],
    "target": "/redfish/v1/Systems/5/Actions/ComputerSystem.Reset"
  }
}

Is this valid why we would have these multiple resources ? System/1 ... System/5.. and so on ?
Shouldn't it be just 1 resource System/1 here?

Redfish(Systems): Unnecessary code is there for CPU and Dimm interface(Empty Interface)

I saw that bmcweb code is referring to some properties which is not there in the meta-phosphor/phosphor-dbus-interfaces.

I could have seen that the dimm or cpu are empty interfaces but in the code, we are expecting the following properties

 for (const std::pair<std::string, VariantType>
                                                 &property : properties)
  {
     if (property.first == "MemorySizeInKb") >>>>>>> we don't have this property under Dimm inetrface(https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Inventory/Item/Dimm.interface.yam)
                        
  connection.first, path,
  "org.freedesktop.DBus.Properties", "GetAll",                                     "xyz.openbmc_project.Inventory.Item.Dimm"
 if (property.first == "ProcessorFamily") >>>> same here I don't see this property under (https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Inventory/Item/Cpu.interface.yaml)
           
 connection.first, path,
  "org.freedesktop.DBus.Properties", "GetAll", 
  "xyz.openbmc_project.Inventory.Item.Cpu");

I am not getting why we are expecting this property here?

@edtanous ^^^^

gateway field for the link local address is not there in redfish

gateway field for the link local address is not there.

curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Managers/bmc/EthernetInterfaces/eth0/
{
"@odata.context": "/redfish/v1/$metadata#EthernetInterface.EthernetInterface",
"@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0",
"@odata.type": "#EthernetInterface.v1_2_0.EthernetInterface",
"Description": "Management Network Interface",
"IPv4Addresses": [
{
"Address": "169.254.xx.xx",
"AddressOrigin": "IPv4LinkLocal",
"SubnetMask": "255.255.0.0"
},
{
"Address": "xx.xx.xx.xx",
"AddressOrigin": "Static",
"Gateway": "xx.xx.xx.1",
"SubnetMask": "xx.xx.xx.0"
}
],
"Id": "eth0",
"MACAddress": "xx.xx.xx.xx.xx.xx",
"Name": "Manager Ethernet Interface",
"SpeedMbps": 0,
"VLAN": {
"VLANEnable": false,
"VLANId": 0
}

Where as REST will give this output:
{
"data": {
"/xyz/openbmc_project/network/eth0/ipv4/44da1a5": {
"Address": "xx.xx.xx.xx",
"Gateway": "xx.xx.xx.1",
"Origin": "xyz.openbmc_project.Network.IP.AddressOrigin.Static",
"PrefixLength": xx,
"Type": "xyz.openbmc_project.Network.IP.Protocol.IPv4"
},
"/xyz/openbmc_project/network/eth0/ipv4/c6760cb6": {
"Address": "169.254.xx.xx",
"Gateway": "0.0.0.0",
"Origin": "xyz.openbmc_project.Network.IP.AddressOrigin.LinkLocal",
"PrefixLength": xx,
"Type": "xyz.openbmc_project.Network.IP.Protocol.IPv4"
}
},
"message": "200 OK",
"status": "ok"

Host is off but BMC web Chassis PowerState shows it's powered on

root@witherspoon:~# obmcutil state
CurrentBMCState     : xyz.openbmc_project.State.BMC.BMCState.Ready
CurrentPowerState   : xyz.openbmc_project.State.Chassis.PowerState.Off
CurrentHostState    : xyz.openbmc_project.State.Host.HostState.Off
root@witherspoon:~# obmcutil power
pgood = 0
state = 0
pgood_timeout = 10

but bmc web says its poweron

$ curl -k -H "X-Auth-Token: bMdxqax1Ft2bWdISv6gc" -X GET https://${BMC_IP}/redfish/v1/Chassis/system
{
  "@odata.context": "/redfish/v1/$metadata#Chassis.Chassis",
  "@odata.id": "/redfish/v1/Chassis",
  "@odata.type": "#Chassis.v1_4_0.Chassis",
  "BuildDate": "",
  "ChassisType": "RackMount",
  "Id": "system",
  "Manufacturer": "",
  "Model": "8335-GTC",
  "Name": "system",
  "PartNumber": "",
  "Power": {
    "@odata.id": "/redfish/v1/Chassis/system/Power"
  },
  "PowerState": "On"  <------------------------------,
  "SerialNumber": "131B6DB",
  "Thermal": {
    "@odata.id": "/redfish/v1/Chassis/system/Thermal"
  }
}

Build failing - cannot find boost/asio.hpp

Hi,

I've been trying to build the bmcweb both using the shell script and manually using cmake but it looks like there's an include path problem on my machine.
In file included from /home/tomek/git/bmcweb/src/getvideo_main.cpp:20:0: /home/tomek/git/bmcweb/include/ast_video_puller.hpp:4:10: fatal error: boost/asio.hpp: No such file or directory #include <boost/asio.hpp> ^~~~~~~~~~~~~~~~
After a small investigation I've figured out that main CMakeLists.txt:130 might be setting the include dirs for boost incorrectly:
include_directories (${BOOST_SRC_DIR})
and I think it should be:
include_directories (${Boost_INCLUDE_DIRS})
https://cmake.org/cmake/help/v3.10/module/FindBoost.html

Is this right or am I missing something?
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.