openbmc / bmcweb

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

buildresult from docker build fails to start #148

Closed jeb-de closed 3 years ago

jeb-de commented 4 years ago

Building with the docker script by

./build_x86_docker.sh

creates the expected build result at

build/bmcweb

But starting fails with

# docker run -v $PWD:/app -it bmcweb
terminate called after throwing an instance of 'boost::wrapexcept<boost::system::system_error>'
  what():  assign: Bad file descriptor

Expected behaviour: The bmcweb starts and serves the https on port 443 inside the docker container.

jeb-de commented 4 years ago

After some fiddling I got it working with (inside the docker contaner)

service dbus start
touch /etc/ssl/certs/authority
./bmcweb

The port is now 18080, querying the redfish root works:

curl -k https://${BMC_IP}:18080/redfish/v1

But the default user/password combination doesn't work

curl -k https://${BMC_IP}:18080/redfish/v1/Systems --user root:0penBmc -w '\n%{http_code}'

Result::

Unauthorized 
401

Expected result:

{
  "@odata.id": "/redfish/v1",
  "@odata.type": "#ServiceRoot.v1_5_0.ServiceRoot",
  "AccountService": {
    "@odata.id": "/redfish/v1/AccountService"
  },
  "CertificateService": {
    "@odata.id": "/redfish/v1/CertificateService"
  },
...

200

How can this be fixed?

leon728 commented 4 years ago

use passwd to change root password to '0penBmc', or just create a new user

edtanous commented 3 years ago

I've seen this as well with non socket activated files. A workaround is to launch using the bmcweb.socket and bmcweb.service files. As is, this is a regression, and will look when I have time. I suspect this has something to do with attempting to open an ipv6 port on systems that don't support ipv6, but that's just a guess.

edtanous commented 3 years ago

Resolved on master. Please reopen if this is still an issue.

paulnegz commented 3 years ago

After some fiddling I got it working with (inside the docker contaner)

service dbus start
touch /etc/ssl/certs/authority
./bmcweb

The port is now 18080, querying the redfish root works:

curl -k https://${BMC_IP}:18080/redfish/v1

But the default user/password combination doesn't work

curl -k https://${BMC_IP}:18080/redfish/v1/Systems --user root:0penBmc -w '\n%{http_code}'

Result::

Unauthorized 
401

Expected result:

{
  "@odata.id": "/redfish/v1",
  "@odata.type": "#ServiceRoot.v1_5_0.ServiceRoot",
  "AccountService": {
    "@odata.id": "/redfish/v1/AccountService"
  },
  "CertificateService": {
    "@odata.id": "/redfish/v1/CertificateService"
  },
...

200

How can this be fixed?

How were you able to get it to work?

edtanous commented 3 years ago

But the default user/password combination doesn't work

bmcweb does not control the passwords on your system, it uses PAM to log in. Make sure you've installed bmcweb (not just ran from the build dir) to get the relevant pam config, then ensure that the necessary groups are present for your user, then you can use your normal desktop username/password to log in.